diff --git a/.abcd/development/brief/02-constraints/04-naming.md b/.abcd/development/brief/02-constraints/04-naming.md index f278b5963..1da9a8a2e 100644 --- a/.abcd/development/brief/02-constraints/04-naming.md +++ b/.abcd/development/brief/02-constraints/04-naming.md @@ -229,6 +229,7 @@ Two things to read the table with: | `GRILL` | Default plugin-bundled domain, the eleventh, generated rather than written as `SHELL` is: its rules are the asking rules every abcd interview follows (one thing at a time, the thing being decided quoted in full, the question's layout, options that widen and never recommend, deferral recorded as an answer), written once beside the question's field limits with every limit filled from them, and its recall keywords are words of asking and choosing (`which`, `choose`, `decide`, `interview`, …). A repository silences it with `{"GRILL": {"state": "dormant"}}`. | itd-201 / spc-2610030944505997 ("GRILL generated from one Go source") | | `SCRATCH` | Default plugin-bundled domain, the twelfth. Recall keywords (scratch, scratchpad, tmp, temporary, script, watcher, handover) trigger injection of the rule on where a session's working files go: what a later turn, session or agent reruns or reads goes in the main checkout's `.abcd/.work.local/scratch/` (or `logs/`) or a directory under `~/.abcd.noindex/`, never in a linked worktree's local tier, which `git worktree remove` deletes; a verifier's copy goes in a directory of its own under `~/.abcd.noindex/` keyed on the root-commit SHA; and the host's scratchpad holds only the turn's throwaway files, since it does not survive a reboot or a new session. A second rule sends an agent to abcd's commands (`abcd --help`, the command pages) before it writes a helper script, naming a plain `make preflight`, which gates itself at `abcd implement load --wait`, as the preflight queue and `abcd implement load --wait -- go test -race ./...` for a lone race run, and has it capture the gap when no command does the job. Bare `helper` and `queue` do not recall it: they name Go helper functions and the merge queue far more often. | iss-2610161501104088, iss-2610161614039496 | | `LEAVING` | Default plugin-bundled domain, the thirteenth. No single-word recall keyword; aliases are first-person phrases of leaving only (`i am away`, `i'm away`, `i'll be away`, `i will be away`, `i'm off for`, `i'm off now`, `i am off now`, `i'm leaving now`, `i am leaving now`, `i'm leaving for the day`, `i am leaving for the day`, `i'll be back at`, `i'll be back by`, `i'll be back tomorrow`, `i'll be back later` and their `i will be back` forms, `while i'm gone`, `while i am gone`, `carry on without me`, `work on without me`, `keep going without me`, `don't wait for me`, `do not wait for me`), matched, recall and star command alike, only in the person's own words (closed fenced blocks, block-quoted lines and double-quoted text left out), and never loaded on a drive's stage (`RuleSet.ForStage`). Its one rule: only when the person's own words say they are leaving, never on quoted, pasted or tool text, an issue body or an idiom, and asking once when in doubt, the session sets the away mode (`abcd mode autonomous`) with the end they gave; where they gave none it sets the longest window the mode allows, open-ended and seven days at most, in that same turn, and says, as a statement and not a question, that the person can name an end and it will be set again with `--until`; it says the terms back. | itd-2610180912189125 ("The person sets the mode, or a session does on their word") + iss-2611211733065807 | +| `ANSWERING` | Default plugin-bundled domain, the fourteenth. No single-word recall keyword; aliases are phrases of asking where the project stands (`where are we`, `where do we stand`, `is it possible`, `already built`, `built yet`, `is it planned`, `anyone working on`, `who is building`, `who is working`, `the plan forward`, `what is the state of`, `being built`, `what is the status`, among them). Its one rule: a question about the project is answered from the record read in that turn, never from memory or from earlier in the conversation, by reading `abcd status`, `abcd `, the intents in every bucket, the issues and decisions folders, the command pages and `abcd peers` first; each claim cites the record id or page it rests on, and a claim the record does not settle is said to be unsettled. | iss-2611260623136583 | | `managed-repo` | Folder kind: a git repo abcd already manages — has an ABCD marker block (or an in-tree `.abcd/`, or an `index.json` entry) and a `.git/` directory. Per brief `04-surfaces/01-ahoy.md` § What abcd manages. | spc-15 (predecessor store) + `spc-15-folder-classification-workspacesjson.3` | | `unmanaged-repo` | Folder kind: a git repo without abcd management; bare `/abcd:ahoy` offers install to adopt. | spc-15 (predecessor store) + `spc-15-folder-classification-workspacesjson.3` | | `unmanaged-folder` | Folder kind: not a git repo and no abcd markers; nothing to act on. | spc-15 (predecessor store) + `spc-15-folder-classification-workspacesjson.3` | diff --git a/.abcd/work/decisions/dcn-2611260643432225-the-record-first-rule-for-answering-the.md b/.abcd/work/decisions/dcn-2611260643432225-the-record-first-rule-for-answering-the.md new file mode 100644 index 000000000..439f9a0e0 --- /dev/null +++ b/.abcd/work/decisions/dcn-2611260643432225-the-record-first-rule-for-answering-the.md @@ -0,0 +1,6 @@ +--- +id: dcn-2611260643432225 +slug: the-record-first-rule-for-answering-the +date: 2026-11-26 +--- +2026-11-26 — The record-first rule for answering the person's questions about the project ships as its own bundled rules domain, ANSWERING, recalled on question phrases (where are we, is it possible, already built, who is working on, the plan forward), rather than as an eleventh rule in OPINIONS as iss-2611260623136583's remedy proposed. Grounds: OPINIONS recalls on words about approaches and conventions, so widening its recall to status questions would inject its whole set, and shrink it to its first rule under the budget, on every such prompt; a domain of its own injects exactly the one rule and can be silenced per repository with a dormant state. Reverse by moving the rule into OPINIONS and deleting the domain. diff --git a/.abcd/work/decisions/dcn-2611260650120281-a-reserve-renewal-that-names-a-footprint.md b/.abcd/work/decisions/dcn-2611260650120281-a-reserve-renewal-that-names-a-footprint.md new file mode 100644 index 000000000..7ee0d1475 --- /dev/null +++ b/.abcd/work/decisions/dcn-2611260650120281-a-reserve-renewal-that-names-a-footprint.md @@ -0,0 +1,6 @@ +--- +id: dcn-2611260650120281 +slug: a-reserve-renewal-that-names-a-footprint +date: 2026-11-26 +--- +2026-11-26 — A reserve renewal that names a footprint keeps replacing the held footprint, as commands/reserve.md documents, rather than gaining an add-to-footprint mode; iss-2611260633438543's second half is closed by the warning that already names each dropped path (dropped_footprint in --json) and by --renew, which keeps the footprint recorded. Grounds: replacing is what lets a lane narrow its footprint, a union mode would make narrowing need a second flag, and the warning reaches the caller in the same command that pushed the narrower footprint, so although another lane may reserve a dropped path first, the caller learns of the gap at once and can reserve the path again. Reverse by adding --add-footprint to reserve. diff --git a/.abcd/work/decisions/dcn-2611260656374635-defer-iss-2611260653533228-the-build.md b/.abcd/work/decisions/dcn-2611260656374635-defer-iss-2611260653533228-the-build.md new file mode 100644 index 000000000..354f85eba --- /dev/null +++ b/.abcd/work/decisions/dcn-2611260656374635-defer-iss-2611260653533228-the-build.md @@ -0,0 +1,6 @@ +--- +id: dcn-2611260656374635 +slug: defer-iss-2611260653533228-the-build +date: 2026-11-26 +--- +2026-11-26 — Defer iss-2611260653533228 (the build loop closes a spec without the doc-fidelity gate spec close runs) past v0.17.1 instead of fixing it now. Grounds: the release cut already refuses without a docs review saved for HEAD, so nothing unreviewed reaches users; gating the loop's close alone would hand back every unattended build at its last lane, because the loop has no docs-review role, so the fix is that role first (spc-2609202134338445, the no-host drive step), then the gate at the loop's close. Reverse by adding an Options seam the CLI fills with enforceDocFidelity and calling it before intent.Reconcile in land.go. diff --git a/.abcd/work/decisions/dcn-2611261031231366-building-iss-2611260929594647-a-failed.md b/.abcd/work/decisions/dcn-2611261031231366-building-iss-2611260929594647-a-failed.md new file mode 100644 index 000000000..0f9b1fa15 --- /dev/null +++ b/.abcd/work/decisions/dcn-2611261031231366-building-iss-2611260929594647-a-failed.md @@ -0,0 +1,6 @@ +--- +id: dcn-2611261031231366 +slug: building-iss-2611260929594647-a-failed +date: 2026-11-26 +--- +2026-11-26 — Building iss-2611260929594647 (a failed preflight prints the narrow rerun for each failed test) waits: every file the change would touch is reserved by a peer: internal/testreuse/run.go by iss-2611060835285748 and itd-2611011325421304, cmd/check-tests/main.go by iss-2611051719429185, the Makefile by iss-2610230048490215 and iss-2610241214065079. A helper in a new file that nothing calls until run.go is free would be dead scaffolding. Grounds: peer reservations, read with abcd peers on 2026-11-26. Reverse: build it once run.go is free. diff --git a/.abcd/work/decisions/dcn-2611261203316845-defer-past-the-landing-of-1808-two.md b/.abcd/work/decisions/dcn-2611261203316845-defer-past-the-landing-of-1808-two.md new file mode 100644 index 000000000..0a37dd496 --- /dev/null +++ b/.abcd/work/decisions/dcn-2611261203316845-defer-past-the-landing-of-1808-two.md @@ -0,0 +1,6 @@ +--- +id: dcn-2611261203316845 +slug: defer-past-the-landing-of-1808-two +date: 2026-11-26 +--- +2026-11-26 — Defer, past the landing of #1808, two review notes on it, to fix in a change of their own on main once it lands: (1) minor: the SubagentStart hook (internal/surface/cli/hook_subagent_start.go, the fact write before the deadline select) can keep a told fact for a sub-agent that was never told, when the deadline and the work's end race or the stdout write fails, so its stop records rules-not-run beside start-failed; (2) nitpick: the word-reader audit's reason for assignmentStart (internal/core/guard/unknownsites_test.go) says it steps only fixed text, while it steps repeat's count whatever it is. Grounds: neither lets a command through or loses work, #1808 holds a review pair for its head, and changing the head again costs a full review and preflight cycle. Reverse: fix both in #1808 before it merges. diff --git a/.abcd/work/decisions/dcn-2611262047162623-the-brief-s-configuration-chapter-still.md b/.abcd/work/decisions/dcn-2611262047162623-the-brief-s-configuration-chapter-still.md new file mode 100644 index 000000000..8d0ad3b11 --- /dev/null +++ b/.abcd/work/decisions/dcn-2611262047162623-the-brief-s-configuration-chapter-still.md @@ -0,0 +1,6 @@ +--- +id: dcn-2611262047162623 +slug: the-brief-s-configuration-chapter-still +date: 2026-11-26 +--- +2026-11-26 — The brief's configuration chapter still describes the example active set of bundled rules domains without ANSWERING, the domain added on reserve-footprint-1126, so it says the set names all fourteen where it now names fifteen. That chapter is not changed in this branch: another session holds reservations on the file under two of its records, and a reservation means another lane's work there is not to be overlapped. The edit is made in its own change once those reservations are released. Grounds: the concurrency rules (reserve before mutating, never touch a peer's held paths); the drift is one example block and a count, and no test or reader depends on it. Reverse: make the edit as soon as the reservations clear, or earlier if the holder agrees. diff --git a/.abcd/work/issues/open/iss-2611040554222004-the-checklist-chapter-says-each-item.md b/.abcd/work/issues/open/iss-2611040554222004-the-checklist-chapter-says-each-item.md index 5b5214dae..7b7a904b7 100644 --- a/.abcd/work/issues/open/iss-2611040554222004-the-checklist-chapter-says-each-item.md +++ b/.abcd/work/issues/open/iss-2611040554222004-the-checklist-chapter-says-each-item.md @@ -15,3 +15,15 @@ remedy: "Give checklist add and set a repeatable --owner-ref flag that checks th The checklist chapter says each item carries the references it is about and an optional credential named by kind, scope and expiry (.abcd/development/brief/04-surfaces/40-checklist.md:35), and commands/checklist.md:77-78 says an item needing a credential names it that way. The schema validates and the list renders owner_refs and credential (internal/core/checklist/checklist.go:138-139), but `abcd checklist add` has only --next-look, --promise and --waits-on, `set` has only --state, and no non-test code assigns either field. Neither can reach an item through a shipped write. The gap has a consequence a session meets at the end of a turn. The stop hook's note that the list is behind (internal/core/autonomy/checklist_behind.go:110) and commands/checklist.md:105-108 tell a session to name each of its branches and reservations in an item's owner_refs, using `abcd checklist add` or `abcd checklist set`. Neither verb takes a flag that writes owner_refs (internal/surface/cli/checklist.go:136-163), so the note cannot be cleared through the verbs. + +## The stop hook asks for what no verb writes (2026-11-26) + +The gap is no longer only a documentation inconsistency. While the person is +away, the stop hook's checklist-behind line tells the session to bring the +checklist up to date "with `abcd checklist add` or `abcd checklist set`, +naming each in an item's owner_refs" (internal/core/autonomy/checklist_behind.go). +Neither verb takes owner_refs, so the instruction cannot be met, and it repeats +at every stop of a session that owns branches. The remedy's first half (a +flag that writes the field, such as a repeatable `--owner-ref` on `add`) +becomes the one that clears it; until it lands, the hook's line should not +name a field no verb writes. diff --git a/.abcd/work/issues/open/iss-2611260643446976-adr-23-s-core-boundary-holds-by.md b/.abcd/work/issues/open/iss-2611260643446976-adr-23-s-core-boundary-holds-by.md new file mode 100644 index 000000000..eab6b3fe6 --- /dev/null +++ b/.abcd/work/issues/open/iss-2611260643446976-adr-23-s-core-boundary-holds-by.md @@ -0,0 +1,15 @@ +--- +schema_version: 1 +id: "iss-2611260643446976" +slug: "adr-23-s-core-boundary-holds-by" +severity: "minor" +category: "architectural-insight" +source: "agent-observation" +found_during: "an architecture review, 2026-11-26" +origin: researcher-authored +production_mode: hand-written +found_at: "internal/core" +remedy: "Add an audit test that walks internal/core's packages with go/packages (or go list -deps) and fails on an import of internal/surface, a reference to os.Stdout or fmt.Print*, and a call to os.Exit, with an allowlist file naming each standing exception and its reason; then decide each embedded front-door string (keep with a reason, or move it to the surface)." +--- + +adr-23's boundary, that internal/core never imports internal/surface, never writes to stdout and never calls os.Exit, holds by convention only: no test or lint checks it, and some core strings already embed front-door text, such as the regenerate command in internal/core/lint/indexgen.go. diff --git a/.abcd/work/issues/open/iss-2611260653533228-the-build-loop-closes-a-spec-without-the.md b/.abcd/work/issues/open/iss-2611260653533228-the-build-loop-closes-a-spec-without-the.md new file mode 100644 index 000000000..97dbcdfde --- /dev/null +++ b/.abcd/work/issues/open/iss-2611260653533228-the-build-loop-closes-a-spec-without-the.md @@ -0,0 +1,21 @@ +--- +schema_version: 1 +id: "iss-2611260653533228" +slug: "the-build-loop-closes-a-spec-without-the" +severity: "major" +category: "inconsistency" +source: "agent-observation" +found_during: "an ideate record grill of the build loop, 2026-11-26" +origin: researcher-authored +production_mode: hand-written +found_at: "internal/core/implement/loop/land.go" +remedy: "Route the loop's close through the same gate the CLI's spec close uses (move the doc-fidelity check into the core close path both callers share), so a close that ships an intent refuses until a docs review is saved for HEAD and the loop hands the run back naming it; prove it with a loop test whose close is refused without a review and passes with one." +deferred_after: v0.17.1 +deferral_reason: "The release cut already refuses without a docs review saved for HEAD, so no unreviewed intent reaches a release; gating the loop's close as well would hand back every unattended build at its last lane until the loop has a docs-review role of its own, which is design work for the build spec's no-host drive step (spc-2609202134338445). Fix it with that role, then route the loop's close through the gate." +--- + +The build loop closes a delivered spec by calling intent.Reconcile directly (internal/core/implement/loop/land.go), which ships the intent without the doc-fidelity gate the CLI's spec close runs before an intent moves to shipped/, so an intent delivered by abcd build reaches shipped/ with no docs review saved for its head, and the review binds only later, at the release cut. + +## Deferral 2026-11-26 + +Deferred past v0.17.1: The release cut already refuses without a docs review saved for HEAD, so no unreviewed intent reaches a release; gating the loop's close as well would hand back every unattended build at its last lane until the loop has a docs-review role of its own, which is design work for the build spec's no-host drive step (spc-2609202134338445). Fix it with that role, then route the loop's close through the gate. diff --git a/.abcd/work/issues/open/iss-2611260929594647-after-a-preflight-fails-nothing-points-a.md b/.abcd/work/issues/open/iss-2611260929594647-after-a-preflight-fails-nothing-points-a.md new file mode 100644 index 000000000..ed8e35f79 --- /dev/null +++ b/.abcd/work/issues/open/iss-2611260929594647-after-a-preflight-fails-nothing-points-a.md @@ -0,0 +1,15 @@ +--- +schema_version: 1 +id: "iss-2611260929594647" +slug: "after-a-preflight-fails-nothing-points-a" +severity: "minor" +category: "process" +source: "user-observation" +found_during: "landing the night branches while away, 2026-11-26" +origin: researcher-authored +production_mode: hand-written +found_at: "Makefile" +remedy: "When make preflight fails, end its output with the narrow rerun for every failing test, grouped by package and in the stage's own mode (go test -race -count=3 -run '' for a race-stage failure, the plain form for the unit stage, the audit's own command for a gate), beside make precheck; and add the rule to the LOAD or a preflight rules domain: fix, run that rerun and make precheck clean, then rerun the full preflight once. Test that a failing fixture run prints the rerun lines." +--- + +After make preflight fails, nothing points a session at a narrow rerun of what failed before the next full run, so a fix is proven only by another hour-long preflight, and a second failure hidden behind the first costs another hour. On 2026-11-26 a landing preflight ran 2h10m and failed on two tests in one file, a data race caught only by the race stage and a refusal-shape audit; the fix for the first alone, rerun in full, would have failed again on the second. The preflight's failure output names the failing tests but not the command that reruns them in the mode they failed in. diff --git a/.abcd/work/issues/open/iss-2611262119287199-the-stop-hook-s-checklist-check-asks-a.md b/.abcd/work/issues/open/iss-2611262119287199-the-stop-hook-s-checklist-check-asks-a.md new file mode 100644 index 000000000..d52fc34c6 --- /dev/null +++ b/.abcd/work/issues/open/iss-2611262119287199-the-stop-hook-s-checklist-check-asks-a.md @@ -0,0 +1,16 @@ +--- +schema_version: 1 +id: "iss-2611262119287199" +slug: "the-stop-hook-s-checklist-check-asks-a" +severity: "minor" +category: "observation" +source: "user-observation" +found_during: "away run, stop hook checklist check" +origin: researcher-authored +production_mode: hand-written +found_at: "internal/core/autonomy/checklist_behind.go" +remedy: "Add a repeatable --about flag to checklist add (and to set, to add or replace refs), validated as owner_refs already is (a record id, pr: or branch:), and have the hook's message name that flag." +refines: [iss-2611040554222004] +--- + +The stop hook's checklist check asks a session to name each branch it owns in a checklist item's owner_refs ('Bring it up to date now, with abcd checklist add or abcd checklist set, naming each in an item's owner_refs'), but neither checklist add nor checklist set has a flag that writes owner_refs, and no other command writes it. The session can only hand-edit checklist.json, so the check keeps firing however current the checklist is. diff --git a/.abcd/work/issues/resolved/iss-2611260623136583-an-agent-answers-the-person-s-questions.md b/.abcd/work/issues/resolved/iss-2611260623136583-an-agent-answers-the-person-s-questions.md new file mode 100644 index 000000000..4cfc3ba3b --- /dev/null +++ b/.abcd/work/issues/resolved/iss-2611260623136583-an-agent-answers-the-person-s-questions.md @@ -0,0 +1,21 @@ +--- +schema_version: 1 +id: "iss-2611260623136583" +slug: "an-agent-answers-the-person-s-questions" +severity: "minor" +category: "process" +source: "user-observation" +found_during: "a question about running a build from a plain terminal, 2026-11-26" +origin: researcher-authored +production_mode: hand-written +found_at: "AGENTS.md" +remedy: "Add a rule to the rules loader's bundled OPINIONS domain, recalling on question words about the project's state (where are we, is it possible, planned, already, status, who is building): a question about the project's state, plans or capabilities is answered from the record read in that turn (abcd status, abcd , the intents, issues and decisions folders, the command pages, abcd peers), each claim citing the record id or page it rests on, and a claim the record does not settle is said to be unsettled rather than answered from memory. Prove it with a rules test that the domain recalls on such a prompt and injects the rule." +resolution: "A bundled rules domain, ANSWERING, recalls on a question about the project's state (where are we, is it possible, already built, who is working on, the plan forward) and injects the rule that the answer is read from the record in that turn, never from memory, each claim citing its record id or page and an unsettled claim said to be unsettled; dcn-2611260643432225." +impact: additive +--- + +An agent answers the person's questions about the project (where a capability stands, whether something is planned or already built, who is working on what) from its own memory or the conversation instead of reading the record first, so an answer can be stale or wrong while sounding certain. The person asked on 2026-11-26 that the record always be checked instead: the intents in every bucket, the issues, the decisions, the command pages and what peers and reservations show. + +## Grounds + +- pursued: we expect a session asked where a capability stands to read the record before answering and cite it; an answer to such a question that cites nothing, or contradicts the record, would show it wrong diff --git a/.abcd/work/issues/resolved/iss-2611260633438543-abcd-reserve-stores-a-comma-joined.md b/.abcd/work/issues/resolved/iss-2611260633438543-abcd-reserve-stores-a-comma-joined.md new file mode 100644 index 000000000..7acd68151 --- /dev/null +++ b/.abcd/work/issues/resolved/iss-2611260633438543-abcd-reserve-stores-a-comma-joined.md @@ -0,0 +1,21 @@ +--- +schema_version: 1 +id: "iss-2611260633438543" +slug: "abcd-reserve-stores-a-comma-joined" +severity: "minor" +category: "ux" +source: "agent-observation" +found_during: "reserving a two-fix branch while away, 2026-11-26" +origin: researcher-authored +production_mode: hand-written +found_at: "commands/reserve.md" +remedy: "Refuse a --footprint value containing a comma that names no existing path, naming the repeated-flag form (one --footprint per path); and add --add-footprint (or make a renewal keep held paths unless --replace-footprint is given) so widening a reservation never drops what it held. Test both refusals and the union." +resolution: "abcd reserve refuses a --footprint value that joins two or more paths with commas and names no path in the checkout (exit 2, nothing pushed), naming the repeated-flag form; an existing path named with a comma is reserved as written. The renewal half is closed by dcn-2611260650120281: a renewal's footprint replaces the held one by design, and the warning names each path it drops." +impact: fix +--- + +abcd reserve stores a comma-joined --footprint value as one path, so --footprint a.go,b.go reserves a single path named with a comma and the overlap check never matches either file; and a renewal with a new --footprint replaces the reservation's paths rather than adding to them, which it warns about only after the paths it dropped are no longer held. + +## Grounds + +- pursued: we expect a comma-joined footprint never to reach origin again; a reservation tip carrying an Abcd-Footprint path with a comma that names no file would show it wrong diff --git a/AGENTS.md b/AGENTS.md index a6632feaa..2ef91a707 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -76,8 +76,8 @@ command alone, or waits a turn. ### Default domains `COMMITTING`, `DOCUMENTATION`, `ROADMAP`, `ISSUES`, `INTENTS`, `LIFEBOAT`, `PII`, -`OPINIONS`, `LOAD`, `SHELL`, `GRILL`, `SCRATCH`, `LEAVING`. Each carries recall keywords and its rules, bundled -in the abcd binary; a repo overrides them per-field via `.abcd/rules.json`. +`OPINIONS`, `LOAD`, `SHELL`, `GRILL`, `SCRATCH`, `LEAVING`, `ANSWERING`. Each carries recall keywords and rules, bundled in the +binary; a repo overrides them per-field via `.abcd/rules.json`. `OPINIONS` points at the canonical conventions under `.abcd/development/principles/` rather than copying them. `LOAD` carries the trust rule for load experiments: one owned process group killed together through diff --git a/commands/reserve.md b/commands/reserve.md index 66005e364..6f3f6fb54 100644 --- a/commands/reserve.md +++ b/commands/reserve.md @@ -47,7 +47,11 @@ Run, naming every repository-relative path the work will change, once per path: ``` The record is an issue (`iss-N`) or an intent (`itd-N`). The footprint is -required. Name files, not directories: a directory holds off every other +required, one path per `--footprint`: a value holding a comma that names no +path in the checkout, whether it joins two paths or ends one with a stray +comma, is refused (exit 2, nothing pushed) with the repeated-flag form spelled +out, each path quoted, because it would otherwise be stored as one path that no +overlap check matches. Name files, not directories: a directory holds off every other reservation of any file inside it, so a lane holding a whole package keeps every unrelated lane that touches one file of it waiting. A footprint path naming a directory git tracks is still reserved, exit 0, and warns on stderr, diff --git a/internal/core/ahoy/defaults/claude-md-marker-block.md b/internal/core/ahoy/defaults/claude-md-marker-block.md index 33e7f60a7..488414656 100644 --- a/internal/core/ahoy/defaults/claude-md-marker-block.md +++ b/internal/core/ahoy/defaults/claude-md-marker-block.md @@ -70,8 +70,8 @@ command alone, or waits a turn. ### Default domains `COMMITTING`, `DOCUMENTATION`, `ROADMAP`, `ISSUES`, `INTENTS`, `LIFEBOAT`, `PII`, -`OPINIONS`, `LOAD`, `SHELL`, `GRILL`, `SCRATCH`, `LEAVING`. Each carries recall keywords and its rules, bundled -in the abcd binary; a repo overrides them per-field via `.abcd/rules.json`. +`OPINIONS`, `LOAD`, `SHELL`, `GRILL`, `SCRATCH`, `LEAVING`, `ANSWERING`. Each carries recall keywords and rules, bundled in the +binary; a repo overrides them per-field via `.abcd/rules.json`. `OPINIONS` points at the canonical conventions under `.abcd/development/principles/` rather than copying them. `LOAD` carries the trust rule for load experiments: one owned process group killed together through diff --git a/internal/core/rules/answering_test.go b/internal/core/rules/answering_test.go new file mode 100644 index 000000000..6f560c0e2 --- /dev/null +++ b/internal/core/rules/answering_test.go @@ -0,0 +1,85 @@ +package rules + +import ( + "slices" + "strings" + "testing" +) + +// answeringDomain is the bundled domain that has a question about the +// project's state answered from the record read in that turn +// (iss-2611260623136583). +const answeringDomain = "ANSWERING" + +// TestAnsweringDomainRecallsQuestionsAboutTheProject pins iss-2611260623136583: +// a question about where the project stands, whether something is possible, +// planned or already built, or who is working on what, recalls the domain, and +// its rule has the answer read from the record that turn, each claim citing +// what it rests on, and a claim the record does not settle said to be +// unsettled. Before it, such a prompt injected nothing, and an agent answered +// from memory. +func TestAnsweringDomainRecallsQuestionsAboutTheProject(t *testing.T) { + rs := Defaults() + for _, prompt := range []string{ + "where are we in terms of running a session entirely through the CLI?", + "Where are we with the drain?", + "is that already possible?", + "is it planned, or built already?", + "has this been built yet?", + "is anyone working on the release?", + "who is building the dashboard?", + "what's the plan forward?", + "status? what's being built?", + "what's the status of the drain?", + "what is the state of the reading work?", + } { + if got := rs.Match(prompt); !has(got, answeringDomain) { + t.Errorf("%q does not recall %s: %v", prompt, answeringDomain, names(got)) + } + } + d, ok := rs.Domains[answeringDomain] + if !ok { + t.Fatalf("no bundled %s domain", answeringDomain) + } + if len(d.Rules) == 0 { + t.Fatalf("%s has no rules", answeringDomain) + } + rule := d.Rules[0] + for _, want := range []string{ + "read in this turn", + "never from memory", + "abcd status", + "abcd ", + "abcd peers", + "Cite the record id", + "unsettled", + } { + if !strings.Contains(rule, want) { + t.Errorf("the %s rule misses %q:\n%s", answeringDomain, want, rule) + } + } + res := Inject(rs, "where are we with the drain?", SessionState{}, 0, BracketUnknown) + if !slices.Contains(res.Injected, answeringDomain) { + t.Fatalf("a question about the project injected %v, want %s in it", res.Injected, answeringDomain) + } +} + +// TestAnsweringDomainIgnoresWorkPrompts holds recall to questions about the +// project: an instruction to do work recalls nothing of it. +func TestAnsweringDomainIgnoresWorkPrompts(t *testing.T) { + rs := Defaults() + for _, prompt := range []string{ + "fix the flaky test", + "run the tests for the parser", + "rename hook_away.go", + "add a flag to the capture verb", + "commit and push", + "keep working on the parser", + "run abcd status", + "save the state of the run", + } { + if got := rs.Match(prompt); has(got, answeringDomain) { + t.Errorf("%q recalls %s", prompt, answeringDomain) + } + } +} diff --git a/internal/core/rules/defaults/rules.json b/internal/core/rules/defaults/rules.json index ea7fd2096..e0def413d 100644 --- a/internal/core/rules/defaults/rules.json +++ b/internal/core/rules/defaults/rules.json @@ -118,6 +118,34 @@ "Every claim has one home: each fact, rule, behaviour and list in the record is written in one place, and every other place that needs it names that place instead of restating it; a one-line pointer, a generated copy with a matching check, and history kept in git and the ADRs are not second homes — see .abcd/development/principles/every-claim-has-one-home.md.", "The full set of opinionated conventions lives in .abcd/development/principles/ — read the relevant file rather than guessing the convention." ] + }, + "ANSWERING": { + "state": "active", + "aliases": [ + "where are we", + "where do we stand", + "is it possible", + "is that possible", + "is this possible", + "already possible", + "already built", + "built already", + "built yet", + "is it planned", + "is that planned", + "planned or", + "anyone working on", + "who is building", + "who is working", + "the plan forward", + "what is the state of", + "being built", + "what is the status", + "what's the status" + ], + "rules": [ + "Answer a question about the project from the record read in this turn, never from memory or from earlier in the conversation: where a capability stands, whether something is possible, planned or already built, and who is working on what are read from `abcd status`, `abcd `, the intents in every bucket, the issues and decisions folders, the command pages and `abcd peers` before the answer is written. Cite the record id or page each claim rests on, and say plainly that a claim the record does not settle is unsettled rather than filling it in." + ] } } } diff --git a/internal/core/rules/rules_test.go b/internal/core/rules/rules_test.go index eba047aae..c7e2b2531 100644 --- a/internal/core/rules/rules_test.go +++ b/internal/core/rules/rules_test.go @@ -85,7 +85,7 @@ func TestDefaultsParseAndValidate(t *testing.T) { if err := Validate(rs); err != nil { t.Fatalf("bundled defaults fail validation: %v", err) } - for _, want := range []string{"COMMITTING", "DOCUMENTATION", "ROADMAP", "ISSUES", "INTENTS", "LIFEBOAT", "PII", "OPINIONS", "LOAD", "SCRATCH", "LEAVING"} { + for _, want := range []string{"COMMITTING", "DOCUMENTATION", "ROADMAP", "ISSUES", "INTENTS", "LIFEBOAT", "PII", "OPINIONS", "LOAD", "SCRATCH", "LEAVING", "ANSWERING"} { if _, ok := rs.Domains[want]; !ok { t.Errorf("default domain %q missing", want) } diff --git a/internal/surface/cli/reserve.go b/internal/surface/cli/reserve.go index bfd1fd672..74f1a5ede 100644 --- a/internal/surface/cli/reserve.go +++ b/internal/surface/cli/reserve.go @@ -5,6 +5,8 @@ import ( "fmt" "io" "os" + "path/filepath" + "strconv" "strings" "time" @@ -16,6 +18,7 @@ import ( "github.com/intentdriven/abcd/internal/core/refusal" "github.com/intentdriven/abcd/internal/fsutil" "github.com/intentdriven/abcd/internal/gitutil" + "github.com/intentdriven/abcd/internal/shellquote" "github.com/intentdriven/abcd/internal/termsafe" "github.com/spf13/cobra" ) @@ -458,6 +461,9 @@ func newReserveCommand(asJSON *bool) *cobra.Command { if err != nil { return refused(2, refusal.ReserveOutsideCheckout, "abcd reserve: "+err.Error()+"; nothing was pushed") } + if msg := commaJoinedFootprint(root, footprint); msg != "" { + return refused(2, refusal.UsageInvalidFlagValue, msg) + } noteMachineHome(cmd.ErrOrStderr(), "abcd reserve") req := claim.Request{Record: args[0], Footprint: footprint, Lease: leaseFor, TakeOver: takeOver, Release: release, Admit: admit, WarnOwnOverlap: true} @@ -759,3 +765,40 @@ func noteMachineHome(w io.Writer, verb string) { fmt.Fprintln(w, verb+": "+termsafe.Sanitize(fsutil.RedactHome(note))) } } + +// commaJoinedFootprint refuses a --footprint value that joins two or more +// paths with commas and names no path in the checkout (iss-2611260633438543): +// the flag takes one path per use, so such a value would be stored as one +// path named with a comma that no overlap check ever matches. A path whose +// own name holds a comma, and exists, passes; a value that names one path and +// a stray comma is refused as well, since it would be stored with the comma. +// It returns the refusal's text, naming the repeated-flag form with each path +// quoted for the shell, or "" when every value is one path. +func commaJoinedFootprint(root string, footprint []string) string { + for _, v := range footprint { + if !strings.Contains(v, ",") { + continue + } + if _, err := os.Lstat(filepath.Join(root, filepath.FromSlash(v))); err == nil { + continue + } + var parts []string + for _, part := range strings.Split(v, ",") { + if part = strings.TrimSpace(part); part != "" { + parts = append(parts, part) + } + } + if len(parts) == 0 { + return "abcd reserve: --footprint " + strconv.Quote(termsafe.Sanitize(v)) + + " names no path, only commas; name each path with its own flag; nothing was pushed" + } + quoted := make([]string, len(parts)) + for i, part := range parts { + quoted[i] = shellquote.Single(part) + } + return "abcd reserve: --footprint takes one path per use, and " + strconv.Quote(termsafe.Sanitize(v)) + + " joins it with commas; name each path with its own flag: --footprint " + + termsafe.Sanitize(strings.Join(quoted, " --footprint ")) + "; nothing was pushed" + } + return "" +} diff --git a/internal/surface/cli/reserve_comma_test.go b/internal/surface/cli/reserve_comma_test.go new file mode 100644 index 000000000..684c52382 --- /dev/null +++ b/internal/surface/cli/reserve_comma_test.go @@ -0,0 +1,53 @@ +package cli + +import ( + "strings" + "testing" +) + +// TestReserveRefusesACommaJoinedFootprint (iss-2611260633438543): a +// --footprint value that joins several paths with commas, and names no path +// in the checkout, is refused (exit 2) naming the repeated-flag form, and +// nothing reaches origin; before it the value was stored as one path named +// with a comma, which no overlap check ever matched. A path whose own name +// holds a comma, and exists, is reserved as written. A value with one path +// and a stray comma is refused too, since it would be stored with the comma, +// and the form the refusal names quotes each path for the shell, so a part +// that reads as a flag or a second command is never offered as one. A value +// of commas alone names no path, and is refused saying so. +func TestReserveRefusesACommaJoinedFootprint(t *testing.T) { + w := newReserveWorld(t) + p := w.clone(t, "p", octoMail) + writeRel(t, p, "odd,name.md", "a\n") + gitCmd(t, p, "add", "-A") + gitCommit(t, p, "commit", "-q", "-m", "odd") + gitCmd(t, p, "push", "-q", "origin", "main") + + code, stdout, stderr := reserveRun(t, p, "reserve", "iss-1", "--footprint", "a.go,b.go") + if code != 2 || !strings.Contains(stderr, "--footprint 'a.go' --footprint 'b.go'") || !strings.Contains(stderr, "nothing was pushed") { + t.Fatalf("a comma-joined footprint: exit %d, stdout %q, stderr %q; want exit 2 naming the repeated-flag form", code, stdout, stderr) + } + if w.remoteTip(t, "iss-1") != "" { + t.Fatal("the refused reserve reached origin") + } + code, stdout, stderr = reserveRun(t, p, "reserve", "iss-3", "--footprint", "a.go,") + if code != 2 || !strings.Contains(stderr, "--footprint 'a.go';") { + t.Fatalf("one path and a stray comma: exit %d, stdout %q, stderr %q; want exit 2 naming --footprint 'a.go'", code, stdout, stderr) + } + code, stdout, stderr = reserveRun(t, p, "reserve", "iss-4", "--footprint", "a.go,b --take-over") + if code != 2 || !strings.Contains(stderr, "--footprint 'b --take-over'") { + t.Fatalf("a part that reads as a flag: exit %d, stdout %q, stderr %q; want it quoted in the form named", code, stdout, stderr) + } + code, stdout, stderr = reserveRun(t, p, "reserve", "iss-5", "--footprint", ", ,") + if code != 2 || !strings.Contains(stderr, "names no path, only commas") { + t.Fatalf("a value of commas alone: exit %d, stdout %q, stderr %q; want exit 2 saying it names no path", code, stdout, stderr) + } + for _, id := range []string{"iss-3", "iss-4", "iss-5"} { + if w.remoteTip(t, id) != "" { + t.Fatalf("the refused reserve of %s reached origin", id) + } + } + if code, stdout, stderr := reserveRun(t, p, "reserve", "iss-2", "--footprint", "odd,name.md"); code != 0 { + t.Fatalf("an existing path named with a comma: exit %d, stdout %q, stderr %q; want it reserved", code, stdout, stderr) + } +}