commit
Commit the current session's changes only, gateway-inline. Session-isolated (never -A, staged set verified against the session list), doc-sync-gated. The gateway runs the commit inline — it already ho
SKILL.mdplugins/super-bootstrap/skills/commit/SKILL.md
GitHubCommit — Session-Isolated, Doc-Sync-Gated (gateway-inline)
Commits the changes this Claude session produced, leaving prior uncommitted work alone. The gateway runs the flow inline — it holds the session's diff, file list, and change intent, so the mechanics carry no closure a fresh container would hold. A doc-sync judgment at or under the scope ceiling runs warm in that same context: the diff, the change intent, and the session's read docs are the judgment's inputs, and the gateway already holds them all. A scan scope above the ceiling moves whole to the cold doc-sync-scan agent rather than being truncated inline. Both are ordinary lanes.
Execution (gateway-inline)
Session-close entries — check first. /super-bootstrap:session-close invokes this door with one argument; no argument is the flow below, whole.
close-detect— the close's pre-pick judgment, read-only. Run §3's gate, §3b and §4 over the session's changes. §3's lanes see the worktree only, so the close's drafts — fix-now edits, resolve outcomes and the park move's durable doc edits — join by hand: their paths run the grep lane as<skill-base>/assets/doc-links.sh terms - | <skill-base>/assets/doc-links.sh hits -(a draft has no worktree diff forgrep-scopeto read;hits --by-term -in place ofhits -prints their per-term counts), take the citer lane at whole-file grain (refs <path>), and join the scan scope, and §4 reads their text, terminology and volatile-ID checks included. A close with no session changes runs this over the drafts alone. Stop after §4 and hand the caller each stale candidate, harness row, premise sheet row, restatement, terminology miss, volatile-ID hit, register item and integrity break, its exact edit drafted, plus the count of scope docs read and confirmed unchanged: the caller's pick is the user's round, so every resolve, offer and ask in §3b and §4 lands there. Worktree, HEAD and shared index stay as found, so new files take a throwaway index in place of §1'sgit add -N:<tmpidx>of roledetect, built withGIT_INDEX_FILE=<tmpidx> git read-tree HEADandGIT_INDEX_FILE=<tmpidx> git add -N -- <new paths>, exported asGIT_INDEX_FILEin each call that runs a §3 lane, and removed withrm -f <tmpidx>after §4.close-commit— the post-pick run; the rows the user picked are landed and join the session list. Run §1, §2, §3's two integrity checks on the final tree, then §5 over the commit row the caller hands over: one commit, or the N its "splits into N commits" clause states, partitioned by §5's test with no further ask; a different count stops and surfaces. Each part's paths are what that run's readback and final check read, and each part's readback runs as its own call after the previous commit, immediately before that part's commit. The pick settled every other §3, §3b and §4 result: no re-scan. A broken link or stale pin in an edit the close landed → the gateway repairs that link or pin and continues; a repair reaching further stops and surfaces; a break the pick declined stands acknowledged.
Session file list + grain — from this conversation, the files this session edited/wrote. This is the session-isolation ground truth; a file you don't remember touching stays off it. Each listed path takes a grain, read off
git diff HEAD -- <path>— base HEAD, never the shared index, which can hold another writer's stale entry: file grain when every hunk there is this session's edit (the normal case; a new file is file grain, recorded now withgit add -N <path>— intent-to-add, so every latergit diff HEADhere sees it and another writer's plain commit does not take it); hunk grain when the file also holds another writer's uncommitted edits. §5 commits each grain in its own lane; neither stages into the shared index.Gather state —
git status,git diff HEAD,git diff --staged,git log --oneline -10(recent style). A staged path outside the §1 list is another writer's state — so is a staged change or deletion on a path the worktree holds at HEAD (an entry an out-of-door commit left stale). Early warning only: name it with the commit; §5's lanes commit past it and leave it as it is — they refresh only the session paths' own shared-index entries. Another writer's staged change on a session path → stop and surface: committing would drop their staging. Unstage or restage another writer's entry only on the user's say-so.Doc-sync grep-gate — mechanical, no judgment:
- Deferred mode — check first (autorun-worktree isolated commit): doc-sync belongs to the merge boundary — skip all of §3, go to §5 (§5's staged-tree verify is skipped too).
- Frozen-provenance exemption — card lifecycle, history dimension: every changed path inside
docs/work/(card-thread appends, card deletions), plus every changeddocs/outward/OUT-*.md(thread appends, entry deletions) → skip the gate, go to the link check below then §5. Both are append-only threads, self-contained; cross-card ID mentions are frozen provenance, not behavior narration — sohitsandrefsleave everydocs/work/card thread and everydocs/outward/OUT-*.mdthread out of the scan scope too, whatever term they name or anchor they cite; each folder's standingREADME.mdnarrates its thread contract and stays in both lanes. A doc whose leading frontmatter declaresdimension: historyis frozen provenance the same way — a change to it yields no term (termsskips it),hitsandrefsleave it out of the scan scope, and the link check below still covers it. Mixed diff → run the gate on the other paths only. - Premise lane — product-anchor paths: the diff touches the product anchor (
docs/overview.md§ Problem / § User, or a dedicated product doc where the repo splits one out) and those sections' post-image carries a premise — body past the skeleton's{…}placeholder line, or, for a dedicated product doc with no shipped skeleton, prose beyond a scaffold stub in its Problem / User-equivalent sections → route the anchor portion through §3b — its closure set is the whole doc surface, so it already covers everything this gate would reach for the anchor; the rest of the diff continues through this gate. Sections still on the placeholder revise no premise → the anchor path stays in this gate like any other changed doc. - Grep lane — every list on stdin,
-argument: a path or term can hold spaces, so lists ride stdin via-, one item per line, never an unquoted expansion.<changed-list>below isgit -c core.quotePath=false diff --name-only HEAD -- <session paths…>. Each changed path yields at most one term — its basename minus the extension, or a skill's directory name for itsSKILL.md—<changed-list> | <skill-base>/assets/doc-links.sh terms -prints them, one per line; scaffolding paths (bench, tests, fixtures, goldens, session ledgers), asset extensions, generic basenames, terms under four characters, and the machine state harness-bootstrap seeds under.claude/(the runway receipt,templates/) yield none.<changed-list> | <skill-base>/assets/doc-links.sh grep-scope - | grep -vxF -f <(<changed-list>)prints the doc-surface files mentioning a term in code shape — a whole word inside backticks, or a path segment — so bare prose stays out; nothing printed → the grep lane is empty.grep-scopedemotes a wide code term: a term that on its own hits more docs than the scope ceiling, and whose every changed path is a modified file off the doc surface, counts only as a bare token inside backticks, and the symbol-shaped identifiers on those paths' changed lines (git diff HEAD) join the terms. A term from an added, deleted or renamed path, or one a changed doc also yields, is never demoted. So a doc narrating such a file's changed behavior while naming neither a changed identifier nor the bare stem is not scanned;/super-bootstrap:check-docs-consistencyis the backstop. Harness-seeded hub stems (overview,techstack,decisions, the runway receipt, the worktree template) count only as a bare token inside backticks: hub path mentions stay out of this lane to keep scope bounded. So an unlinked path mention of a hub doc is not scanned, and on a section-grain change neither is an anchorless link to one;/super-bootstrap:check-docs-consistencyis the backstop. A Godot text asset (.tscn,.tres) runs the inverse:termskeeps its extension (levels/Ending.tscn→Ending.tscn), andhitscounts that term only as a path segment (levels/Ending.tscn,Ending.tscn), never as a bare backtickedEnding— a scene or resource basename doubles as domain vocabulary. Hit files join the scan scope; the agent judges them cold (§4). The grep lane walks the markdown surface — a manifest description field the diff changes is read here directly. - Link-hit (reverse citers) — mechanical, beside the grep: for each changed
docs/**/ rootREADME.md/ plugin-README (plugins/*/README.md) path, and each changed*.mdpath a glob in the repo's.claude/doc-surfacematches (*crossing/), take its post-image hunk ranges fromgit diff HEAD -U0 -- <path>(@@ -a,b +c,d @@→+c,d) and run<skill-base>/assets/doc-links.sh anchors <path> <ranges…>.(top)among the slugs means whole-file grain →<skill-base>/assets/doc-links.sh refs <path>; otherwiserefs <path>#<slug>…in one call of the same script, which prints the union. Exclude the changed files themselves. Every file returned is a declared citer of the changed truth — collect them as the citer read-set. - Self-scope (changed docs) — mechanical, beside the citer lookup:
<changed-list> | <skill-base>/assets/doc-links.sh self -prints the changed paths that are doc-surface files in their own right — a deleted path, an off-surface path, and frozen provenance (card threads,docs/outward/OUT-*.md,dimension: history) all drop out. Every path printed joins the scan scope as its own scope doc: §4 reads it whole and holds its unchanged sections against the diff's claims, which is where a same-commit contradiction with the file's pre-existing prose sits. - Terminology candidates — mechanical, beside the self lane:
<changed-list> | <skill-base>/assets/doc-links.sh term-uses -printsdoc<TAB>line<TAB>term|avoid<TAB>matched text<TAB>Term— an added line of a changed doc that uses a term registered indocs/terminology.md(a**Term**:entry, or a word on its_Avoid_:line), case-insensitive whole word, outside fenced blocks.docs/terminology.mditself and frozen provenance drop out; a doc that already linksdocs/terminology.mddrops itstermcandidates and keeps itsavoidones — a wrong word is wrong whatever the doc links; nodocs/terminology.md→ the lane is empty. Every candidate's doc is already a scope doc through the self lane, so candidates ride beside the scope as lines to judge (§4), not as scope docs — they add nothing to the ceiling count. - Volatile-ID hits — mechanical, beside the terminology lane:
<changed-list> | <skill-base>/assets/doc-links.sh volatile-ids -printsdoc<TAB>line<TAB>id— an added line of a changed doc that carries aBUG/DEBT/GAP/OUT/PARKID, outside fenced blocks.docs/work/,docs/outward/,docs/parked.md,docs/test-queue.md,dimension: historydocs and the placeholder suffixxxxxdrop out. Every hit's doc is already a scope doc through the self lane, so hits ride beside the scope as lines to surface (§4), not as scope docs — they add nothing to the ceiling count. - Link-target extraction (forward links) — mechanical, beside the reverse lookup: from the diff's added lines, extract every markdown link target (
grep -oE '\]\([^)]+\.md[^)]*\)'over+lines), resolve each relative to its linking file. Each target is a doc the new prose claims agreement with — add the target files to the scan scope. - Scope ceiling — count before judging: the scan scope is citers ∪ grep hits ∪ link-targets ∪ changed docs. Print it before judging, in either lane —
scope: N docs, then one path per line. At or under 8 docs → the gateway judges the scope warm-inline (§4). Above 8 → the scope moves whole to the colddoc-sync-scandispatch (§4's cold lane) — never truncated to fit inline. In that lane, print the per-term hit counts beside the scope count — the grep-lane pipe withgrep-scope --by-term -in place ofgrep-scope -printsterm<TAB>countper term, highest first, a demoted term carrying its post-demotion count and a third columndemoted; counts are per term and include the changed files; thegrep -vxFstage drops out. - Any grep hit OR any citer OR any link-target OR any changed doc → run the doc-sync judgment (§4) over the scan scope — citer read-set + grep-hit files + link-target files + the changed docs themselves.
- All four lanes empty → the diff narrates nothing; go to §5. The self lane makes this the narrow branch it reads as: a diff that touched no doc-surface file outside the frozen-provenance exemptions — an asset, code, or exempt-thread diff.
- Link integrity (every non-deferred commit, exemption included): run
<skill-base>/assets/doc-links.sh checkfrom the repo root —<skill-base>is theBase directory for this skill:path surfaced at invocation; zero model tokens. Broken links (path or anchor) surface to the user with the commit: fix or explicitly acknowledge before landing; never silently skip. One class is exempt by construction — the consumed-card-link skip: a link from a card thread (docs/work/{BUG,DEBT,GAP}-*.md) to an absent card ID is consumed provenance — the sibling resolved — socheckskips it uncounted, while every other target from a card, and any dangling card link from a non-card doc, stays strict. - Model-pin integrity (every non-deferred commit): run
<skill-base>/assets/doc-links.sh pinsfrom the repo root; zero model tokens. Reads each agent file's frontmattermodel:and reports doc-surface lines whose restated tier disagrees with the agent named inside an inline code span —<doc>:<lineno>+ claimed tokens + actual tier + source path. Deliberately narrow, so the per-commit gate stays quiet: a line resolving to no agent or to several is skipped, and any one agreeing tier token clears it. Whole-surface by construction: it consults no scan scope, so a doc no enumeration lane reached is covered the same. Frozen provenance is out, as in every other claim lane — a closed-fork row or card thread restates a past tier by design. Stale pins surface to the user with the commit: fix or explicitly acknowledge before landing; never silently skip.
3b. Premise-closure lane (product-anchor diff) — a problem/ICP revision changes premise, not behavior; its closure is every doc whose framing leans on the anchor. Enumerate mechanically — <skill-base>/assets/doc-links.sh closure <anchor-path> prints the set: the doc surface minus consumables (per-item work files — docs/work/{BUG,DEBT}-*.md, docs/work/TEMPLATE.md) minus the anchor. Judgment runs only over the enumerated set — dispatch the premise-closure agent (Agent tool, subagent_type: "premise-closure"; prompt = the anchor diff hunks — git diff HEAD -U0 -- <anchor-path>, output pasted verbatim into the prompt (the judge has no shell; the pasted lines are its only view of the old premise) — + the anchor path + the enumerated paths, no staleness leans): its sheet (holds / re-frame / dangling per doc + coverage line) returns here; a coverage mismatch or a no-hunks line re-dispatches, the latter with the hunks pasted. Resolve with the user before the commit lands — re-frame: update the doc to align / acknowledge still-accurate; dangling: drop / merge / defer. Never silently fix, never silently skip. Then continue §3 on the rest of the diff.
Doc-sync judgment (gate hit) — two lanes, picked by §3's scope count: warm gateway-inline or the cold dispatch. Both lanes run the same procedure —
agents/doc-sync-scan.md§ Scan — and end in the same resolution.- Warm-inline (scope ≤ ceiling): the gateway applies § Scan itself, in its own context. Warm eyes are the point: hold the change intent and the session's reads beside the diff while judging. Every scope doc gets an outcome — a stale candidate (path + what's outdated + hunk) or read-and-confirmed-unchanged — printed as one line per doc before the resolution below:
<path> → stale: <what's outdated>or<path> → unchanged: <the sections read against the diff>. Done when every path §3 printed has its own line; a path without one is an incomplete gate, not aclean— judge that doc, then print its line. - Cold dispatch (scope > ceiling):
Agent,subagent_type: "doc-sync-scan"; prompt = the diff — the output ofgit diff HEAD -- <session paths>(a hunk-grain path is read against the session's hunks only), pasted verbatim or written to a file outside the worktree whose path the prompt names (rm -fit once the judge returns); the judge has no shell, so the output itself reaches it, never the command — + today's date + the scan scope + the restatement predicate's path (<skill-base>/assets/restatement-predicate.md) + the terminology candidate lines, verbatim, with the link predicate's path (<skill-base>/../check-docs-consistency/assets/link-predicate.md). The prompt carries these items and nothing beside them — no change intent, no suspects, no staleness leans. The agent judges the same procedure in its own window and returnsstale-docsorclean, with anyharness,restatements,terminologyandregisterbeside it; ano-diffline re-dispatches once with the diff supplied, and a secondno-diffstops the door and surfaces to the user. - Either lane stays scoped — never a whole-surface re-derivation; whole-surface coverage belongs to
/super-bootstrap:check-docs-consistency. - Stale candidates → resolve together with the user, in one list with the harness rows below: each row carries its drafted edit and its proposed outcome (update / acknowledge-accurate / skip), and the list takes one ask — approve it whole, or name the rows to change — never a question per row; never silently fix, never silently skip. The rows below that offer a card or a pick (restatement, terminology, volatile ID, register) join the same list as rows with a proposed outcome, so the doc-sync result takes that one ask. Land approved doc edits (inline for bounded prose; dispatch by closure). Resolved docs join the §1 list and take a grain per §1 (a new doc gets
git add -N). - Harness (§ Scan's
harnessoutput, either lane) → rows in that same list, each with its exact edit drafted.co-change: yesin harness this repo owns (not foreign-owned, below) → the row lands this round as a harness edit, through the audit the repo's harness requires for a harness edit, before the commit; the file joins the §1 list. An audit finding stops the door and surfaces; the commit waits until it is resolved. Foreign-owned harness — a copy another repo serves or vendors into this one (a.servedmarker in its skill directory, a<file>.servedsidecar, or the provenance the repo's harness declares for its other classes, a folder declared served whole included) or a file in another repo — routes by the repo's own finding lanes, concern first and provenance second: this repo's concern → a card via/super-bootstrap:log, the copy untouched; the owner's concern → name the path and the owner's route. The row states which route it took, and the commit proceeds.co-change: no→ its proposed outcome is a card via/super-bootstrap:logor none; the commit proceeds. - Nothing stale, no harness row → proceed.
- Restatements (§ Scan step 6, either lane) → a row in the same list — fact, K, locations, home — whose proposed outcome is a card via
/super-bootstrap:logor none; the list's one ask settles it, never a question of its own. Never edit for it; the commit proceeds whatever the answer. A stale copy among its locations still resolves as a stale candidate above. - Terminology (§ Scan step 7, either lane) → surface each substantive miss — doc, line, the word, and its action: a
termmiss reads "linkdocs/terminology.md", anavoidmiss reads "use the registered term <Term>" — as a row in the same list, its proposed outcome a card via/super-bootstrap:logor none. A candidate the judgment drops (homonym, passing token, catalog, ephemeral doc) is not reported. Never edit for it, never block; the commit proceeds whatever the answer. - Volatile IDs (§3's volatile-ID lane, either lane) → a row per hit in that same list — doc, line, the ID, its drafted edit (the outcome stated present-tense, or a commit sha cited) and its proposed outcome (update / skip). Never block; the commit proceeds whatever the answer.
- Register (§ Scan step 8, either lane) → a row per item in that same list — the word, doc:line, the proposed entry verbatim, the why — with its proposed outcome (register / skip); the list's one ask settles each row, and nothing is written silently. Register → land the entry in
docs/terminology.mdand link the using line todocs/terminology.md(a second word: add it to the Term's_Avoid_:line, and the session's added line takes the registered Term);docs/terminology.mdand the using doc join the §1 list and each takes a grain per §1. Skip → nothing is written; the commit proceeds either way.
- Warm-inline (scope ≤ ceiling): the gateway applies § Scan itself, in its own context. Warm eyes are the point: hold the change intent and the session's reads beside the diff while judging. Every scope doc gets an outcome — a stale candidate (path + what's outdated + hunk) or read-and-confirmed-unchanged — printed as one line per doc before the resolution below:
Message + commit — draft a Conventional Commit (
<type>(<scope>): <subject>, imperative ≤72 chars, body only when the why isn't in the diff, matchgit logstyle; one logical change per commit — a diff spanning two unrelated changes splits: partition the §1 list into one part per commit and run this step per part, where "§1 list", "session list" and<session paths>read that part; a path both changes touch puts both changes in one part (one commit), and its message names both). Explicit paths only — never-A/., never secrets (.env, keys), and never stage content into the shared index (§1's intent-to-add excepted): the index is shared across sessions in one checkout, and a plaingit commitfrom any of them takes every staged path. Any hunk-grain path puts the whole commit on the hunk lane. Each readback, the verify and the stamp is its own tool call, and the commit issues only after its result is read. Each call runs in a fresh shell, so name every index in its resolved form, written out in each call that uses it —<priv>is"$(git rev-parse --git-dir)/index-<session>"(a name unique to this session),<tmpidx>is"$(git rev-parse --git-dir)/index-<role>-<session>"— and carry a value one call reads into the next as a literal.- File grain —
git commit -o -- <session paths>. A new file is already intent-to-add from §1, and-ocommits it.-ocommits HEAD plus those paths' worktree content, leaves every other shared-index entry as it was, and refreshes the named paths' entries to the new HEAD. Readback:git diff HEAD --name-only -- <session paths>equals the §1 list — a listed path missing from it carries no change: drop it, or recheck the list. Order: readback → staged-tree verify → stamp (seam below) →git commit -o. - Hunk grain — a private index from HEAD.
- Two calls: read
git rev-parse HEADand keep its sha as<base>, thenGIT_INDEX_FILE=<priv> git read-tree <base>— the index and step 6's guard share one anchor. Any stop in steps 2–6 deletes the private index (rm -f <priv>). - Per hunk-grain path: write
git diff HEAD -- <path>to a patch file outside the worktree and keep its file header plus this session's git hunks whole — delete the rest. A git hunk that holds both writers' edits → stop and surface the path and the hunk: never split a hunk, never rebuild lines by hand.GIT_INDEX_FILE=<priv> git apply --cached <kept patch>. File-grain paths in the same commit:GIT_INDEX_FILE=<priv> git add -- <paths>. - Readback under the private index:
GIT_INDEX_FILE=<priv> git diff --cached HEAD --name-onlyequals the §1 list, and per hunk-grain pathGIT_INDEX_FILE=<priv> git diff --cached HEAD -- <path>equals the kept patch line for line outside itsindexand@@header lines (the new blob and the dropped hunks shift those). Any difference → stop and surface. - Staged-tree verify (below), before any commit.
- Stamp (seam below), where an audit stamp is installed — its own call, before step 6.
- Commit under the private index only while HEAD is still
<base>, the check and the commit chained in one command:[ "$(git rev-parse HEAD)" = "<base>" ] && GIT_INDEX_FILE=<priv> git commit …, the prefix immediately beforegit. HEAD moved → rebuild from step 1 on the new HEAD. After:git reset -q HEAD -- <committed paths>on the shared index (index only — the other writer's hunks stay in the worktree), thenrm -f <priv>.
- Two calls: read
- Staged-tree verify — declared command, differing tree; between readback and commit in both lanes. The consumer may declare one in
docs/techstack.md§ Staged-Tree Verify; none declared → skip. Deferred mode → skip: the gateway runs the declared Staged-Tree Verify once on the integrated tree, before base moves (merge/SKILL.md§ 5b). Otherwise it runs when the tree about to commit differs from the working tree: hunk grain always; file grain whengit status --porcelainlists any path outside the session list. Materialize that tree into a temp dir outside the worktree — hunk grain:GIT_INDEX_FILE=<priv> git checkout-index -a --prefix=<tmp>/; file grain, with<tmpidx>of roleverify:GIT_INDEX_FILE=<tmpidx> git read-tree HEAD,GIT_INDEX_FILE=<tmpidx> git add -- <session paths>,GIT_INDEX_FILE=<tmpidx> git checkout-index -a --prefix=<tmp>/— every call names the throwaway index, since a baregit read-treeoverwrites the shared one. Run the command there, then delete the dir andrm -f <tmpidx>. Failure → stop and surface: a green working tree does not speak for the tree that commits. - Harness-audit stamp seam — where an audit stamp is installed, stamp the set that commits. Installed =
<hook>,~/.claude/hooks/harness-audit-pretool.sh, exists; absent → skip the seam. It also needs anaudit-harness-editspass over these paths' current content, whose one-line verdict is<verdict>; no audit on record → skip the seam and name that with the commit. The stamp call itself (the verdict line, its exit codes) isaudit-harness-editsstep 5's; this door fixes its two lanes' forms, and its file-grain form stands in for step 5'sgit addfirst, since this door stages nothing into the shared index. File grain, with<tmpidx>of rolestamp, in one call:GIT_INDEX_FILE=<tmpidx> git read-tree HEAD && GIT_INDEX_FILE=<tmpidx> bash <hook> --stamp "<verdict>" $(git diff HEAD --name-only -- <session paths>); rc=$?; rm -f <tmpidx>; exit $rc— an index from HEAD stages no session path, so the stamp hashes each path's worktree content, which-ocommits. Write that commit asgit commit -o … -- <session paths>with every path literal, nocdin the command, and an existing HEAD; any other form makes the gate judge the whole dirty tree. Hunk grain, step 5:GIT_INDEX_FILE=<priv> bash <hook> --stamp "<verdict>" $(GIT_INDEX_FILE=<priv> git diff --cached --name-only); step 6's prefix lets the gate read the same index. Done when the$(…)is the lane's readback command verbatim and the stamp exits 0, or exits 3 (nothing stamped) on a set with no harness path; any other exit → stop and surface. - Commit with HEREDOC formatting; after,
git show --name-only --format= HEADequals the session list — prior dirty state is sacred, so a clean tree is not the check. Pre-commit hooks run; on failure fix the cause, never bypass. Always a new commit — amend only if asked.
- File grain —
Report, then return — report each commit in one line: short sha + subject, plus any integrity break the user acknowledged. Then return to the work in progress, or to the calling skill's next step — a commit closes a unit, not the session's work. Skipped when invoked by
/super-bootstrap:session-close— its Output is the terminal output.
Rules
- Gateway-inline mechanics; two dispatches, each on its own gate. The gateway holds the diff, session list, intent, and session reads → mechanics and a doc-sync judgment at or under the scope ceiling stay inline (the judgment's inputs are exactly what the gateway holds). The cold doc-sync scan dispatches above the scope ceiling; the premise-closure judge dispatches on a product-anchor hit.
- Grep-gate is mechanical. Term extraction is fixed-shape — at most one term per path, plus the symbol-shaped tokens on a demoted term's changed lines — never a judgment about which identifiers matter — a judgment gate gets omitted. The terminology lane reads only the entries
docs/terminology.mddeclares — it never tokenizes prose for terms; finding a term the file lacks is the §4 judgment's register step, never a gate lane. Any lane hit triggers the doc-sync judgment (§4); conservative by design. A diff that touches no doc-surface file and hits no lane — a pure asset/binary diff with no narrated path — is the skippable class. - Session-isolated. The session list decides; prior dirty state is sacred. Explicit paths, never
-A, never a session path staged in the shared index (intent-to-add excepted) — file grain commits by pathspec (-o), hunk grain through a private index built from HEAD — and what commits is read back against that list before every commit, so another writer's staged or stale entries neither ride in nor get reverted. - Doc-sync round-trip, never bypass — a
stale-docsreturn goes through the user before commit. - Whole-diff-once. Doc-sync runs at the integration boundary, on the whole diff, once. An autorun worktree defers it to merge; a session close runs it as
close-detect, over the session's changes plus the drafts it will land; an implementer never owns doc-sync — a partial-slice view gives false confidence. - The door commits locally and never pushes — no push step, no push question; a push is
/super-bootstrap:session-close's move, by repo shape. Committed work is safe locally.