Skip to content

fix: address the issues from the 0.1.0 end-to-end test - #20

Merged
ngoyal16 merged 1 commit into
mainfrom
fix/e2e-test-issues
Dec 1, 2026
Merged

ngoyal16 merged 1 commit into
mainfrom
fix/e2e-test-issues

Conversation

@ngoyal16

Copy link
Copy Markdown
Contributor

Fixes all ten issues from the 0.1.0 end-to-end test (#10–#19) in one PR.

Issue Fix
#10 Fix loop has no per-round budget Each fix round gets --max-fix-steps model calls (default 15). After that, zenith checks again and counts the attempt, so --max-fix-attempts is reached and the run ends failed / exit 30.
#11 Budget-exceeded runs commit unverified work A run that stops early (budget, timeout, model failure, agent gave up) still gets its checks run on the work it left. It gets a generated summary ("Stopped before finishing: …, files changed so far: …"), and the commit message says UNVERIFIED.
#12 A failing --verify is ignored as pre-existing --verify checks are required: they never count as pre-existing. A check that can't run (exit 126/127) is unavailable: it never triggers a fix round, and a required one fails the run at once. The new verified field in the result is true only when every check ran and passed. Progress prints done (not verified …), publish opens unverified runs as drafts, and the PR says "Not verified".
#13 Model commands can read zenith's environment zenith calls prctl(PR_SET_DUMPABLE, 0) on Linux, so /proc/<pid>/environ becomes root-only. Checked in the built image: zenith's /proc/1/environ is -r-------- root, so the same uid can't read it, while a control container without this leaks the variable.
#14 Changes no check covers The agent's system prompt lists the toolchains found and missing. A command that exits 127 gets a hint. Changed files in a language with no toolchain are listed in uncovered_files, with a warning and a note in the PR.
#15 pytest runs python, the image has python3 Detection uses python3 when it exists. The image adds python-is-python3, and its build now fails if any command check detection can pick is missing.
#16 Artefacts committed, no secret scan __pycache__, *.pyc, .pytest_cache, node_modules and similar are left out of the commit, and PYTHONDONTWRITEBYTECODE=1 is set. Added lines are scanned for credentials (code-review-bot's rules plus secret assignments) and listed in secret_findings, and publish refuses them without --allow-secrets. Files changed by commands rather than file tools are listed in files_by_commands.
#17 Secrets recorded verbatim in results and events Events, the result (commands, summary, plan, check output) and so the PR body are redacted. A value seen once (for example a token in a read_file output) is also redacted later in the sed that moves it. Options: --no-redact, and --events-level summary to drop tool and check output. SECURITY.md now says output files may still contain secrets.
#18 No prompt caching on Bedrock Qwen on Bedrock rejects cache points (zenith already drops them when refused). When several large calls report no cached tokens, zenith now trims old tool outputs on every call, summarises at 50% of the window instead of 75%, and warns once.
#19 Rough edges (1) File paths in the summary that aren't in the change or the repository are flagged. (2) The difference between steps and usage.model_calls is documented in the protocol and README. (3) Usage errors still write --result, with status: usage_error (exit 2). (4) Without --worktree, the checkout is switched back to its branch after the run, and a branch or worktree with no commit is deleted. (5) The planner is told which toolchains exist. Every warning event is also copied into the result's warnings.

Contract changes

New result fields (all optional): verified, warnings, uncovered_files, files_by_commands, secret_findings, limits.max_fix_steps. Checks have new required and unavailable fields, and there's a new status usage_error. Behaviour changes:

  • after a non-worktree run, the user's checkout is back on its branch;
  • --verify failures now fail the run;
  • events and results are redacted by default.

Tested

  • New tests for each issue: internal/harness/issues_test.go, plus tests in verify, secrets, toolchain, policy (a /proc read from a child process), publish and the CLI. Existing tests now read the branch instead of HEAD.
  • go test -race ./... and golangci-lint (0 issues) pass. It also cross-builds for darwin and windows.
  • The image builds with the new toolchain checks. python -m pytest works, and the /proc/1/environ check above was run against it.
  • No live model run yet: the test account's AWS login has expired.

🤖 Generated with Claude Code

Verification
- --verify checks are required and never count as pre-existing; a check
  that can't run (exit 126/127) is "unavailable", never a fix round, and
  fails the run when required. Result.verified says whether every check
  ran and passed (#12).
- Each fix round gets --max-fix-steps model calls (default 15); then zenith
  checks again and counts the attempt, so exit 30 is reachable (#10).
- Runs that stop early are checked anyway, get a generated summary, and
  their commit says UNVERIFIED (#11).
- pytest runs as python3 when available; the image adds `python` and fails
  to build if a detectable check command is missing (#15).

Safety
- zenith marks itself non-dumpable on Linux, so commands can't read its
  environment from /proc/<pid>/environ (#13).
- Commits leave out common artefacts, PYTHONDONTWRITEBYTECODE is set, and
  added lines are scanned for credentials; publish refuses findings
  without --allow-secrets (#16).
- Events, results and PR text redact known secret formats and secret
  assignments, including later uses of a value already seen; --no-redact
  and --events-level summary (#17).

Coverage and cost
- The agent is told which language toolchains exist, exit 127 gets a hint,
  and changed files no toolchain covers are listed in uncovered_files (#14).
- When the provider reports no prompt caching, old tool output is trimmed
  on every call and summaries start at half the window (#18).

Rough edges (#19)
- Summary paths that don't exist are flagged; warnings are copied into
  the result; usage errors still write a result (status usage_error); the
  checkout is switched back after a run and an empty branch is deleted;
  steps vs usage.model_calls is documented.

Closes #10, closes #11, closes #12, closes #13, closes #14, closes #15,
closes #16, closes #17, closes #18, closes #19.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ngoyal16
ngoyal16 merged commit 35d08ed into main Dec 1, 2026
13 checks passed
@ngoyal16
ngoyal16 deleted the fix/e2e-test-issues branch December 1, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant