pre-push has no TypeScript lint gate — TS lint breaks land on main, caught only post-push by ci (found via #1251) #1252
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1252
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
.sandcastle/git-hooks/pre-pushgates factory drift (#932) and Go (#198) but has no TypeScript lint gate. A TS lint break therefore lands onmainand is only caught post-push byci. That is howb5cb2c30shippedmainred onprefer-const(see #1251) and why three further commits (3e8cb171,25d102a8,5855aecf) rode on top of it, each reding the same way.Proposed fix
Add a pre-push gate that runs
pnpm run lint(oreslintscoped to changed.ts/.tsxfiles) when the push touches TypeScript, mirroring how the Go gate scopes to Go changes. Fails the push locally instead of letting a lint break reachmain.Provenance
Found while fixing #1251 (prefer-const red on the #1244 lazy
dashgetter)..sandcastle/git-hooks/pre-pushis a protected path (#445), so per CLAUDE.md the machinery change is filed here rather than edited under the product ticket. Labelledready-for-session(ADR 0174 — a protected.sandcastle/path needs an interactive session's standing).Closed — TypeScript lint gate added to pre-push, run in every workdir. Ruled by agent under ADR 0174 — veto anytime.
Why a two-way door (ADR 0174). Revertible: the fix is a
Matou/dev-factorycommit plus an idssFACTORY_REFbump, both revert with one commit. Provable: offlinegate-lib-test.sh(the sameGATE_*_CMDstub seam the Go gate uses), green red-first. Not on the one-way list: a gate tightening (blocks TS lint breaks), the opposite of a security-posture widening; no credentials, trust surface, data destruction or spend. The ticket was mintedready-for-sessionfor exactly this protected.sandcastle/path (#445).What landed.
.sandcastle/git-hooks/pre-push,gate.sh,gate-lib.share factory-vendored (ADR 0180), so the change landed upstream and was re-vendored:Matou/dev-factory: commit906c770—gate: add a TypeScript lint gate to pre-push, run in every workdir (origin idss #1252).515034df—FACTORY_REF 529cb1f1→906c770d(4 files updated:gate-lib.sh,gate.sh,git-hooks/pre-push,tests/gate-lib-test.sh;FACTORY_MANIFESTmembership unchanged).The fix.
gate-lib.sh:gate_ts_default_cmd(nix develop .#default->pnpm run lint, ADR 0040 pinned toolchain) +gate_ts_stage, with the same first-match-wins precedence, fail-closed and git-env-scrub asgate_go_stage:GATE_TS_CMD-> executable per-repo.sandcastle/ts-gate.sh(drift-safe, not vendored) -> nix default.gate_rungrows an optional<only>language filter and now runs the TS stage on a TS change (was a no-op skip).gate.sh: new--prepush-tsmode.git-hooks/pre-push: the TS lint gate runs in every workdir (mirroring the drift gate), because a TS lint break reachesmainthrough the host reconcile push, not only the sandbox — the sandbox's in-looppnpm lintdid not stopb5cb2c30(prefer-const) or the three commits that rode on it (#1251). Go stays sandbox-only (#198: a host push runs the full seam vianix developand reconcile must not stall on a Go build; the sandbox has gated Go reliably). Cheap by construction: eslint runs only when the pushed range touches TypeScript.Proof.
tests/gate-lib-test.sh: +12 checks (26 total) — TS-only now runs the TS stage, a red TS lint refuses the push, mixed runs both, theonlyfilter, thets-gate.shoverride/precedence/git-env-scrub, and fail-closed. Verified red against the pre-fixgate-lib.sh(FAIL: a TS-only change MUST run the TS lint stage (#1252)), green after.gate-lib(26),prepush-drift-gate,git-setup,protected-paths-lib(27),check-harness-drift(12),onboard-lib(235),vendor-manifest-coverage;bash -nclean.gate-lib-testgreen (26);check-harness-drift: OKat pin906c770d; the idssmainpush exercised the new hook live (gate: no gated language touched — nothing to check— the TS gate ran on the real host push and skipped, drift gate passed).Follow-up (not built, out of scope for #1252): the seam also gates prettier
format:check; a format-drift red is a separate class this lint gate does not cover — file separately if aformat:checkpre-push gate is wanted.stack-config+community-dataendpoints, andstackExportwired in production #1429reset --hard origin/mainmid-run is attributed to the worker and DELETES main-owned machinery (run 57327 lost #2099) #2104