axstack 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +132 -0
  3. package/bin/axstack.js +396 -0
  4. package/docs/installation.md +239 -0
  5. package/docs/workflows.md +220 -0
  6. package/package.json +40 -0
  7. package/profiles/presets/claude-only.json +194 -0
  8. package/profiles/presets/codex-only.json +194 -0
  9. package/profiles/presets/mixed.json +194 -0
  10. package/skills/axstack/SKILL.md +81 -0
  11. package/skills/axstack/references/automations.md +368 -0
  12. package/skills/axstack/references/candidate-publication.md +45 -0
  13. package/skills/axstack/references/contracts.md +102 -0
  14. package/skills/axstack/references/lifecycle.md +137 -0
  15. package/skills/axstack/references/orca-runtime.md +109 -0
  16. package/skills/axstack/references/pr-shape.md +39 -0
  17. package/skills/axstack/references/routing.md +129 -0
  18. package/skills/axstack/references/run-record.md +109 -0
  19. package/skills/axstack-align/SKILL.md +121 -0
  20. package/skills/axstack-audit/SKILL.md +137 -0
  21. package/skills/axstack-audit/references/record.md +28 -0
  22. package/skills/axstack-debug/SKILL.md +157 -0
  23. package/skills/axstack-debug/references/packet.md +80 -0
  24. package/skills/axstack-explain/SKILL.md +66 -0
  25. package/skills/axstack-explain/references/visual-qa.md +15 -0
  26. package/skills/axstack-implement/SKILL.md +164 -0
  27. package/skills/axstack-improve/SKILL.md +69 -0
  28. package/skills/axstack-relay/SKILL.md +102 -0
  29. package/skills/axstack-research/SKILL.md +57 -0
  30. package/skills/axstack-research/references/checklist.md +25 -0
  31. package/skills/axstack-review/SKILL.md +343 -0
  32. package/skills/axstack-spec/SKILL.md +67 -0
  33. package/skills/axstack-tickets/SKILL.md +86 -0
  34. package/skills/axstack-watch/SKILL.md +160 -0
  35. package/skills/axstack-watch/references/repair-publication.md +69 -0
  36. package/skills/axstack-watch/references/watch-runtime.md +60 -0
  37. package/src/capabilities.js +138 -0
  38. package/src/claude-settings.js +230 -0
  39. package/src/installer.js +980 -0
  40. package/src/instructions.js +100 -0
  41. package/src/locations.js +43 -0
  42. package/src/manifest.js +251 -0
  43. package/src/posixpath.js +108 -0
  44. package/src/roles.js +142 -0
@@ -0,0 +1,137 @@
1
+ # Shared lifecycle and receipts
2
+
3
+ Phases load through [Standing contracts](contracts.md)' mandatory edge.
4
+ Substantive delegated or resumable work uses a driver-owned [Run record](run-record.md)
5
+ binding state and receipts to exact revisions.
6
+
7
+ ## Roster (compact)
8
+
9
+ - Driver: current chat; owns scope, decisions, cross-PR dependencies, Linear
10
+ mutations, and integration.
11
+ - Owner (`axstack-owner`): one persistent owner per PR; launches its author,
12
+ reviewers and watches; may perform authorized PR-scoped publication within user authority.
13
+ Human merge is default.
14
+ - Author: exactly one writer per candidate; accepted fixes return there.
15
+ Workers launch no recursive teams.
16
+ - Reviewers: peer = two independent `axstack-reviewer-primary` and
17
+ `axstack-reviewer-secondary` sessions with identical brief and isolated first
18
+ pass; authored = one eligible configured reviewer from actual author
19
+ provenance. Owner and author never review.
20
+ - Driver/monitor/watchdog: the five-minute driver is the automation session
21
+ itself, a mutating owner for the PRs it handles with no `axstack-monitor` or
22
+ `axstack-owner` role row. `axstack-monitor` is an optional read-only observer
23
+ that never sends. `axstack-watchdog` is the hourly health checker that never
24
+ mutates GitHub and performs exactly one kind of send, a gate-authorized
25
+ automation-health escalation recorded in `watchdog.json`.
26
+ - Auditor (`axstack-auditor`): report-only; never edits, merges, activates, or
27
+ audits itself.
28
+
29
+ Prefer parallel independent bounded work; no redundant workers.
30
+ Per [standing contracts](contracts.md), fanout is dependency/capacity-driven
31
+ with no fixed count, within host and spending limits. [PR shape](pr-shape.md)
32
+ covers theme/size; queue via `gh stack`.
33
+
34
+ ## Ownership
35
+
36
+ The PR owner remains accountable for candidate, fixes, evidence, and monitoring;
37
+ peer code stays read-only. Missing or idle sessions never transfer ownership.
38
+ Owned implementation enters review through the revision-bound
39
+ [candidate-publication boundary](candidate-publication.md).
40
+
41
+ ## Native handoff and resume
42
+
43
+ Preparation completion/watch expiry writes a resumable record. Ordinary resume
44
+ reconciles it, keeps the current owner, and launches no native handoff.
45
+ Only an explicit user request to transfer ownership enters this branch.
46
+
47
+ 1. Reconcile the [Run record](run-record.md) with Orca Tasks, Dispatches,
48
+ sessions, Git revisions, forge, pending receipts, and timer expiries; live
49
+ owners and authoritative Dispatches beat stale state.
50
+ 2. Load the [Orca runtime boundary](orca-runtime.md), then follow its
51
+ version-matched runtime-owned handoff guidance. Never guess calls, paths,
52
+ roles, or fallback models. Guide discovery does not prove capability.
53
+ 3. If the required native capability is missing, report the exact setup gap and
54
+ keep the current owner; no replacement or ownership transfer launches.
55
+ Read-only reconciliation may continue.
56
+ 4. Record recipient/pending receipt before launch. If uncertain, reconcile the
57
+ actual workspace/session before retry and block duplicates.
58
+ 5. Launch is not ownership. Record the recipient's explicit acceptance receipt
59
+ before changing ownership; current owner remains accountable until then. A
60
+ prior owner seeing a different valid accepted owner stops.
61
+
62
+ Complete record: goal, authority, intent, IDs, revisions, evidence, pending
63
+ receipts/timers, unresolved decisions, next action, and transfer ownership/gap.
64
+
65
+ ## Receipts (bind each decision to evidence)
66
+
67
+ Store concise receipt references, not raw worker output, in the [Run record](run-record.md).
68
+
69
+ - Session receipt: actual agent/workspace IDs, requested provider/model and
70
+ role; reuse on resume rather than spawn a replacement.
71
+ - Acceptance receipt: sender/recipient, accepted scope/authority, timestamp,
72
+ and ownership session receipt.
73
+ - Review receipt: mode, applicable provenance, reviewer, SHA/base,
74
+ verdict (`APPROVE | REQUEST_CHANGES | INCOMPLETE`), coverage, limitations and
75
+ findings. Changed code needs a receipt for its new revision.
76
+ - Submission receipt: actual commit, review, remote confirmation; ambiguity
77
+ requires external lookup before retry.
78
+ - Audit receipt: scope, evidenced PASS/FAIL/UNKNOWN counts/denominators and
79
+ proposals. Only an authorized sanitized summary publishes.
80
+
81
+ ## Execution tracking
82
+
83
+ The driver consumes native Orca completion and escalation deliveries for the
84
+ active Run. Process each whole delivery before acknowledgment and validate its
85
+ Task, Dispatch, sender, authority, revisions, and receipts before advancing the
86
+ run record. Duplicate deliveries are deduplicated by runtime identity. Healthy
87
+ unchanged observations produce no user-facing update.
88
+
89
+ Detect completed-but-unadvanced work, failed sessions, unresolved launch
90
+ receipts, and stalls through the version-matched orchestration guide. Never
91
+ duplicate a writer; idle is not complete. `input_accepted`, `turn_started`,
92
+ session liveness, delivery, and verified advancement are distinct evidence.
93
+ On `consumer_fenced`, reconcile the active coordinator rather than borrowing an
94
+ identity. Respect settlement protection including `user_takeover`.
95
+
96
+ No execution heartbeat or substitute scheduler is created by Axstack. Native
97
+ watch automation follows [Watch health](#watch-health).
98
+ Tracking grants no merge, release, model-substitution, or scope authority.
99
+
100
+ ## Deadline (one rule for every owned timer)
101
+
102
+ The default 24-hour deadline covers every task-owned timer, including open-PR
103
+ monitors and watchdogs. Stop at deadline; remaining work gets a resumable
104
+ handoff, never silent renewal. Merge-ready differs from merged; human merges.
105
+
106
+ ## Watch health
107
+
108
+ The user lifted the native-watch hold by user decision on 2026-09-16. The driver
109
+ automation is a mutating owner for its PRs; `axstack-watchdog` stays
110
+ independent and read-only, with quiet healthy snapshots, deduplicated events,
111
+ restart reconciliation, and one shared deadline. Native Orca automations expose
112
+ a provider but cannot pin model, effort, or permission, so the driver records
113
+ its model identity every tick and the watchdog treats a mismatch as a safety
114
+ hold. Build no custom scheduler and use no legacy fallback. Details live in
115
+ [Watch runtime](../../axstack-watch/references/watch-runtime.md).
116
+
117
+ ## Audit hook (end of run and meaningful checkpoints)
118
+
119
+ Auditing defaults on for every substantive run at its end and meaningful
120
+ checkpoints such as material deviation or repeated repair. Load the bundled [audit skill](../../axstack-audit/SKILL.md)
121
+ and dispatch its auditor. An `axstack-audit` run is excluded: it writes its
122
+ record and launches no children.
123
+
124
+ The auditor reads the [Run record](run-record.md) for scope, outcomes, and
125
+ metric counts/denominators; reports evidenced PASS/FAIL/UNKNOWN; and invents no
126
+ numbers or cost. Proposals change nothing. Accepted proposals return as
127
+ tested, independently reviewed work with a regression scenario and unchanged
128
+ holdout checks. No automatic self-edit, merge, or activation. Records stay
129
+ private; publication needs separate authority.
130
+
131
+ ## Idle-complete archive and retain
132
+
133
+ After required PRs merge or hand off, timers stop, and receipts verify, mark
134
+ the same [Run record](run-record.md) `Archived` in place. Preserve
135
+ scope, revisions, evidence, receipts, and expiries. Archive only idle-complete
136
+ records: never active/waiting workers, unrelated host state, or ownership merely
137
+ because it is idle.
@@ -0,0 +1,109 @@
1
+ # Orca runtime boundary
2
+
3
+ Read this immediately before using Orca for a role dispatch, handoff, delivery,
4
+ settlement, or recovery. Ordinary local reading and writing do not load it.
5
+ Axstack owns policy, role selection, and evidence; Orca owns Run, Task,
6
+ Dispatch, session, worktree, messaging, settlement, and scheduling state.
7
+
8
+ ## Discover the runtime-owned guides
9
+
10
+ Resolve one Orca executable for the session and reuse it. Prefer
11
+ `ORCA_CLI_COMMAND` when set, then the checkout's `orca-dev` when
12
+ `ORCA_DEV_REPO_ROOT` is set, the Linux-safe `orca-ide` outside managed
13
+ terminals, and otherwise `orca`. If the selected executable fails, report that
14
+ exact gap; never switch binaries silently.
15
+
16
+ Before supervised work, load the selected executable's version-matched
17
+ `skills get orchestration --json` and `skills get orca-cli --json` guides.
18
+ Follow returned schemas and their named conditional references rather than
19
+ copying their command procedures into Axstack. Missing guide discovery is a
20
+ setup gap. It does not authorize legacy runtime use or an Axstack dispatcher,
21
+ daemon, scheduler, database, or escalation engine.
22
+
23
+ ## Bind the configured role
24
+
25
+ Read `roles.json` relative to the actually loaded `axstack` skill. The installed
26
+ shape is `{ "version": 1, "preset": "<name>", "roles": [...] }`. Bundled
27
+ profiles are setup inputs shaped as
28
+ `{ "version": 1, "roles": [...] }`. A new run records the selected preset and
29
+ all 21 role rows once. An active run keeps the exact snapshot until the user
30
+ explicitly changes it.
31
+
32
+ Select the requested role by stable ID. A missing or null model holds only that role;
33
+ never launch a provider default. Validate provider, model, and effort
34
+ against the guide and actual launch capability. Stored `modeId` and other
35
+ permission fields are conservative intent, not proof of effective permission
36
+ parity or a security boundary. Requested settings, input acceptance, effective
37
+ settings, and completed work are separate evidence. An unsupported or
38
+ unavailable value holds affected work for the user's decision without fallback.
39
+ The single-provider preset's null adviser is intentional installation data, not
40
+ readiness failure; because Align and Spec require both adviser receipts, either
41
+ null adviser still holds those phases. The current chat is the driver and has
42
+ no role row in any preset.
43
+
44
+ ## Supervise one authoritative attempt
45
+
46
+ For supervised work, use the orchestration guide's native Run, Task, and
47
+ Dispatch flow. Reconcile existing attempts first. Bind the approved spec or
48
+ small-change intent, brief, authority, role snapshot, worktree, base, and
49
+ candidate to the Task; preserve the returned
50
+ Task, Dispatch, terminal, agent, and worktree identities. Exactly one Dispatch
51
+ may write a candidate at a time.
52
+
53
+ A worker worktree carries the lineage of the work it serves. Create it with
54
+ `--parent-worktree` naming the candidate's worktree, so a reviewer, repair, or
55
+ child-task checkout appears under the candidate it belongs to instead of as an
56
+ unrelated top-level row. `--no-parent` is only for unrelated, independent work
57
+ with no parent context, never a review or repair of an existing candidate. When
58
+ a worktree was created with the wrong lineage, correct it in place with
59
+ `worktree set --parent-worktree`; that is metadata and does not disturb a
60
+ running worker. Lineage is presentation and reconciliation state, never
61
+ authority: it grants nothing, and a correct parent never substitutes for the
62
+ Task, Dispatch, and receipt evidence above.
63
+
64
+ An `input_accepted` stage proves only that input reached the terminal. Require
65
+ `turn_started` plus runtime/session inspection before treating the agent as
66
+ started, and verify the requested role independently before trusting its work.
67
+ A workspace trust, hook review, permission, authentication, or model prompt is
68
+ a visible hold. Never answer a trust or permission prompt on the worker's
69
+ behalf. Preserve the attempt and use only the runtime guide's inspection and
70
+ recovery procedure; reconcile before retry so no duplicate writer starts.
71
+
72
+ ## Consume, settle, and recover
73
+
74
+ Process a whole delivery before acknowledgment. Accept `worker_done` only when
75
+ its sender, Task, and Dispatch match the expected active attempt; then verify
76
+ the candidate revision and evidence before advancing Axstack's derived record.
77
+ A valid completion for an older Dispatch never completes a newer Dispatch.
78
+ Duplicate messages are deduplicated by their runtime identity.
79
+
80
+ On `consumer_fenced`, stop consuming under that identity. Reconcile the active
81
+ coordinator and delivery through the runtime guide; never bypass the fence,
82
+ forge a sender, borrow a terminal identity, or partially acknowledge the
83
+ delivery. Settlement is also runtime-owned: reuse, retain, or release a settled
84
+ terminal only through the guide. A `user_takeover` result requires retention;
85
+ do not close, release, reuse, or send commands to that terminal as cleanup.
86
+
87
+ Contact loss, silence, idle state, or an absent status never proves exit or
88
+ transfers authority. Ordinary restart and resume reconcile the same owner,
89
+ author, Task, Dispatch, worktree, revisions, and pending receipts. Authorized
90
+ repairs return to the same author when its session and evidence remain usable;
91
+ uncertainty holds replacement rather than creating a second writer.
92
+
93
+ ## Transfer ownership explicitly
94
+
95
+ Distinguish supervised workers from a full ownership handoff. Only the user's
96
+ explicit transfer request enters this branch. Record the intended recipient,
97
+ exact scope, revisions, authority, and pending request before following the
98
+ runtime-owned `orca-cli` handoff procedure.
99
+
100
+ Input acceptance or turn start is launch evidence, not ownership. Validate an
101
+ explicit recipient acceptance against the intended request, session, scope,
102
+ candidate/base, and authority before changing ownership. Until then the current
103
+ owner remains accountable. After a valid acceptance, record it, transfer only
104
+ the accepted authority, and have the prior owner stop. Ordinary resume keeps
105
+ the current owner and never launches a handoff.
106
+
107
+ The runtime step is complete only when its real receipts are recorded with
108
+ their limitations. Those receipts grant no merge, release, publication, model
109
+ substitution, host-configuration, or scope authority.
@@ -0,0 +1,39 @@
1
+ # PR shape
2
+
3
+ ## Measure
4
+ Measure the full PR from its actual PR base with:
5
+ ```sh
6
+ git diff -M --numstat $(git merge-base <base> <head>)..<head>
7
+ ```
8
+
9
+ A stacked child uses its parent branch; a root PR uses its actual target branch.
10
+ `main` is only an example; repositories may target `develop` or a release branch.
11
+ Total additions + deletions over all files. Disclose moves detected by `-M`;
12
+ report binaries by count and purpose, never estimated lines. Disclose generated,
13
+ lockfile, and formatter-only bulk buckets alongside the total.
14
+
15
+ The full total controls the level: ≤2000 is the target. The 2001–2500 rationale
16
+ band requires only a recorded cohesion rationale, with no split-attempt record.
17
+ The >2500 exception band requires the full exception record below. Bulk may
18
+ support either rationale only with a reproducible recorded command. Never
19
+ automatically subtract bulk or shift bands; silent exclusion is forbidden; no file-count hard metric.
20
+
21
+ ## Theme
22
+ One behavior or component may include the callers, tests, types, docs, and
23
+ migrations that must change together to stay green and reviewable.
24
+ This is not a folder restriction. Unrelated themes split even under the target.
25
+ Smaller cohesive PRs are encouraged; no padding.
26
+
27
+ ## Exception band
28
+ The driver attempts a reasonable split first. If each tried split materially
29
+ compromises atomicity, green state, or independent reviewability, or inseparable
30
+ reproducible bulk dominates, record and proceed autonomously within the approved
31
+ spec. The mandatory record includes the full total, bulk buckets with their
32
+ reproducible command, measured head and base, split attempts tried, and why each
33
+ fails on atomicity, green state, or reviewability. “Already written,” deadlines,
34
+ and rebase pain are not reasons.
35
+ Size alone never requires user approval. Review verifies the measurement and
36
+ whether the stated split failure is real under angle 6, not the number itself.
37
+ Missing rationale blocks approval; weak rationale returns to the author through
38
+ the normal split/rework loop, never to the user. Escalate only for an existing
39
+ material-scope, security, downtime, data-loss, major-design-risk, or unavailable-model hold.
@@ -0,0 +1,129 @@
1
+ # Shared routing (every owned phase loads this)
2
+
3
+ Choose one route; load only the phase and references needed next.
4
+
5
+ ## Role routing
6
+
7
+ Presets: `mixed`, `codex-only`, `claude-only`. For a new run, read
8
+ `profiles.preset` from `.axstack-manifest.json` at the actually loaded
9
+ skills root, or an explicit user selection recorded in the run record. Proceed
10
+ only with exactly one unambiguous preset; missing or contradictory sources are
11
+ a setup gap: hold. Never infer from live profiles or `list_profiles`, harness,
12
+ tools, credentials, quota, subscription, or default to `mixed`.
13
+
14
+ At run start, capture one **routing snapshot**: the complete map of all 21 role
15
+ IDs with provider/model/mode/effort, absent or unconfigured roles recorded
16
+ explicitly, and no invented provider default. An absent or unconfigured role
17
+ holds only that role's work, not the run. A role installed or changed later
18
+ must not silently enter the snapshot; adding it needs an explicit user
19
+ decision. Live profiles are authoritative at snapshot time and for availability;
20
+ bundled presets are setup inputs, not runtime proof.
21
+
22
+ Preset changes apply to new runs only; an active run keeps its snapshot.
23
+ Changing it or replacing a session needs an explicit user decision and
24
+ revalidation. Unavailable models, unsupported efforts, missing roles, and
25
+ incompatible overrides hold only affected work; no automatic fallback, quota
26
+ routing, subscription inference, or silent provider/model/effort substitution.
27
+
28
+ Role IDs:
29
+
30
+ - The current chat drives (no role ID); `axstack-owner` owns one PR and
31
+ `axstack-author` its sole writer.
32
+ - `axstack-reviewer-primary` and `axstack-reviewer-secondary` are the ordered
33
+ peer pair. Peer review uses both; authored review uses this table:
34
+
35
+ | Preset | Author | Reviewer (model/effort) |
36
+ | --- | --- | --- |
37
+ | `mixed` | Codex / Sol (`codex/gpt-5.6-sol`) | `axstack-reviewer-secondary` (`claude/claude-opus-5` medium) |
38
+ | `mixed` | Claude / Opus (`claude/claude-opus-5`) | `axstack-reviewer-primary` (`codex/gpt-5.6-sol` medium) |
39
+ | `codex-only` | Codex / Sol (`codex/gpt-5.6-sol`) | `axstack-reviewer-secondary` (`codex/gpt-5.6-terra` xhigh) |
40
+ | `claude-only` | Claude / Opus (`claude/claude-opus-5`) | `axstack-reviewer-secondary` (`claude/claude-sonnet-5` xhigh) |
41
+ - `axstack-advisor-astra` and `axstack-advisor-fable` advise independently;
42
+ `axstack-auditor` audits; `axstack-checker` reports discrepancies.
43
+ - `axstack-explainer` authors explanations; `axstack-explainer-review`
44
+ reviews them. `axstack-monitor` observes only; `axstack-watchdog` sends
45
+ only gate-authorized health escalations.
46
+ - `axstack-debug-investigator-1..4` each probe one L1 brief.
47
+
48
+ Provenance is matched on provider/model ID; record effort but never use it to
49
+ create a mapping. Provenance absent from the preset's table row is
50
+ unsupported and `INCOMPLETE` (including its secondary reviewer model, Astra,
51
+ Luna, or Fable); report the exact gap and ask the user. Never derive a reverse
52
+ pairing from slot position, driver, owner, or provider. Author and owner never
53
+ review their own work.
54
+
55
+ ## Direct routes (no spec ceremony)
56
+
57
+ - One bounded research question -> `axstack-research`: verify primary sources
58
+ and code, return a cited note with limitations. Fan out only distinct
59
+ questions.
60
+ - Understanding a system, change, or implementation gap -> `axstack-explain`:
61
+ show current/intended behavior, evidence dimensions, and bounded gaps; use
62
+ project docs and verify rendered behavior when applicable. Stale axstack-docs
63
+ is superseded. Publication needs separate authority.
64
+ - A bug, failing test, regression, or wrong behavior, red loop wanted ->
65
+ `axstack-debug`: diagnose, escalate via adviser-directed investigators, hand
66
+ off a classified repair (explain: how; debug: what's wrong).
67
+ - Codebase-quality or refactor discovery -> `axstack-improve`: inspect bounded
68
+ scope, rank evidenced candidates, report only; no spec, tickets, or source
69
+ edits. Selected changes return via preparation or execution.
70
+ - Preparation completion, watch expiry, resume, or reconciliation -> the
71
+ [lifecycle](lifecycle.md#native-handoff-and-resume): reconcile the run
72
+ record, keep its owner, launch no native handoff.
73
+ - Explicit user-requested ownership transfer -> the same lifecycle section.
74
+ Load the [Orca runtime boundary](orca-runtime.md), follow the runtime-owned
75
+ handoff guide, and require explicit recipient acceptance before ownership
76
+ changes. Missing capability is a setup gap, never license to invent one.
77
+ - Colleague PR review -> `axstack-review`, peer mode.
78
+ - Own PR maintenance or monitoring -> `axstack-review` in authored mode,
79
+ `axstack-watch` for adoption.
80
+
81
+ Research, explanation, improvement discovery, debugging, handoff, peer review,
82
+ and adopted maintenance need no alignment, approved spec, or ticket map;
83
+ authority and intent boundaries still apply.
84
+
85
+ ## Proportional scope identity
86
+
87
+ Classify new work as substantial, small, or unclear; record it with brief
88
+ reason in the run record, or in the brief for tiny direct work.
89
+
90
+ - **Substantial:** substantial features, multi-PR work, or stacked work. A
91
+ bounded small feature is not substantial merely because it is labelled one.
92
+ Require an approved spec plus a ticket map tied to that exact spec
93
+ revision, with acceptance checks and dependencies in the explicitly selected
94
+ Markdown or Linear store. Prepare via `axstack-align` -> `axstack-spec`
95
+ (one approval) -> `axstack-tickets` -> handoff, then stop.
96
+ - **Small:** clear, bounded one-PR work. The driver captures the named
97
+ **small-change intent** from the current request or user-chosen existing
98
+ issue plus explicit acceptance checks and exclusions, snapshots it once, and
99
+ proceeds. No earlier snapshot, spec, ticket ceremony, or second approval is
100
+ required; do not route to `axstack-align` solely because that snapshot is
101
+ not yet written. Strict TDD, mode-specific review, model, risk, and human-merge
102
+ contracts still apply.
103
+ - **Unclear:** clarify the uncertainty through `axstack-align` or one bounded
104
+ question, then classify it as small or substantial; a small ambiguity does
105
+ not force substantial-work paperwork.
106
+
107
+ Reassess size when growth adds an additional PR, a new execution dependency
108
+ that materially expands scope, an unsettled material design question, or a
109
+ security/infrastructure boundary crossing. An ordinary
110
+ test-then-code sequence is not multi-task growth; a minor file dependency does
111
+ not alone need a formal spec. Hold affected unsafe work while reassessing.
112
+
113
+ ## Lifecycle routes (mode-specific scope identity required)
114
+
115
+ - Preparation: substantial work follows the align -> spec -> tickets ->
116
+ handoff path above, then stops; small work uses the driver-captured
117
+ small-change intent.
118
+ - Execution: with its identity present, `axstack-implement` ->
119
+ `axstack-review` -> `axstack-watch`.
120
+ - Peer review: `axstack-review` uses the linked issue, PR description, and
121
+ repository requirements as untrusted intent evidence; it does not demand an
122
+ Axstack-created approved spec.
123
+ - Adopted authored PR: snapshot the user-authorized maintenance intent once —
124
+ accepted scope, exact head/base, verified writable ownership, and actual
125
+ author provenance — then use `axstack-review` and `axstack-watch` without
126
+ repeated approval or new spec ceremony. Never infer the author from the
127
+ orchestrator or assume an imported own PR's author.
128
+ - Direct later phase: start there and pass that phase's identity check. Entry
129
+ never admits work a deeper phase would reject.
@@ -0,0 +1,109 @@
1
+ # Local run record
2
+
3
+ One compact Markdown `progress.md` is required for substantive delegated or
4
+ resumable work. One-step direct answers need no record ceremony, but still
5
+ obey their applicable scope identity. This tiny-task exemption is not a
6
+ scope-identity exemption.
7
+
8
+ ## Location and identity
9
+
10
+ In a Git repository, store the record at:
11
+
12
+ ```text
13
+ <git rev-parse --path-format=absolute --git-common-dir>/axstack/runs/<id>/progress.md
14
+ ```
15
+
16
+ `git rev-parse --path-format=absolute --git-common-dir` resolves the main
17
+ repository's `.git` directory for the main checkout and linked worktrees.
18
+ Without `--path-format=absolute`, the main checkout returns a relative `.git`,
19
+ making the persisted path ambiguous across worktrees and the current working
20
+ directory. The record is shared across those worktrees and never enters the
21
+ tracked tree.
22
+
23
+ Use `<UTCdate>-<slug>`, where UTCdate is `YYYYMMDD`, for example
24
+ `20260913-local-progress`. The driver chooses the slug using lowercase letters,
25
+ digits, and hyphens only, never raw request text. It has no separators
26
+ or path segments, so it stays inside `axstack/runs/`; add a collision-safe
27
+ suffix when needed. For non-Git work, use private host state instead of the
28
+ working directory.
29
+
30
+ On resume, discover existing runs and match both repository and scope;
31
+ never blindly select the latest. Git metadata is not pushed, but it can be
32
+ copied or backed up, so its contents remain private and compact.
33
+
34
+ ## Writer and transitions
35
+
36
+ The driver is the sole record writer. Workers send concise receipts; they do
37
+ not edit `progress.md`. This is a prompt contract, not a lock or runtime
38
+ coordination mechanism. Each task names the actual owner session and worktree,
39
+ or a receipt pointer containing both; a role label alone is insufficient.
40
+
41
+ Update before dispatch and after each verified transition. On resume,
42
+ reconcile the record with actual Orca sessions and Dispatches, exact revisions, forge/PR
43
+ state, and the approved intent. Prevent a duplicate writer, mark approval or
44
+ evidence for an older revision stale, and distinguish task completion from a
45
+ capability being merged.
46
+
47
+ The record is derived progress, not authority. Orca sessions and Dispatches, Git revisions,
48
+ forge/PR state, and the approved spec remain sources of truth. The driver
49
+ verifies exact SHAs and receipts before recording a transition; a worker claim
50
+ alone is not verification.
51
+
52
+ Before changing `Driver` or a task `Owner`, verify that the prior driver is
53
+ inactive against actual Orca session and Dispatch state, or that an explicit accepted transfer
54
+ permits reassignment. Idle alone never reassigns ownership.
55
+ Uncertain state or a live conflict holds the transfer; never overwrite the
56
+ field to seize control. A prior driver that sees a different valid accepted
57
+ owner stops.
58
+
59
+ `Archived` is a status in the same record and path. Nothing is moved or
60
+ deleted.
61
+ The driver records `paused` on a user request or a hold; idle alone is neither.
62
+
63
+ ## Handoff and resumption
64
+
65
+ Keep handoff state in this same record, never a second wrapper record. Before a
66
+ native handoff launch, add the intended recipient and a pending launch-receipt
67
+ pointer. Record the actual agent/workspace receipt once verified, then the
68
+ recipient's explicit acceptance receipt before changing ownership. Preserve
69
+ pending external receipt pointers and timer expiries so an uncertain launch,
70
+ send, or watch can be looked up before any retry.
71
+
72
+ Resume from compact pointers to commands or evidence, not copied transcripts.
73
+ Reconcile named sessions, revisions, PR state, watches, and deliveries before
74
+ creating or redelivering anything. Touch only this run; no global sweep, new
75
+ runtime database, or scheduler follows from the record.
76
+
77
+ ## Privacy
78
+
79
+ Record concise IDs, SHAs, URLs, status, timestamps, next actions, and evidence
80
+ references. Include no tokens, transcripts, full worker output, credentials,
81
+ private prompts, or machine-specific paths beyond the private record's own
82
+ resolved location. Publication of a sanitized summary needs separate
83
+ authority.
84
+
85
+ ## Compact template
86
+
87
+ ```text
88
+ Run: <UTCdate>-<slug>[-<collision suffix>]
89
+ Driver: <session ID> (sole writer)
90
+ Goal: <bounded task goal>
91
+ Scope: <repo + accepted bounds>
92
+ Authority: <who authorized which mutation>
93
+ Intent: <approved spec rev | small-change intent | adopted snapshot | peer/read-only mode>
94
+ Routing: <preset + source + snapshot ref>
95
+ Notification policy: <none | transport/target label/host/instructions path>
96
+ Source base: <exact revision or source identity>
97
+ IDs: <repo/project + workspace/agent receipt pointers>
98
+ Evidence: <check/review/submission/audit receipt pointers>
99
+ Pending: <launch/acceptance/external receipts + timer execution heartbeat actual ID + handshake + deadline>
100
+ Unresolved: <decision -> next owner + next action>
101
+ Resume: <commands or evidence refs bound to exact revisions>
102
+
103
+ | Task | Dependencies | Owner | State | Revision evidence | Next action |
104
+ | --- | --- | --- | --- | --- | --- |
105
+ | <task> | <task IDs or none> | <role + session ID + worktree, or receipt ref> | <pending/in progress/complete/blocked> | <SHA + check/receipt refs> | <action + owner> |
106
+
107
+ Status: <active/paused/held/complete/Archived>
108
+ Updated: <UTC timestamp>
109
+ ```
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: axstack-align
3
+ description: When exploring or planning engineering work, use axstack-align to settle scope, decisions, and its execution boundary.
4
+ ---
5
+
6
+ # Align
7
+
8
+ Leave the work with settled scope, explicit exclusions, and the proportional
9
+ identity its next phase requires. Stop before execution.
10
+
11
+ Load before acting:
12
+
13
+ - [Standing contracts](../axstack/references/contracts.md)
14
+
15
+ This preserves the required contracts -> lifecycle -> audit load edge.
16
+
17
+ ## Settle the frontier
18
+
19
+ 1. **Research and map dependencies.** Inspect the available code, docs, and
20
+ tools before asking the user. Separate facts from preferences, name evidence
21
+ gaps, and map which decisions unlock others. Unresolved research blocks only
22
+ its dependent branch while safe fact work and independent branches continue.
23
+ 2. **Prioritize the ready frontier.** Rank questions whose prerequisites are
24
+ settled by consequence, uncertainty, and the branches they unlock. Probe
25
+ vague terms, assumptions, success criteria, exclusions, failures, and edge
26
+ scenarios without using a fixed questionnaire or padding the interview. An
27
+ empty ready frontier means completion only when no material choice remains;
28
+ otherwise report the blocking research and continue safe fact work.
29
+ 3. **Ask a focused round.** Present one to three independent questions; present
30
+ one alone when it is complex or governs dependent branches. Number questions
31
+ cumulatively as `Q1`, `Q2`, and so on. Recommend a choice for each with a
32
+ short reason and trade-off, then wait for the user's answers and recompute
33
+ the frontier. The user owns preferences and decisions unless they explicitly
34
+ delegate them; agents research facts.
35
+ 4. **Preserve settled decisions.** Carry them across phases and resumes.
36
+ Reopen one only when material new evidence changes it; otherwise restate it
37
+ and proceed. Every reopened decision names the evidence that invalidated it.
38
+
39
+ ## Consult on consequential decisions
40
+
41
+ The current chat remains the driver under
42
+ [Standing contracts](../axstack/references/contracts.md). For each new
43
+ user round, the driver independently drafts the prioritized frontier and
44
+ recommendations. Then consult `axstack-advisor-astra` and
45
+ `axstack-advisor-fable` independently, without cross-reading, using the same
46
+ bounded evidence and question. Each adviser challenges assumptions, edges,
47
+ omissions, and alternatives; the driver synthesizes disagreements and accepts
48
+ or rejects each material point with a reason. Use one focused reply when
49
+ material disagreement remains, then surface the choices to the user. Never
50
+ fabricate consensus or impersonate a role.
51
+
52
+ Immediately before the first actual adviser dispatch, load and follow
53
+ [Orca runtime](../axstack/references/orca-runtime.md). Reuse each adviser
54
+ session and settled receipt; consult only the changed frontier and reuse
55
+ unchanged receipts. Record compact adviser evidence, the driver's assessment,
56
+ and user-resolved choices for `axstack-spec`. If either adviser is unavailable,
57
+ hold Align; safe fact work may continue without substitution.
58
+
59
+ ## Bound the interview
60
+
61
+ Twenty cumulative presented questions is the normal ceiling, not a target.
62
+ Follow-ups, reopened questions, and separate decisions bundled into one prompt
63
+ each count; never discount a presented question later. Before extending beyond
64
+ 20, name the material gaps and why they require more questions. Reserve the
65
+ remaining budget for the highest-value branches and never exceed 35 questions
66
+ in the initial pass. Stop earlier as soon as no unresolved material choice
67
+ remains; 20 is not a quota.
68
+
69
+ At completion or the 35-question cap, read back the result and ask whether the
70
+ user wants deeper refinement. Ask no further interview or refinement questions
71
+ without opt-in; this does not replace required spec approval or a clarification
72
+ prompt when a configured model is unavailable. An opted-in refinement names
73
+ one area and a separate finite budget of at most five questions; it preserves
74
+ the initial count and settled answers and cannot roll into another automatic
75
+ extension. Declining or silence does not settle an open blocker. If the user
76
+ stops early, return a partial handoff naming unresolved items and do not claim
77
+ readiness or begin execution.
78
+
79
+ ## Document settled understanding
80
+
81
+ Discover existing `CONTEXT-MAP.md`, `CONTEXT.md`, and ADR conventions once per
82
+ run and use the relevant context. If none exist, default to a glossary in
83
+ `CONTEXT.md` and ADRs under `docs/adr/`; create either only when useful. Within
84
+ authorized local planning docs, record canonical domain terms as answers settle
85
+ without putting implementation detail in the glossary, and keep observed facts
86
+ distinct from desired behavior. A still-open related architecture choice
87
+ remains explicitly unresolved.
88
+
89
+ Use an ADR only for a meaningful, hard-to-reverse, non-obvious trade-off. Keep
90
+ it Proposed until the applicable approval, and preserve accepted history by
91
+ superseding rather than rewriting it. Routine decisions belong in the run
92
+ record or spec. Read-only scope keeps proposed documentation in the permitted
93
+ private record or response. Documentation is neither implementation nor spec
94
+ approval; record chosen document names and paths once per run.
95
+
96
+ ## Read back, classify, and stop
97
+
98
+ 1. Read back the decisions, constraints, exclusions, and remaining evidence
99
+ gaps. For substantial work, this summary becomes part of the draft spec in
100
+ `axstack-spec`; spec approval is the one human checkpoint. Included and
101
+ excluded work must be distinguishable, and no open item may appear settled.
102
+ 2. Classify the result with the shared
103
+ [proportional scope identity](../axstack/references/routing.md#proportional-scope-identity):
104
+ - For work clarified as small, return a **small-change intent** handoff with
105
+ its acceptance checks and exclusions.
106
+ - For substantial work, proceed through `axstack-spec` and then
107
+ `axstack-tickets`; return an approved spec identity and a matching
108
+ ticket map handoff. Never repeat a still-valid approval.
109
+ 3. Record substantive or resumable preparation through the
110
+ [shared lifecycle](../axstack/references/lifecycle.md) and
111
+ [run record](../axstack/references/run-record.md). Persist the question count,
112
+ settled, open, and deferred branches, compact round adviser receipts, and
113
+ documentation pointers without adding another runtime. Return the compact
114
+ scope and record pointer in the current chat. Native transfer is separate:
115
+ use it only when the user explicitly requests transfer, loading
116
+ [Orca runtime](../axstack/references/orca-runtime.md) immediately before
117
+ actual dispatch. Alignment completion never dispatches a recipient.
118
+
119
+ Alignment stops for both sizes only when the handoff is usable, its next scope
120
+ identity is explicit, and execution has not started. The user invokes `axstack`
121
+ to execute.