gate-lib: forward-port the docs-diagram pre-push tier onto main (idss #2068) #317

Open
matou-build-agent wants to merge 1 commit from forward-port/idss-2068 into main

Forward-ports idss #2068's docs-diagram pre-push gate tier from the cheap-backport branch backport/idss-2068 (f36604c) onto dev-factory main, so #1684's eventual main-HEAD adoption carries it back to every consumer.

What it does

idss #2068 added a docs tier to the vendored pre-push gate:

  • gate_langs_for_files emits a docs token for the three diagram-source trees — docs/architecture/*, docs/slices/*, docs/ux/flows/* — whose mermaid/slice-map contracts the seam enforces (#343, #834) but which carry no go/ts token, so a docs-only change was invisible to the push gate and its break was CI-only (idss GOTCHAS #143, a bare %% that red CI a second time).
  • gate_docs_stage runs the cheap in-repo mermaid/slice-map checkers on every push path, with the same first-match-wins precedence as the Go/TS tiers: GATE_DOCS_CMD override → an executable per-repo .sandcastle/docs-gate.sh → a node running the consumer's check-mermaid.mjs + check-slices-yaml.mjs. It fails closed when none resolve.
  • A checker crash (the GOTCHAS #400 shape — a sandbox with no pnpm install has no happy-dom) is named as a harness fault, never reported as a parse failure and never silently skipped.
  • gate_run grows a docs branch that runs regardless of go_tier (the docs tier is cheap on every path).

Conflict resolution

The backport sat on the old pin 06f65763, atop the #445 boundary that main later reverted (base 6142899). The cherry-pick touches only gate-lib.sh and tests/gate-lib-test.sh and merged clean against main's own gate-lib evolution — #314 fail-closed arms (7e9521c), #253 merge-base scoping (ce26ea7), #1913 gofmt-scan (b5a8c78). The docs tier coexists with go_tier/gofmt.

One semantic conflict needed resolving beyond the clean text-merge: main's newer #47 lint (tests/judgement-call-prompts-test.sh) bars a literal docs/ path in a vendored harness script's live text (a doc pointer 404s in a consumer that lacks it), and the docs tier's change-classification globs in gate_langs_for_files tripped that blanket grep. Resolved by sourcing the docs root from a $_docroot variable — behaviour identical, the globs still match the consumer's own diagram-source trees and send a reader nowhere — with a comment drawing the lint's own pointer-vs-glob distinction.

Proof

Red-before-green re-proven on the merged result: the new docs-tier checks fail against main's pre-port gate-lib.sh (gate_langs_for_files emits no docs) and pass after. bash tests/gate-lib-test.sh → 57/57, tests/judgement-call-prompts-test.sh → 33/33, and the full dev-factory offline battery → 100/100 green (docs-budget-test.sh included — the STATUS.md surface update stays under the per-line budget).

Context

This is the #2049 / #2053 forward-port debt class (dev-factory is LANDING=pr, so the port is a reviewed PR, not a headless push). It also restores a tier idss has silently lost: idss's current pin e77a951 carries no docs tier, because the #2104/#2106/#2110 re-vendor stacked off 06f65763 on a sibling branch that never held f36604c — #1684's main-HEAD adoption is the route back.

Screenshots: none — the change is shell harness machinery (a pre-push gate tier) with no visible UI surface; the evidence is the red-before-green tests/gate-lib-test.sh run above.

Worked under idss ticket #2108 (ADR 0174 two-way-door ruling).

Forward-ports idss #2068's **docs-diagram pre-push gate tier** from the cheap-backport branch `backport/idss-2068` (`f36604c`) onto dev-factory `main`, so #1684's eventual main-HEAD adoption carries it back to every consumer. ## What it does idss #2068 added a `docs` tier to the vendored pre-push gate: - `gate_langs_for_files` emits a `docs` token for the three diagram-source trees — `docs/architecture/*`, `docs/slices/*`, `docs/ux/flows/*` — whose mermaid/slice-map contracts the seam enforces (#343, #834) but which carry **no** `go`/`ts` token, so a docs-only change was invisible to the push gate and its break was CI-only (idss GOTCHAS #143, a bare `%%` that red CI a second time). - `gate_docs_stage` runs the cheap in-repo mermaid/slice-map checkers on **every** push path, with the same first-match-wins precedence as the Go/TS tiers: `GATE_DOCS_CMD` override → an executable per-repo `.sandcastle/docs-gate.sh` → a `node` running the consumer's `check-mermaid.mjs` + `check-slices-yaml.mjs`. It **fails closed** when none resolve. - A checker **crash** (the GOTCHAS #400 shape — a sandbox with no `pnpm install` has no `happy-dom`) is named as a harness fault, never reported as a parse failure and never silently skipped. - `gate_run` grows a `docs` branch that runs regardless of `go_tier` (the docs tier is cheap on every path). ## Conflict resolution The backport sat on the old pin `06f65763`, atop the #445 boundary that `main` later reverted (base `6142899`). The cherry-pick touches only `gate-lib.sh` and `tests/gate-lib-test.sh` and merged **clean** against `main`'s own gate-lib evolution — #314 fail-closed arms (`7e9521c`), #253 merge-base scoping (`ce26ea7`), #1913 gofmt-scan (`b5a8c78`). The docs tier coexists with `go_tier`/gofmt. **One semantic conflict** needed resolving beyond the clean text-merge: `main`'s newer #47 lint (`tests/judgement-call-prompts-test.sh`) bars a literal `docs/` path in a vendored harness script's live text (a doc *pointer* 404s in a consumer that lacks it), and the docs tier's change-*classification* globs in `gate_langs_for_files` tripped that blanket grep. Resolved by sourcing the `docs` root from a `$_docroot` variable — behaviour identical, the globs still match the consumer's own diagram-source trees and send a reader nowhere — with a comment drawing the lint's own pointer-vs-glob distinction. ## Proof Red-before-green re-proven on the merged result: the new docs-tier checks **fail** against `main`'s pre-port `gate-lib.sh` (`gate_langs_for_files` emits no `docs`) and **pass** after. `bash tests/gate-lib-test.sh` → **57/57**, `tests/judgement-call-prompts-test.sh` → **33/33**, and the full dev-factory offline battery → **100/100 green** (`docs-budget-test.sh` included — the STATUS.md surface update stays under the per-line budget). ## Context This is the #2049 / #2053 forward-port debt class (dev-factory is `LANDING=pr`, so the port is a reviewed PR, not a headless push). It also restores a tier idss has silently lost: idss's current pin `e77a951` carries **no** docs tier, because the #2104/#2106/#2110 re-vendor stacked off `06f65763` on a sibling branch that never held `f36604c` — #1684's main-HEAD adoption is the route back. **Screenshots:** none — the change is shell harness machinery (a pre-push gate tier) with no visible UI surface; the evidence is the red-before-green `tests/gate-lib-test.sh` run above. Worked under idss ticket #2108 (ADR 0174 two-way-door ruling).
gate-lib: forward-port the docs-diagram pre-push tier onto main (idss #2068)
Some checks failed
ci / static (pull_request) Successful in 3m0s
ci / test (pull_request) Failing after 12m38s
4d0543b4e1
Cherry-pick of f36604c from the cheap-backport branch backport/idss-2068
onto main. idss #2068 added a `docs` tier to the vendored pre-push gate:
gate_langs_for_files emits a `docs` token for the three diagram-source trees
(docs/architecture/*, docs/slices/*, docs/ux/flows/*) whose mermaid/slice-map
contracts the seam enforces (#343, #834) but which carry no go/ts token, so a
docs-only change was invisible to the push gate and its break was CI-only
(idss GOTCHAS #143). gate_docs_stage runs the cheap in-repo mermaid/slice-map
checkers on every push path with the same first-match-wins precedence as the
Go/TS tiers (GATE_DOCS_CMD override -> executable .sandcastle/docs-gate.sh ->
a node running the consumer's check-mermaid.mjs + check-slices-yaml.mjs),
fails closed when none resolve, and names a checker CRASH (the GOTCHAS #400
shape: no happy-dom) as a harness fault rather than a parse failure or a
silent skip.

The backport sat on the old pin 06f65763, atop the #445 boundary that main
later reverted (6142899); the cherry-pick touches only gate-lib.sh and
tests/gate-lib-test.sh and merged clean against main's own gate-lib evolution
(#314 7e9521c, #253 ce26ea7, #1913 b5a8c78) -- the docs tier coexists with
go_tier/gofmt. Red-before-green re-proven on the merged result: the new
docs-tier checks fail against main's pre-port gate-lib.sh and pass after;
tests/gate-lib-test.sh 57/57 green.

This is the #2049 / #2053 forward-port debt class, so #1684's eventual
main-HEAD adoption carries the docs tier back to every consumer -- notably
idss, whose current pin e77a951 lost it when the #2104/#2106/#2110 re-vendor
stacked off 06f65763 on a sibling branch that never held f36604c.

Journal docs/journal/2026-10-30-idss-2068-forward-port.md; STATUS idss row.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
matou-build-agent force-pushed forward-port/idss-2068 from 4d0543b4e1
Some checks failed
ci / static (pull_request) Successful in 3m0s
ci / test (pull_request) Failing after 12m38s
to 46b1b0377f
All checks were successful
ci / test (pull_request) Successful in 7m24s
ci / static (pull_request) Successful in 3m27s
2026-10-30 12:57:27 +00:00
Compare
All checks were successful
ci / test (pull_request) Successful in 7m24s
ci / static (pull_request) Successful in 3m27s
This pull request has changes conflicting with the target branch.
  • STATUS.md
  • gate-lib.sh
  • tests/gate-lib-test.sh
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin forward-port/idss-2068:forward-port/idss-2068
git switch forward-port/idss-2068

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff forward-port/idss-2068
git switch forward-port/idss-2068
git rebase main
git switch main
git merge --ff-only forward-port/idss-2068
git switch forward-port/idss-2068
git rebase main
git switch main
git merge --no-ff forward-port/idss-2068
git switch main
git merge --squash forward-port/idss-2068
git switch main
git merge --ff-only forward-port/idss-2068
git switch main
git merge forward-port/idss-2068
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory!317
No description provided.