p = r"C:\Users\decid\Documents\projects\spt-core\.worktrees\ns23-w1\traceable-reqs.toml"
s = open(p, encoding="utf-8").read()

anchor = '[[requirements]]\nid = "REQ-NOW-SIGNAL-DEFERRED-CATEGORIES"'
assert anchor in s

updates_title = (
    "THE UPDATES CATEGORY SURFACES RUNNING VERSIONS FOR THREE SUBJECTS, AND THE DELTA DISCIPLINE IS ITS EVENT DETECTOR "
    "(releases#245, operator-linked at the #23 intake). The subjects are the ticket's three: spt-core itself, the endpoint's current harness adapter, "
    "and the adapter of every shell currently registered to the endpoint -- keyed PER SHELL, not per adapter, because an agent acts on the shell and a version that moved under one instance is the fact it needs. "
    "NO EVENT JOURNAL IS BUILT, and that is the design rather than an omission: each subject's seen-set key CARRIES its version, so a session is told once at the version it first observed and hears nothing again until that version CHANGES, at which point the key is new and the line fires. "
    "An update event IS a version that differs from the one this session was told about, and the seen-set already answers that question exactly; a separate journal would be a second source for one fact. "
    "THE PRODUCT VERSION LEADS FOR spt-core, never the applied-update counter: the counter is a different axis (update-set sequence) from the version an operator speaks, and an agent can only act on the version it is running. "
    "ABSENCE IS SILENCE: an endpoint with no update history emits nothing, because no-updates is not an update, and a shell whose adapter is deregistered or unreadable contributes NOTHING rather than an error line -- this rides a turn-boundary hook, where a diagnostic in the payload is noise the author cannot act on. "
    "The category is POST-v1: it does not widen the ratified v1 set on our own authority, it is appended after it by operator ruling, and render order is declaration order so the ratified order is untouched."
)

seal_title = (
    "THE SEAL_BRIEF CATEGORY TEACHES SEALING IN AT MOST TWO SHORT SENTENCES, ONCE PER SESSION "
    "(releases#18, ruled by the operator at the access-control grill follow-up 2026-07-29; the two-sentence bound is the operator constraint verbatim and is not ours to relax). "
    "IT ANSWERS EXACTLY TWO THINGS, in that order: what sealing IS and its significance as a PROVEN USER DIRECTIVE, and how the agent EXECUTES the proof. "
    "THE COMMAND IT NAMES MUST BE THE REAL ONE -- a payload whose entire purpose is telling an agent how to act is the worst possible place for an invented verb, and the first draft of this text cited a `spt seal verify` that does not exist; the shipped surface is `spt api seal verify <token>` with the content on stdin, mint via the `;;text;;` shortform. "
    "THE TEXT IS A CONSTANT, so the wording has ONE home and the two-sentence bound is auditable at a glance rather than reconstructed from a formatter. "
    "ONCE PER SESSION on the standing delta discipline: an agent that has been told does not need telling again, and a brief repeating every turn is precisely the noise that discipline exists to prevent. "
    "The category is POST-v1, appended by operator ruling rather than by widening the ratified set."
)

block = (
    '[[requirements]]\n'
    'id = "REQ-NOW-SIGNAL-UPDATES"\n'
    'title = "' + updates_title + '"\n'
    'required_stages = ["doc", "impl", "unit"]  # ACTIVATED in the delivering lane (todlando, NOW-SIGNAL W1 / releases#245, 2026-08-30).\n'
    '[[requirements]]\n'
    'id = "REQ-NOW-SIGNAL-SEAL-BRIEF"\n'
    'title = "' + seal_title + '"\n'
    'required_stages = ["doc", "impl", "unit"]  # ACTIVATED in the delivering lane (todlando, NOW-SIGNAL W1 / releases#18, 2026-08-30).\n'
)

s = s.replace(anchor, block + anchor, 1)
open(p, "w", encoding="utf-8", newline="").write(s)
print("two REQs minted")
