8000 M11.15: one-step chat consent for one-way doors; test DB drops are two-way by adeelahmad · Pull Request #125 · 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
8000
Diff view
4 changes: 4 additions & 0 deletions .aladdin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# aloop run data (transcripts, budgets, ledger, logs, state) — never committed
*
!.gitignore
!config.yaml
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ tag in lockstep. Tag releases as `vMAJOR.MINOR.PATCH`.
## [Unreleased]

### Added

- **Kernel and user space (M12).** The loop's opinions (16 roles, skills, a kernel reference) are
ejected into `docs/agents/userspace/` (tracked in git) on the first session or `aloop init --apply`,
and changed freely. `aloop userspace` (`status`, `which`, `upgrade`, `diff`, `merge`, `accept`,
Expand All @@ -38,6 +37,7 @@ tag in lockstep. Tag releases as `vMAJOR.MINOR.PATCH`.
or timed-out module blocks, and every run is logged (`module.run`). A distro bundles a domain's
modules, roles and skills (`software`, the TDD loop, is the default). Build and share your own:
`aloop module new`, `aloop distro new|check|install|use`; how-to in `docs/BUILD-A-MODULE.md`.
- A one-way door costs the human one step, and a test resource is no door (ROADMAP M11.15). Dropping test-named databases on a local server (`dropdb recast_test_…`, `psql -c "DROP DATABASE … _test_…"`, destructive SQL inside a test-named database) is two-way: crossed with no question and logged as `door.two_way` (test-scoped); a non-test name, a mix, a remote host (flag, `PGHOST`, URI) or a name the gate cannot read stays one-way. Every `ASK[door]` now names a chat line, `allow DOOR <code>` (the code names the door and that exact action): the human types it where they already are, the gate finds it among the captured prompts, records a human ledger row citing it and crosses once; a reused, negated or forged line opens nothing and an agent still cannot authorize itself. `doors authorize` refusals print the whole command to paste (flags filled, the newest stopped action's `--once`), and from an agent's `!` shell also the chat line. Reason: a field session needed a second terminal and three tries to drop 35 archived test databases. Test: `mission-doors-consent.test.py`.
- A task's diff stays in its planned fileset, with worker-declared exemptions (ROADMAP M11.12): `targets diffscope` (GREEN and RED stop gates) judges the diff against the task's targets' paths and planned tests, literally. A new test file passes; an existing test outside the plan may only gain lines (GREEN and RED can no longer weaken or delete another task's test). A production file the plan missed passes only as a `### Scope exemptions` line (`- <path>: <reason>`) in the worker's output.md block: a literal path, a reason of 4+ words, at most 3 (`ALOOP_SCOPE_EXEMPT_MAX`), never a one-way path (CI, VCS config, agent settings, secrets, migrations, licences, run data); each one taken is a `scope.exempted` ledger row, with no human step. The contract's SCOPE_GLOBS can only narrow the plan, a task with no targets gets no free scope, `targets check` refuses a glob path, a production file under a nested `target/` (no Cargo.toml beside it) is judged, and non-ASCII paths are read unquoted. Test: `scripts/test/task-scope.test.py`.
- Plan approval is a gate (ROADMAP M0.9): `gate-dispatch` starts no execution role (RED, SCAFFOLD, GREEN, structural review, final gate) of a sprint until the human approved that sprint's plan as it is now. `events authority --sprint N` exits 3 with the line to type, `approve SN <code>` (reviewed, the code naming the sha256 of the sprint's plan files, its intake and standards included) or `autonomous SN <code>` (autonomy for that sprint, re-plans included, the code naming the authority record); the task contract's `STORY_DIR` and task must be a live story and task of that plan's frozen `ids.json`; the line must be among the human's captured prompts and typed after the sprint's last decision (M9.17's mechanism). A changed plan, a re-plan in reviewed mode, a roll-back to an old line, another sprint's line, a negated line and a hand-edited or emitted record all block (`plan.approved` and `human.approval` cannot be `events emit`ted); an approved autonomous mission grants its own sprints autonomy with no line. `events approval SPRINT|TASK_ID` is the check. Codex's `spawn_agent` (`agent_type`, `message`) and OpenCode's `task` now reach `gate-dispatch` too, and `claude -p`, `codex exec` and `opencode run` from a tool call are blocked in every aloop project, not only where a mission is set. `e2e-live.sh` pre-approves with an `autonomous S1 <code>` line in its prompt. Reason: the north star allows no human help beyond approval, and the approval was a playbook rule a supervisor could skip. A 4-lens adversarial review found 9 defects: 7 fixed with a check red on the first head (cross-sprint or unplanned `STORY_DIR`, a retyped line kept stale, mission autonomy over a non-mission sprint, `transcripts prune` dropping the prompts grants cite, `codex plugin add` refused, a code past column 200, a crash on a malformed run-log line), 2 in the playbook (intake reuses a mission's handed-off intent; a reviewed re-plan waits for the human's new line). `transcripts prune` now keeps the human's prompts. Test: `plan-approval.test.py` (20 checks, red on master), plus the host suites. The approved plan's files include the sprint's `intake.md` and `standards.md`, and a grant pins them file by file: GREEN's check for an unplanned dependency reads only the text the human's grant pins, the plan they approved or, under their autonomy grant, the plan as the planner's gate last passed it (`gate-stage2-complete` records `plan.gated` on the planner's stop), as it was then, so text added later names nothing and a re-plan does not undo an approved dependency.
- Core agent principles and the one-way / two-way door rule (ROADMAP §4.12, M9.30): seven core principles from Amazon's Leadership Principles, the door rule first, go to every aloop agent at session start (`aloop mission principles show --core`). A two-way door (a branch, a local edit, a test, a draft PR) is decided, not asked. A one-way door (`aloop mission doors list`: a push or merge to the default branch, a force-push, a release, a deploy, a message sent outside, a secret, dropped data, …) is stopped by a PreToolUse gate with `ASK[door] <id>` until the human records an authorization in their own terminal (`aloop mission doors authorize ID --by NAME --reason TEXT [--until DATE] [--once DIGEST]`, a hash-chained ledger row); a wall (switching a gate off, forging a human record) is never crossed. While a run is live, a question to the human must name a door the gate stopped and nobody authorized. Reason: Adeel's request that agents decide two-way doors themselves and ask only at a one-way door not already authorized. Test: `mission-doors.test.py`. Hardened by an adversarial review (15 findings, each a test): the gate reads Bash as the shell does (comments, line continuations, heredoc bodies, `xargs`, `find -exec`, `echo … | sh`), a branch condition reads the directory the command acts on (`git -C`, `cd`), settings are guarded wherever they live, dry runs and `command -v` are two-way, the newest decision by time counts and a revoke holds on every branch, a once-grant is crossed once under a lock, a broken ledger is named, and `doors authorize` refuses an agent's shell.
Expand Down
5 changes: 4 additions & 1 deletion docs/OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ The model can ignore a skill; it cannot ignore an exit code.
or a dead path that unit tests missed; ROADMAP M0.8 (runs 1–35) and M8 (from run 36) list them.
- The door rule (ROADMAP §4.12, M9.30): every agent gets the core principles at session start, and a
PreToolUse gate stops a one-way door (a push to the default branch, a release, a deploy, a secret, …)
until the human records an authorization; two-way doors pass without a question.
until the human records an authorization; two-way doors pass without a question. The human consents
in one step from the agent's chat by typing the `allow <door> <code>` line the stop prints (or runs
`doors authorize` in their own terminal), and dropping test-named databases on a local server is
two-way, logged as `door.two_way` (M11.15).
- One measured real run (*TheNoteBook*, a Go backend): ~17K LOC, 322 tests, 74 commits in 6
sprints for ~1.55M output tokens, 76% of it on Sonnet. See the
[README](../README.md#evidence).
Expand Down
Loading
Loading
0