Skip to content

Mission layer hardening: the records decide (second review of M9.0/M9.2/M9.3/M9.10) - #78

Merged
adeelahmad merged 3 commits into
masterfrom
claude/mission-layer-plan-6re55w
Oct 20, 2026
Merged

adeelahmad merged 3 commits into
masterfrom
claude/mission-layer-plan-6re55w

Conversation

@adeelahmad

Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Before: after #77, a role that could edit artifact files, but not the ledger, could still weaken the evaluation or crash a gate. A second adversarial review (4 lenses) found 31 unique ways, each with a repro script. Some examples:

  • Hide a confirmed baseline for one command to retire a frozen journey with no human.
  • Hand-write a re-sealed state report and get GOAL MET.
  • Re-list vetoed journeys in another order.
  • Let a re-apply undo a human restore.
  • Let runner.files miss the script the command really runs.
  • Weaken a judge's rubric.
  • Have --replace-by silently record a broader approval.
  • Run in a C locale with a non-ASCII mission, which crashed mission init.

After: the ledger records decide what a file cannot, and each finding is a test.

How:

  • Ledger (_mission.py)
    • Nothing decides from a broken ledger: M.ledger_block at the top of every deciding command, and M.record raises M.LedgerBroken rather than chain a row past a broken one.
    • The lost-row cross-check counts only rows recorded on this branch, so a dropped branch no longer deadlocks main.
    • Junk run-log lines are skipped.
    • state.assessed, ethics.reviewed, ethics.blocked, goal.derived and goal.met are ledger rows.
  • Journeys
    • Frozen, pinned and retired come from the confirmation records (which now carry journeys) and the retirement records, never from files.
    • runner.files must pin every project file the command runs. It refuses links, inline code (-c, -e) and scripts outside the project, and journeys check hashes the pinned files.
    • A judged metric pins query.rubric_sha256, and assess passes it to judge.verdict.
    • <= → < is tighter, not weaker.
    • --k=v works, and an unknown flag exits 64 in every area.
  • Baseline
    • An edited, moved or malformed current version decides nothing.
    • A veto binds content in canonical order and is decided from records, not status.
    • A version once confirmed comes back only by baseline restore.
  • Evaluate
    • Every input is the content its record covers: the state, the baseline, the frozen journeys, and the goal activated by a record, whose targets must be criteria the baseline froze.
    • evaluate check recomputes metrics and refuses a state whose runs disagree.
    • Integers beyond a float's range are refused instead of crashing.
  • Core
    • argv and files are UTF-8 in any locale (M.cli_text).
    • A lone surrogate blocks instead of crashing.
    • ethics gains a draft status.
    • GA4 reserved names are one list, the union of both tracks' lists.

Known gap, recorded in ROADMAP with M9.9 and M9.17: on a checkout without the run log, removing the newest ledger rows is not detected.

Evidence

  • Checks pass: mission-core 12, mission-journeys 11, mission-baseline 13 and mission-evaluate 8. That is 15 new checks, each written RED first against the reproduced finding.
  • make ci passes locally: fmt, lint, test, eval-validate, test-hosts and conformance (3m01s).

Generated by Claude Code

….2/M9.3/M9.10)

A second 4-lens adversarial review found 31 unique ways to weaken the
evaluation or crash a gate; each is now a test.

- Ledger: nothing decides from or records past a broken ledger
  (M.ledger_block, M.LedgerBroken); the lost-row cross-check is scoped to
  the branch that recorded the row; junk run-log lines are skipped;
  state.assessed, ethics.reviewed/blocked and goal.derived/met are rows.
- Journeys: frozen, pinned and retired come from the confirmation and
  retirement records, never from files; runner.files must pin every
  project file the command runs (no links, inline code or outside
  scripts); a judged metric pins its rubric by sha256; a tighter
  operator is not a weakening; unknown flags exit 64.
- Baseline: an edited, moved or malformed current version decides
  nothing; a veto binds content in any order and is decided from records;
  a version once confirmed comes back only by restore.
- Evaluate: every input is the content its record covers (state,
  baseline, frozen journeys, the record-activated goal and its targets);
  evaluate check recomputes metrics and refuses a disagreeing state.
- Core: UTF-8 in any locale (argv, files), a lone surrogate blocks,
  ethics gains a draft status, GA4 reserved names are one list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018RxETAY6S1gcmdctBK8a8Z
@adeelahmad adeelahmad self-assigned this Oct 20, 2026
@adeelahmad
adeelahmad marked this pull request as ready for review October 20, 2026 03:28
…r-plan-6re55w

# Conflicts:
#	CHANGELOG.md
#	docs/ROADMAP.md
@adeelahmad
adeelahmad merged commit 38d3300 into master Oct 20, 2026
5 checks passed
adeelahmad pushed a commit that referenced this pull request Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Aw6CiQcdpzdzZZXKf8WbUM
adeelahmad pushed a commit that referenced this pull request Oct 20, 2026
Master (#78) made state.assessed, goal.derived and goal.met ledger events and
the Evaluator reads a goal's activity from the ledger. goal.py now records
goal.derived and goal.met with M.record (subject: the goal file), reads its
derived record from the ledger, refuses to decide past a broken ledger, and
leaves the state.assessed check to evaluate's own problems().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012rsDo9GYzNx8tXucywZHnA
adeelahmad pushed a commit that referenced this pull request Oct 20, 2026
#78 reads replacements from the journey.retired record's data, so the
test's hand-made retirement records journey_id, replaced_by and its sha256.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Ro7iYo3scQt6vAuAWdYpV
adeelahmad pushed a commit that referenced this pull request Oct 20, 2026
…rgery paths

PR #82 (M9.17) makes a mission grant need the human's own words: a prompt line the
UserPromptSubmit hook captured. gate-mission-scope now denies the ways around that, for every
agent and the supervisor:
- a write (Write/Edit/patch or a Bash write) under <run data>/transcripts/, the captured prompts;
- a Bash `transcripts prompt|record|snapshot|stop|stage-in`, the hooks' own commands;
- where a mission is set, a host session started from a tool call (`claude -p`, `codex exec`,
  `opencode run`, or any prompt), since its prompt fires UserPromptSubmit too. A host's tools
  (`claude plugin validate`, `--version`, `opencode models`) stay allowed; no mission, no rule.

Test: mission-scope-bash.test.py (220 rows; 13 of the 18 new ones fail on the previous gate),
mission-roles.test.py (32 checks); make ci, conformance 78/78 and plugin validate --strict pass.

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