Skip to content

cron: the night-loop card keeps its law consts test-local (Refs #11836) - #12374

Merged
gHashTag merged 1 commit into
masterfrom
feat/night-loop-card-consts
Oct 25, 2026
Merged

gHashTag merged 1 commit into
masterfrom
feat/night-loop-card-consts

Conversation

@gHashTag

Copy link
Copy Markdown
Collaborator

The night-loop cron card (specs/crons/t27os-night-loop.t27) carried 48 top-level consts beyond the generator's set. Trinity's site generator (apps/website/scripts/agents-from-specs.mjs, the HOSTS/consts schema check) fails a specs/crons/ card on any unknown top-level constant, so trinity's next sync of the vendored corpus would have gone red on ~48 'unknown constant' lines and taken the site build down with it.

The fix follows the convention the merged sibling card set (specs/crons/t27os-repair-actor.t27, #12147): the generator's own 15 constants (CRON_REQUIRED + INTERVAL_MS + NOTE) stay top-level; every law string, verdict code and recorded prompt moves into the card's test blocks as test-local consts, and the functions read literals with the const name in a trailing comment. Each section says once, in its comment, which constants its tests carry.

Meaning identical, tests real (L4): the same 48 test blocks with the same asserts -- 48/48 pass, 0 fail, 0 vacuous (t27c test-report), and 48/48 again at seal time. The card's seal is recomputed; all five hashes MATCH. Verified against the generator that would have broken: with this card vendored, node scripts/agents-from-specs.mjs on trinity origin/main runs clean (0 problems; the launchd-host card passes HOSTS and the INTERVAL_MS rule).

Preflight is 7/9 on this branch: seal-coverage and seal-currency are RED on 8 seals this PR does not touch (GitDiff.json, git_GitDiff.json, JitSemantics.json, vm_JitSemantics.json, PackedVsa.json, vsa_PackedVsa.json, TriBuilder.json, pipeline_TriBuilder.json). Their specs moved on master today after their seals (specs/vm/jit_semantics.t27 changed 10-25 15:13, its seal last touched 10-06; same shape for vsa and builder), so the staleness exists at origin/master itself. This card's own seal verifies clean (t27c seal --verify: all hashes MATCH).

Refs #11836.

{
  "version": 1,
  "head_sha": "17a7e38574f56f0cf07c9e864ad9ab1dfe57e343",
  "summary": "The night-loop cron card moves its 48 extra top-level consts into test-local consts so trinity's site generator stops failing on the card, with meaning and tests identical",
  "tests": [
    {"command": "t27c test-report specs/crons/t27os-night-loop.t27", "result": "48/48 tests pass, 0 vacuous", "status": "passed", "evidence": "tests: 48, pass: 48, fail: 0; vacuous passes 0 of 48 (tri test on the branch worktree)"},
    {"command": "t27c seal --save + --verify specs/crons/t27os-night-loop.t27", "result": "all hashes MATCH", "status": "passed", "evidence": "gen_hash_rust: MATCH ... all hashes MATCH; tests 48/48 pass at seal time; spec_hash 71690c42... recomputed"},
    {"command": "trinity agents-from-specs.mjs with the card vendored", "result": "0 problems, card accepted", "status": "passed", "evidence": "node scripts/agents-from-specs.mjs on trinity origin/main with the fixed card vendored printed no problem lines; without the fix the same run printed 48 unknown-constant errors"},
    {"command": "git diff --numstat origin/master", "result": "one spec plus its seal only", "status": "passed", "evidence": "141 insertions 114 deletions across specs/crons/t27os-night-loop.t27 and .trinity/seals/crons_t27os-night-loop.json; test inventory diff against master is empty (same 48 test names)"},
    {"command": "tri preflight", "result": "7/9, both reds pre-exist on master", "status": "passed", "evidence": "seal-coverage and seal-currency RED on 8 unrelated seals (JitSemantics, PackedVsa, TriBuilder, GitDiff and twins) whose specs changed on master after their seals; this card's own seal verifies"}
  ],
  "tags": ["cron_card", "t27os", "specs_crons"],
  "blog": {
    "title": "The night-loop card stops carrying its law at top level",
    "summary": "A cron card that restated its law as 48 top-level constants was one trinity sync away from breaking the site build. The consts move into the tests that use them, which is where the sibling card already keeps them.",
    "outline": [
      "The generator's schema is the contract: a card publishes 15 fields and nothing else at top level, so a card that also carries its verdict codes as constants reads as a schema violation no matter how real the law is.",
      "The move is mechanical and the tests do not change: every assert keeps its name, the functions read literals with the name beside them, and each section's comment states the values once.",
      "48/48 tests pass before and after, which is the whole point: the card's meaning lives in its tests, and moving the constants between scopes does not move it."
    ]
  }
}

The trinity site generator (apps/website/scripts/agents-from-specs.mjs) fails a
specs/crons/ card on any top-level const beyond its own CRON_REQUIRED +
CRON_OPTIONAL set, and this card carried 48 extras beside the generator's 15 --
the next sync would have gone red on 'unknown constant'. The merged sibling
card t27os-repair-actor (#12147) is the convention: law strings and verdict
constants live as TEST-LOCAL consts, the functions read literals with the name
in a trailing comment, and the generator's 15 stay top-level.

Meaning identical: same 48 tests (48/48 pass, 0 vacuous), same asserts, same
section comments, the const values restated once per section they left. The
card's seal is recomputed (t27c seal --save, all hashes MATCH).

Preflight 7/9 on this branch: seal-coverage and seal-currency are RED on 8
unrelated seals (GitDiff/vm_JitSemantics/vsa_PackedVsa/pipeline_TriBuilder and
their twins) whose specs moved on master today after their seals -- stale at
origin/master, touched by nothing here. This card's own seal verifies.
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-25 10:10:31 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 37
PRs with All Checks Green 13
READY 5
FAILING 37
PENDING 0
NO CHECKS YET 0

These columns do not partition: 5 + 37 + 0 + 0 = 42, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=75249fe1efad != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@tri-claw

tri-claw Bot commented Oct 25, 2026

Copy link
Copy Markdown

Summary by t27-bees

Checked by the t27 compiler

t27c parse, parse-complete and typecheck on each changed .t27 file at 17a7e38. Nothing was generated, built or run. A pass means the file is well formed, not that it is right.

  • specs/crons/t27os-night-loop.t27: parses and typechecks.

Read by the model

The night-loop cron card moves its 48 extra top-level constants into test-local consts so Trinity's site generator (agents-from-specs.mjs) stops rejecting the card. The generator only allows its own 15 constants at top level in specs/crons/ cards; the sibling repair-actor card already follows this pattern.

Worth a look

  • specs/crons/t27os-night-loop.t27:76-80 (ui_health): Magic numbers 1, 3, 2, 4, 0 replace named verdict constants with trailing comments. If a test updates its local const but the function literal isn't changed, the test still passes (it uses its own const) while the function behavior diverges.
  • specs/crons/t27os-night-loop.t27:83-85 (ui_is_finding): Same pattern — literal 2, 3, 4 with comments. A mismatch between function literals and test consts would not be caught by the existing tests.
  • specs/crons/t27os-night-loop.t27:98-101 (ui_down_action): Literals 0, 1, 2 for repair actions. The tests define UI_ACT_REBUILD/REQUEST/HOLD locally and assert against them, but the function body is now the only place the real values live.
  • specs/crons/t27os-night-loop.t27:230-235 (sweep_due, sweep_remove): SWEEP_EVERY 6 and SWEEP_MAX_REMOVE 8 inlined. The test the_sweep_names_its_law_and_its_beat defines these locally and checks them, but the functions don't reference those consts.
  • specs/crons/t27os-night-loop.t27:598-610 (prompt_drift, first_missing_step): Hardcoded 9 (STEP_COUNT) and "publish.txt" (UI_FIRST_SOURCE) in loop conditions and contains check. Tests define these as local consts and verify behavior, but the function bodies are now the source of truth.

Read: 2 files, +141 -114, the whole diff. Head 17a7e38. Model: openai-compatible/nvidia/nemotron-3-ultra-550b-a55b. Commands: @t27-bees review | summary | help | pause | resume. Free for every repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant