8000 Mission approvals are the human's own words (M9.17) by adeelahmad · Pull Request #82 · adeelahmad/aloop · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ tag in lockstep. Tag releases as `vMAJOR.MINOR.PATCH`.
## [Unreleased]

### Added
- Mission approvals are the human's own words (ROADMAP §4.12, M9.17): `mission approve`, `baseline confirm|restore`, `journeys approve`, `mission ethics consent` and `mission telemetry consent` record only when a prompt the `UserPromptSubmit` hook captured has a line such as `approve msn_… 3f2a9c1b` (the verb and the first 8 hex of the content's sha256); until then they ask (exit 3) with that line. `--by` alone, a negated line, another code, a line older than a later decision about the subject (for a baseline, any version's confirmation) and a hand-appended ledger row without such a line grant nothing. Reason: an approval was only as strong as `--by`, so a role could approve its own mission change. Tests: `mission-core.test.py`, `mission-baseline.test.py`.
- Mission goals and the Aladdin handoff (ROADMAP §4.12, M9.11): `aloop mission goal derive` turns the Evaluator's gaps (in its own priority order) into a goal (autonomous: the top N; spoon-fed: the gaps the human picks with `--pick … --by`, which is the goal's approval) that names its targets and is bound to the mission's content, the eval, the principles block for the mission's mode and the Aladdin autonomy it maps to; `goal check` holds every intent until the goal is the content `derive` recorded, the mission is unchanged and approved and the mission's and the goal's ethics pass; `goal intents` writes one Intent Contract per gap (`intent new --source mission --goal --gap`, filled without a model, and refused for a goal that fails its check); `goal next` normalizes them one sprint at a time; `goal close` marks an active goal met once an evaluation of it says so; goals come only from the latest recorded evaluation, whose state `mission assess` measured, and `events emit` can no longer forge the state, eval or intent records; a gap a hard line fixed is held out of every later goal; `events trace` walks a commit back through intent → goal → eval → ethics → mission → its approver. Test: `mission-goal.test.py`.
- Mission layer hardening (ROADMAP §4.12, a second adversarial review of M9.0/M9.2/M9.3/M9.10, 31 unique findings, each now a test): gates decide from ledger records, not files. Frozen journeys, replacements and retirements, states (`state.assessed`) and the active goal (`goal.derived`) are read from the ledger, so a hidden or edited file changes nothing. Nothing decides from a broken ledger or an edited current baseline, and a restore cannot be undone by a re-apply. The runner pins every project file it runs and refuses links, inline code and scripts outside the project. A judged metric pins its rubric by sha256. A veto binds the content in any order. An unknown flag exits 64. Text is UTF-8 in any locale. GA4's reserved names are one list, and `ethics.*` and `goal.*` decisions are ledger rows. Tests: `mission-{core,journeys,baseline,evaluate}.test.py`.
- Mission ethics (ROADMAP §4.12, M9.4): `aloop mission ethics new --subject mission|<goal_id>` writes a review bound to the subject's sha256 with the topics a fixed screen matched; `record` checks and seals it; `check` passes a clear review, asks (exit 3) on a gray one until `mission ethics consent --by NAME --reason TEXT` is recorded for exactly that content and review (stored inside the goal, never carried over), and blocks a hard line (illegal, deceptive, harmful) for good: no consent, later or edited review, deleted file, edited goal, the same words under a new goal id or a goal derived again from the same gap unlocks it, and the goal is retired (`blocked`). The screen reads normalized text and the mechanics a planner would write ("hide the unsubscribe link", "hack into"), and `check --json` names the state the loop acts on. `events emit` refuses human approvals and ethics verdicts, so only their own commands write them. Reason: the spec's three ethics tiers. Test: `mission-ethics.test.py`.
Expand Down
6 changes: 3 additions & 3 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ Each task flips only its own row here and in TRACKING.md.

| Task | What | Needs | Owns (files) | Parallel-safe | Status |
|---|---|---|---|---|---|
| M9.0 | Core: `mission` entry point, `_mission.py` (ids, canonical sha256, schema subset, approvals, snapshot), `mission init / check / approve / show / status`, event types, the test glob | — | `plugin/bin/{mission,_mission.py}`, `plugin/mission/{README.md,schemas/mission.json}`, `scripts/test/mission-core.test.py`, `_events.py` types, Makefile + `check-tracking.py` glob | — | done: `mission-core.test.py` (12 checks; every record a gate decides from is committed to the hash-chained `docs/agents/mission/ledger.jsonl`, so a fresh checkout keeps it and an edited, removed or backdated row fails the check; nothing decides from or records past a broken ledger; the lost-row cross-check is per branch; text is UTF-8 in any locale; `NO_ARGS` areas run bare) |
| M9.0 | Core: `mission` entry point, `_mission.py` (ids, canonical sha256, schema subset, approvals, snapshot), `mission init / check / approve / show / status`, event types, the test glob | — | `plugin/bin/{mission,_mission.py}`, `plugin/mission/{README.md,schemas/mission.json}`, `scripts/test/mission-core.test.py`, `_events.py` types, Makefile + `check-tracking.py` glob | — | done: `mission-core.test.py` (13 checks; every record a gate decides from is committed to the hash-chained `docs/agents/mission/ledger.jsonl`, so a fresh checkout keeps it and an edited, removed or backdated row fails the check; nothing decides from or records past a broken ledger; the lost-row cross-check is per branch; text is UTF-8 in any locale; `NO_ARGS` areas run bare) |
| M9.1 | Research: claims with source refs, archived source snapshots, `research new / claim / archive / check` | M9.0 | `plugin/mission/research.py`, `schemas/research.json`, `scripts/test/mission-research.test.py` | yes | done: `mission-research.test.py` (18 checks: content-addressed snapshots, every quote re-found as whole words in its snapshot, markup-smuggled quotes, re-sealed edits, fresh clones). Citations are `rsr_<id>#cN` (`research.cite_problems`). Open: pin a citation to its claim's content (`#cN@<digest>`), so a later edit of a cited claim breaks the citation; an optional rule that every claim cites a fetched (not `--file`) source |
| M9.2 | Baseline: re-runnable spec (script + pinned versions), `measure` twice within tolerance, `confirm` freezes a version, `propose` a replacement with evidence, veto window | M9.0 | `plugin/mission/baseline.py`, `schemas/baseline.json`, `scripts/test/mission-baseline.test.py` | yes | done: `mission-baseline.test.py` (13 checks: forged measurements, stale or rolled-back versions, vetoed content under a new id or in another order, NaN, restore that sticks, a moved or edited current version, a broken ledger) |
| M9.2 | Baseline: re-runnable spec (script + pinned versions), `measure` twice within tolerance, `confirm` freezes a version, `propose` a replacement with evidence, veto window | M9.0 | `plugin/mission/baseline.py`, `schemas/baseline.json`, `scripts/test/mission-baseline.test.py` | yes | done: `mission-baseline.test.py` (14 checks: forged measurements, stale or rolled-back versions, vetoed content under a new id or in another order, NaN, restore that sticks, a moved or edited current version, a broken ledger) |
| M9.3 | Journeys and metrics: steps, pass criteria, events, metric query definitions, source refs; `diff` blocks removing or weakening without approval; `run` through a pinned runner; all-green-at-baseline refused | M9.0 | `plugin/mission/journeys.py`, `schemas/journey.json`, `scripts/test/mission-journeys.test.py`, `plugin/mission/_runner.py` | yes | done: `mission-journeys.test.py` (11 checks: self-replacement, pinned replacements and retirements read from the records, hand-set status, runner pins that cover every file the command runs (no links, inline code or outside scripts), rubric pins, unknown flags) |
| M9.4 | Ethics: review per mission and goal, three tiers, gray consent bound to the goal's sha256, hard line never unlocked | M9.0 | `plugin/mission/ethics.py`, `schemas/ethics.json`, `scripts/test/mission-ethics.test.py` | yes | done: `mission ethics new / record / check / consent / screen`; `mission-ethics.test.py` (11 checks). Calls: a fixed screen (over normalized text, every hashed key and value; labels and the mechanics a planner would write instead) names the topics a review must address, and a screened hard-line topic is gray at least (the gate can't judge, but it can make sure nothing flagged is skipped; blunt on purpose: a defensive use such as malware scanning pauses once for the human, since a false gray costs one consent and a false clear costs the gate); a review never lowers, and every current gray review needs its own consent naming its sealed version; a hard line is sticky to the goal (retired: status `blocked`), to its exact words under any goal id, and to the summary of each gap its hard findings name (a goal of one gap: that gap and its statement), so a goal derived again from the same gap stays blocked while a benign gap bundled with it stays free; `check --json` names a state (none, broken, pending, hard, ok) so the loop knows whether to review, restore or ask; `events emit` refuses approvals and ethics verdicts, so only their commands write them (the one edit outside its files: `GATE_OWNED` in `plugin/bin/events`, M9.11's file, built by the same thread); a gray consent is stored in the goal per review, with its reason |
| M9.5 | Judges: rubric setup check and an agreement verdict from recorded runs | M9.0 | `plugin/mission/judge.py`, `schemas/rubric.json`, `scripts/test/mission-judge.test.py` | yes | done: `mission-judge.test.py` (24 checks: pinned models, majority, frozen rubrics, records matched to their judge.run events, verdict shopping, fresh clones). `verdict(…, rubric_sha256=)` lets an approved journey pin its rubric (M9.3 adopts it). Open: a judge on Codex/OpenCode needs an envelope that names the served model (plain text never counts); assess should pass `input_sha256` of a runner-made artifact, since today the judged agent picks the input |
Expand All @@ -437,7 +437,7 @@ Each task flips only its own row here and in TRACKING.md.
| M9.14 | GA4 live on the owner's account (one Google sign-in) | M9.6 | — | — | needs the owner: `aloop mission telemetry auth` prints the steps, then `init`, `consent`, `setup`, `debug-hit`, `verify`; exit: `verify` passes on the owner's property (the MP validator checks no secret, so only that round-trip proves the setup) |
| M9.15 | Native voice mode | the owner's scope (spec cut off) | — | — | open question |
| M9.16 | Docs: OVERVIEW, README, CHANGELOG, site | M9.13 | shared docs | — | blocked |
| M9.17 | Approval provenance: an approval names the captured human prompt (the UserPromptSubmit log), so a supervisor cannot approve its own mission change; the same for a well-formed row appended to `ledger.jsonl` (the chain catches edits, removals and backdating, not a forged append). Reason: found while building M9.0 and in the M9.2/M9.3 review, an approval is only as strong as `--by`; telemetry consent (M9.6) inherits the same gap | M9.0 | `plugin/bin/_mission.py` (`approve`), its test | yes | open |
| M9.17 | Approval provenance: an approval names the captured human prompt (the UserPromptSubmit log), so a supervisor cannot approve its own mission change; the same for a well-formed row appended to `ledger.jsonl` (the chain catches edits, removals and backdating, not a forged append). Reason: found while building M9.0 and in the M9.2/M9.3 review, an approval is only as strong as `--by`; telemetry consent (M9.6) inherits the same gap | M9.0 | `plugin/bin/_mission.py` (`approve`), its test | yes | done: `mission-core.test.py` check 13, `mission-baseline.test.py` check 14. Calls: the human types `<verb> <id> <code>` (code = the first 8 hex of the content's sha256, so the line names exactly what they saw); a command that grants asks (3) with that line until a captured prompt says it, so the friction is one pasted line per decision; a line must start with the verb and carry no negation, and a line captured before a later decision about the subject (other content granted, a veto, a revocation; for a baseline, any version's confirmation) is stale, so an old approve or restore never rolls back, ordered by the prompt count each decision records; the record carries the line, so a fresh checkout still checks it; a veto and the veto window need none (refusing is always safe). Open, with M9.9: the prompt log is run data a shell can append to (or feed through `transcripts prompt` itself), and a headless host session started by a role fires the hook too, so M9.9's guard denies roles all three |
| M9.18 | Ethics screen precision: split each hard-line pattern into act phrases (force gray) and topic words (a finding only), measured on a corpus of benign and harmful goals. Reason: review of #72 measured 15 of 15 defensive goals ("scan attachments for malware") forced to gray | M9.4 | `plugin/mission/ethics.py`, its test | yes | open |
| M9.19 | Core: an ethics skeleton has status `draft` until recorded, so `mission status` counts only real reviews; `_mission.load` reads UTF-8 and `canonical()` survives a lone surrogate. Reason: found in review of #72 | M9.0 | `plugin/bin/_mission.py`, its test | yes | open |
| M9.20 | Mission spend from mission sessions only: tag the ledger rows of sessions the loop starts. Reason: found while building M9.8, `tick` counts every ledger row since the mission was set, the human's own work included (safe, but it stops early) | M9.8 | `plugin/mission/tick.py`, the ledger writer, `mission-tick.test.py` | yes | open 8000 |
Expand Down
2 changes: 1 addition & 1 deletion docs/TRACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Status of every requirement in [ROADMAP.md](ROADMAP.md), in the four states §8
| M9.11 | Goals become Aladdin intents; lineage reaches the mission | IMPLEMENTED_TESTED | `scripts/test/mission-goal.test.py` |
| M9.12 | `/aloop:mission` skill | IMPLEMENTED_TESTED | `scripts/test/mission-skill.test.py` |
| M9.13 | Mission end to end (offline in CI, one live cycle measured) | NOT_IMPLEMENTED | §4.12 |
| M9.17 | Approvals name the captured human prompt | NOT_IMPLEMENTED | §4.12 |
| M9.17 | Approvals name the captured human prompt | IMPLEMENTED_TESTED | `scripts/test/mission-core.test.py` |
| M9.20 | Mission spend counts mission sessions only | NOT_IMPLEMENTED | §4.12 |
| M9.21 | Mission price table kept current | NOT_IMPLEMENTED | §4.12 |
| M9.22 | Mission USD meter prices fast mode and server tools | NOT_IMPLEMENTED | §4.12 |
Expand Down
Loading
Loading
0