Skip to content

claudex harness: HARDEN tag for security-sensitive features - #54

Merged
yogex merged 5 commits into
masterfrom
claudex-harden-tag
Dec 2, 2026
Merged

yogex merged 5 commits into
masterfrom
claudex-harden-tag

Conversation

@yogex

@yogex yogex commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Adds a HARDEN tag to the claudex harness, so security-sensitive features get extra checks that the agents can't skip. This is change 9 from the post-run review of the claudex simulation. Updated after review (d5e0130, fd88b28) and after live verification (1995699).

What changes

Area Before After
Turning it on — HARDEN at the end of the brief's first line, a whole-word harden.keywords match, or "harden": true already in state/<F>.json. HTML comments and the first paragraph and list items of "Out of scope" aren't matched. HARDEN with TIER normal is refused
Keeping it on — brief.sh records it in state/<F>.json, so design, build, ship and CI-fix all keep it. checkpoint.sh now updates that file in place instead of rewriting it
Plan No security section One Hardening task per checklist item (H1 to H10), each with a test, or n/a with a reason
Build, fix, address, CI-fix Generic test rules Told the hardening tests and test config are final once committed, and to say why if they change one
Review Reviewer rules on test edits Also checks every checklist item; an unfinished item is an important finding
Test edits Pattern on test paths only Also test_config[] (Playwright and Vitest configs, package.json). With HARDEN, the edited files are listed in the PR body; a missing list fails the verdict
Merge Merge gate is an approval the orchestrator answers With HARDEN, merge-gate is skipped and checkpoint-harden records pr-open, so the engine never merges it. PR labelled harden. forge.sh merge refuses harden PRs, and any merge when it can't read labels
Test edits on the PR — Listed since the post-build commit (recorded by the build checkpoint), so CI-fix edits show on a re-ship. The PR names the reviewed and pushed heads
HARDEN review not approved Run cancelled, no PR Draft PR with the findings and rejected test edits in the body. A re-ship updates the same PR
Failures State writes and git comparisons could fail silently checkpoint.sh, brief.sh and review-pack.sh exit 1, so the node fails before a review or handoff

Why: F4's open security items (timing on whitespace-only passwords, password change without the current password, CSRF) are all on the checklist, and its two post-build test edits were accepted by review alone.

Checks run

  • harness/scripts/selftest.sh: 43 passed, in CI. The 14 added for 1995699 all fail on cadc61e. Covers parsing, keywords (whole words, plurals, comments, out-of-scope rules), tier refusal, state carry-over, checkpoint keeping the flag, test-config edits listed by review-pack.sh, and forge label and merge refusal with a fake gh (including a failing gh pr view).
  • The run's real briefs with the project config: F4 gets HARDEN, F1 to F3 don't. The issue template with TIER normal doesn't.
  • Rendered workflows: all 10 parse. The verdict node was run on sample outcomes (HARDEN with edits → pass with edits listed; HARDEN with no list → fail). The checkpoint node gives pr-open for HARDEN whatever the decision. The PR node with a stub forge gives the label and lists the edits only with HARDEN.
  • product-grep.sh: no product names in harness/.

Live Archon runs on a disposable local repo (fixture config, no GitHub access): build → CI-fix that edits package.json → re-ship listed the edit against the post-build commit, named the reviewed head, skipped merge-gate, recorded pr-open and completed. A weakened test was rejected by the reviewer and restored by the address round. A missing base ref stopped the run before review; a blocked state write failed push with nothing pushed. A normal-tier ship still merged through the gate. The draft PR path was run at node level with a scripted rejection, not by a live reviewer.

Not covered

  • The real merge block is branch protection on the base branch that requires the owner's review (post-run review change 7).
  • If the base branch is merged into the feature branch after the build, test files changed by that merge are listed too.
  • Features built before this change have no postbuild, so a HARDEN ship of one refuses to start until it is rebuilt.
  • master has no branch protection today (checked read-only), and the automation identity is the owner's account, so the GitHub-side block is untested.
  • Protected paths for all features (change 6).
  • Overlap: branch ccr-99148463-yu76k7 edits ship.yaml, design.yaml, CONTRACTS.md, VERSION and the configs too. Whichever merges second needs conflicts resolved.

https://claude.ai/code/session_016efoiqPbKEzohdVDPcFcE4


Generated by Claude Code

A brief marked HARDEN (or matching harden keywords outside its
"Out of scope" section) now changes what the engine enforces, not only
what it tells the agents:

- brief.sh: parses an optional HARDEN on the first line; turns it on
  from whole-word harden.keywords; refuses HARDEN with TIER normal.
- hardening/CHECKLIST.md: H1 to H10 (access per data type and caller,
  server-set ownership, sign-in timing and current-password checks,
  cookies, CSRF, input validation, rate limits, errors and logs,
  secrets, other routes to the same data).
- Plan, build, fix, address and CI-fix prompts carry the checklist;
  the reviewer treats an unfinished item as an important finding.
- Ship verdict fails on any test file edited after the build when
  HARDEN is on, whatever the reviewer ruled.
- PRs get the harden label; forge.sh merge refuses harden PRs; the
  merge gate always rejects them, delegation or not.
- scripts/selftest.sh (14 checks, fake gh) runs in CI.
- Harness 0.2.0.

Known gap: test edits from claudex-cifix before a re-ship are not
caught. The hard merge block still needs branch protection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoiqPbKEzohdVDPcFcE4

@yogex yogex left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial review of d1691b7. The main issue: the owner-only merge isn't enforced on the path the workflow uses (inline on ship.yaml:255). Two other inline findings can block a normal feature by mistake (the issue template) or let a weakened test through (test config files).

What holds: HARDEN on a normal-tier brief is refused, keywords match as whole words, the test-edit verdict is enforced in code, and the "Not covered" section is accurate. I re-ran selftest.sh (14 of 14 pass), and CI is green on this head.

How I tested: I fed crafted briefs to brief.sh with project/claudex.json, and read ship.yaml's node graph and review-pack.sh. I didn't run a live Archon workflow.

Overlap: branch ccr-99148463-yu76k7 (a27388f: working install.sh, spec folder recorded in state, address_rounds removed) also edits ship.yaml (the PR-body spec line), design.yaml (the brief node), CONTRACTS.md, VERSION and the three configs. Whichever merges second will need conflicts resolved.


Generated by Claude Code

If `gh pr view` errored, the label check found nothing and the merge
went ahead. Read the labels first and refuse (exit 4) on error.
Self-test adds the case (15 checks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoiqPbKEzohdVDPcFcE4
- Owner-only merge enforced on the path the workflow uses: merge-gate
  is skipped when HARDEN is on, and the checkpoint records pr-open.
- HARDEN with test edits no longer cancels the run: the edited files
  are listed in the PR body. A missing edits list fails the verdict.
- Test config files (config test_config[]) count as test edits.
- HARDEN is recorded in state/<feature>.json and read back, so every
  workflow keeps it; checkpoint.sh now updates the file in place.
- Keyword matching skips HTML comments and only the first paragraph
  and list items of "Out of scope"; issue template hints moved into
  comments.
- Broader keywords (plurals, auth, share, owner, role, admin, upload,
  account...); "shared" left out because it flags F2 and F3.
- forge.sh no longer overwrites an existing harden label.
- Self-test: 28 checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoiqPbKEzohdVDPcFcE4
Covers sharing features written as "shared with other users" without
the bare word "shared", which would flag F2 and F3 as security work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efois1hjx9JeuGhxWixrm
Live runs at cadc61e showed: CI-fix test edits missing from the PR,
no reviewed head on the PR, no PR when HARDEN review fails, the
checkpoint node failing after the skipped merge gate, and state-write
and git-comparison failures passing silently.

- Build records postbuild in state; ship lists test edits since it
  and refuses HARDEN without it.
- review-pack fails on a missing base ref, unknown fix base, failed
  diff or empty diff, and records the reviewed head.
- Verdict hands off ready, draft or stop. HARDEN without approval
  opens a draft PR with the findings. Push fails if anything but
  state/ changed after review.
- checkpoint-harden records pr-open or pr-draft; the normal
  checkpoint only runs without HARDEN.
- checkpoint.sh and brief.sh exit 1 on unreadable or unwritable state.
- forge pr-create updates an existing PR and supports draft.
- 14 new self-tests (43 total); all 14 fail on cadc61e.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efois1hjx9JeuGhxWixrm
@yogex
yogex merged commit 86acb2b into master Dec 2, 2026
2 checks passed
yogex pushed a commit that referenced this pull request Dec 2, 2026
- Owner-only merge enforced on the path the workflow uses: merge-gate
  is skipped when HARDEN is on, and the checkpoint records pr-open.
- HARDEN with test edits no longer cancels the run: the edited files
  are listed in the PR body. A missing edits list fails the verdict.
- Test config files (config test_config[]) count as test edits.
- HARDEN is recorded in state/<feature>.json and read back, so every
  workflow keeps it; checkpoint.sh now updates the file in place.
- Keyword matching skips HTML comments and only the first paragraph
  and list items of "Out of scope"; issue template hints moved into
  comments.
- Broader keywords (plurals, auth, share, owner, role, admin, upload,
  account...); "shared" left out because it flags F2 and F3.
- forge.sh no longer overwrites an existing harden label.
- Self-test: 28 checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efoiqPbKEzohdVDPcFcE4
yogex pushed a commit that referenced this pull request Dec 2, 2026
Covers sharing features written as "shared with other users" without
the bare word "shared", which would flag F2 and F3 as security work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efois1hjx9JeuGhxWixrm
yogex pushed a commit that referenced this pull request Dec 2, 2026
- Change table gets a State column (2 Dec, master 86acb2b): change 9
  done in #54, 3 half done on an unmerged branch, 8 partly, rest not
  started. Change 9 reworded to what #54 enforces.
- New "Update, 2026-12-02: HARDEN verified": the five gaps the live
  checks found at cadc61e and their fixes, and the earlier
  overstatement of change 9.
- Still open: why Phase 5 was blocked (install.sh) and that the fix is
  unmerged; HARDEN's GitHub-side block untested.
- EVIDENCE C27 (HARDEN verification) and C28 (no branch protection).
- Readout: State column, HARDEN and reuse lines on Path forward.
- Removed shots/ at the repo root: unreferenced render-check images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efois1hjx9JeuGhxWixrm
yogex pushed a commit that referenced this pull request Dec 2, 2026
yogex pushed a commit that referenced this pull request Dec 2, 2026
- Change table gets a State column (2 Dec, master 86acb2b): change 9
  done in #54, 3 half done on an unmerged branch, 8 partly, rest not
  started. Change 9 reworded to what #54 enforces.
- New "Update, 2026-12-02: HARDEN verified": the five gaps the live
  checks found at cadc61e and their fixes, and the earlier
  overstatement of change 9.
- Still open: why Phase 5 was blocked (install.sh) and that the fix is
  unmerged; HARDEN's GitHub-side block untested.
- EVIDENCE C27 (HARDEN verification) and C28 (no branch protection).
- Readout: State column, HARDEN and reuse lines on Path forward.
- Removed shots/ at the repo root: unreferenced render-check images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efois1hjx9JeuGhxWixrm
yogex pushed a commit that referenced this pull request Dec 3, 2026
…s_rounds

From branch ccr-99148463-yu76k7 (a27388f), merged onto master after
PR #54. Version 0.3.0.

- install.sh works in a folder that already has files, writes the
  starter files and a CI workflow, and renders the workflows (it
  linked .archon/workflows to a missing folder before, so nothing
  rendered).
- spec.sh records each feature's spec folder in its state at design
  time; build, ship and the review pack read it instead of taking the
  newest folder.
- address_rounds removed; render.sh refuses a config that sets it.
- Conflicts with #54 resolved keeping #54's behaviour; the PR body's
  spec line uses spec.sh. Self-test gives its feature a spec folder.
  Bare Archon substitutions quoted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016efois1hjx9JeuGhxWixrm
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.

2 participants