Repository navigation
Description
For Scott
What: a short program of python-sdlc changes so an agent (or a person) finds problems at commit time and in one push, instead of across several 6–8 minute push rejections.
Why it matters: trentina #706 took five pushes, four rejected, about 28 minutes of gate time. Two were a tooling bug (#16), one was deterministic findings that a 3-second check at commit would have caught, and every retry re-reviewed the whole diff with fresh samples.
Recommendation: three releases (0.3.8, 0.4.0, 0.5.0) plus two small Gatehouse changes, below. Size M overall.
Needs from you: nothing. One constitution clause changes (Gourmand joins the commit tier); that supersedes the commit-tier-is-ruff-only decision.
Where it fits
Program: python-sdlc gate ergonomics. Evidence: crunchtools/trentina#706. Includes #16. Excludes #14 (Scott: not now). We expect to keep adding to this as we learn.
Reviewed by the cto agent against the source on 2026-11-04; file:line references below are from that review at 9d5efc7.
For the agent
0.3.8 (patch, alone)
- A test run on the laptop makes the push tier fail tests that read their own file path #16, at both call sites. See the comment on A test run on the laptop makes the push tier fail tests that read their own file path #16.
0.4.0
- Gourmand becomes a commit-tier default. Full mode, measured at 2.7 s warm on trentina (diff mode 0.4 s, but full sees cross-file duplicates). Keep it in push too.
resolve()(sdlc:228-242) already allows it; Gourmand isimage-rwviaWRITES_TREE, and commit is one lane. Constitution XII's commit sentence gains one clause. - Semgrep stays consumer config, not a default. It takes 27 s, and
t_semgrepexits 2 on a repo with no.semgrep(sdlc:850-851), which would break the commit hook fleet-wide. trentina's bump PR adds[tool.sdlc.commit] checks = ["semgrep"]. --pass-through for single-check runs. Todaybin/sdlc:629runsrun_plan "$1"and drops every later argument, sosdlc pytest tests/x.pysilently runs the whole suite. Arguments after--are joined with the unit separator intoSDLC_ARGSand passed with-e, likeSDLC_SKIP.t_pytestappends them after the configargs, so-n0overrides-n $SDLC_JOBS. Single-check runs only: refuse on commit/push/ci, and refuse extra arguments without--(exit 2) rather than ignore them. pytest first; mypy, semgrep and ruff later on the same variable.- A verdict summary with durations:
<git-dir>/sdlc/last-<command>.jsonlisting check, exit, seconds and log path. Keep the per-check logs (todayrm -rf "$OUT",bin/sdlc:584). The serial path everypushtakes (bin/sdlc:347-376) prints no durations at all, so nothing below can be tuned until this lands. Not.sdlc/, which is committed. No per-tool file:line parsing; the logs carry it. - Gatehouse's machine-readable findings: pass
--consensus-json <git-dir>/sdlc/gatehouse.json. Gatehouse already prints ready-to-pastegatehouse-findings.tomlentries (ledger.py:206 render_entry). - An agent recipe in
--help(bin/sdlc:608-625) and the README;tiersstays the config printer:- run
sdlc commit, thensdlc push, before the first push; - reproduce a push-tier-only failure with
sdlc pytest -- <nodeid>; - the gate's Python is the image's 3.14, not the host's.
- Also state plainly that CI triage, not the local record below, is the authority on review.
- run
0.5.0 (after Gatehouse carry-forward, below)
- Incremental local review, mirroring Gatehouse CI. CI already reviews incrementally on synchronize (
gatehouse/src/gatehouse/review.py:1070-1100).- After a review that rendered a verdict (exit 0 or 1, never 2),
t_gatehouserecords<git-dir>/sdlc/gatehouse-reviewed(HEAD, base sha, image tag). - The next push reviews
git diff <reviewed> HEAD, restricted to the files inorigin/main...HEAD. - It reviews in full when there is no record, when the reviewed sha is not an ancestor of HEAD (rebase, amend), when the image tag changed, or when
SDLC_GATEHOUSE_FULL=1. - No "answered" ledger in python-sdlc: the answers are the code itself and
gatehouse-findings.toml.
- After a review that rendered a verdict (exit 0 or 1, never 2),
- Possibly a
locallane for Gatehouse (network-bound, no CPU) so it overlaps pytest and CodeQL, if 0.4.0's durations justify it.
Gatehouse (crunchtools/gatehouse, in parallel; dependencies of this program)
- Patch: the CI review comment states the accepted triage reply forms (
not a bug:,deferred:, or a fix commit).triage.yml:17-23has them;format_review_body(github.py:300-336) names none. One #706 triage round was lost guessing them. - Minor, carry-forward of prior findings: accept its own
--consensus-jsonoutput as prior findings and re-check each evidence quote against the tree (entry_lineexists for this), re-raising any finding that is neither fixed nor ledgered without a model call. 0.5.0 depends on it.
Rejected, with reasons
- Caching verdicts on the tree: a retry's tree almost always changed, and per-check input keys (conftest, fixtures,
uv.lock, env) hide real failures when wrong. mypy's and CodeQL's own caches are the correctness-preserving ones and already exist. - Semgrep as a commit default: see above.
- Gourmand
--diff-sourceat commit: full mode is 2.7 s and catches more. - Push lanes now: no durations yet to justify them.
SDLC_GATEHOUSE_SAMPLES=1as a shortcut: fewer samples makes verdicts noisier, not findings fewer.
Known trade-off
Incremental review gives up the second look at unchanged code. On #706 that second look found two real crashes. CI's full review on PR open, plus triage, still finds them before merge: push predicts CI, it does not replace it. The local record could be forged by an agent wanting to skip review, but that's no new hole, since SDLC_SKIP=gatehouse and --no-verify already exist and CI triage remains the authority.
Done when: 0.3.8, 0.4.0 and 0.5.0 are released and pinned in trentina; a host test run no longer changes a push-tier verdict; sdlc pytest -- <nodeid> runs one test; a Gourmand finding fails git commit; a retry after a rejected push reviews only the new commits locally; last-push.json reports per-check seconds.
Out of scope: #14.
Activity
fatherlinux commentedon Nov 5, 2026
What ships, and what does not
Reviewed against the source with the
ctoagent on 2026-11-04. Four things in this issue changed, and the reasons are below. The work is one pull request, released as 0.4.0, and #14 is in it after all.In 0.4.0
run_in_imageand thepytest-in-imageargv. This issue named only the first. Reproduced and fixed end to end on trentina's owntest_library_lines_are_fingerprinted: with host-compiled bytecode in the tree the gate fails it and prints the laptop's path in the traceback; withPYTHONPYCACHEPREFIXset and nothing else changed, the same poisoned tree passes.--pass-through, as proposed, with the refusals.<git-dir>/sdlc/last-<command>.jsonplus kept per-check logs.run_serialgained the footer it never had, which is the gap this issue noted and then did not fix.bin/sdlccomputes on the host and never the worktree, so the single-lane-when-rewriting rule does not apply to it, and it needs no measurement. 35s on a 365-line diff, previously spent with the CPUs idle. A lane whose every step islocalis left out of the CPU division, so the main lane keeps the whole budget — without that it would have been the 0.3.2 regression again. And the lane that runs containers keeps the terminal: buffering it would mean watching nothing for the length of the test suite.--helpand the README.Also in 0.4.0, not in this issue
--cap-drop=all --security-opt=no-new-privilegeson the gate's own containers.pytest-in-imagehas been locked down since it was written; the containers that run far more repo-supplied code had none of it.:<sha>is pushed beforeverify-digest, so a main run whose contract test failed leaves a pushed-but-untested digest that the tag run would have promoted. The tag path re-verifies.z, notZ, in this repo's own hooks, which had taken the worktree out from under the shellcheck step — the bugbin/sdlchas documented since it was written, in this repo's own config. And the local Gatehouse hook pinned 0.22.0 while the image bakes 0.23.0.Not in 0.4.0
crunchtools/gatehouse; and with the review now running beside the rest, it only saves wall time if the review is the longest lane, which nobody has measured. The durations shipped here are how that gets decided. Reopen whenlast-push.jsonacross several repos shows the review lane longer than the main lane. This lands as 0.6.0 if it lands — 0.5.0 is taken by feat!: ci may not skip a push verdict #19.--consensus-jsonis out. Gatehouse v0.23.0 has the flag, but the reviewer's container mounts the worktree read-only, so collecting the file would mean a new writable bind mount inside the git directory. That is a real cost against a convenience the terminal output already gives, and its only other purpose was feeding the incremental review above.Filed, not fixed
One constitution change
crunchtools/constitution#87 adds Gourmand to XII's commit sentence. Prose only; the machine check inspects which hooks a repo declares, not which checks a tier runs, so nothing has to be re-inherited and 0.4.0 does not wait on it. It supersedes the commit-tier-is-ruff-only decision.
fatherlinux commentedon Nov 5, 2026
Closing as done against the re-cut scope above. Shipped: #16 (both containers), Gourmand at commit,
--pass-through,last-<command>.jsonwith per-check seconds, the Gatehouse lane on push, the agent recipe, #14; v0.4.0 and v0.5.0 are released and trentina pins v0.5.0 (ce6a427). 0.3.8 folded into 0.4.0. constitution#87 merged.Not shipped, by decision: incremental local review and
--consensus-json. The reopen condition was the review lane outrunning the main lane. trentina's firstlast-push.jsonshows gatehouse at 11 s against pytest 102 s + codeql 95 s, so it doesn't meet that condition.