@open-agent-toolkit/cli 0.2.28 → 0.2.30

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/assets/bundle-metadata.json +4 -0
  2. package/assets/docs/cli-utilities/configuration.md +11 -1
  3. package/assets/docs/workflows/projects/artifacts.md +5 -0
  4. package/assets/docs/workflows/projects/autonomy.md +25 -0
  5. package/assets/docs/workflows/projects/index.md +1 -0
  6. package/assets/docs/workflows/projects/lifecycle.md +23 -0
  7. package/assets/docs/workflows/projects/retro.md +261 -0
  8. package/assets/docs/workflows/skills/index.md +6 -0
  9. package/assets/public-package-versions.json +4 -4
  10. package/assets/skills/oat-project-autonomous/SKILL.md +17 -1
  11. package/assets/skills/oat-project-autonomous/references/gate-inventory.md +41 -41
  12. package/assets/skills/oat-project-complete/SKILL.md +42 -6
  13. package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +41 -41
  14. package/assets/skills/oat-project-implement/SKILL.md +1 -1
  15. package/assets/skills/oat-project-implement/references/completion-and-closeout.md +20 -6
  16. package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +41 -41
  17. package/assets/skills/oat-project-import-plan/SKILL.md +7 -3
  18. package/assets/skills/oat-project-plan/SKILL.md +6 -3
  19. package/assets/skills/oat-project-plan-writing/SKILL.md +32 -5
  20. package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +41 -41
  21. package/assets/skills/oat-project-quick-start/SKILL.md +7 -3
  22. package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +41 -41
  23. package/assets/skills/oat-project-retro/SKILL.md +310 -0
  24. package/assets/skills/oat-project-retro/references/apply-procedure.md +212 -0
  25. package/assets/skills/oat-project-retro/references/evidence-and-lanes.md +91 -0
  26. package/assets/skills/oat-project-retro/references/retro-quality-bar.md +100 -0
  27. package/assets/skills/oat-project-retro-file/SKILL.md +387 -0
  28. package/assets/templates/project-retro.md +236 -0
  29. package/dist/commands/config/index.d.ts.map +1 -1
  30. package/dist/commands/config/index.js +81 -0
  31. package/dist/commands/init/tools/shared/skill-manifest.d.ts +2 -2
  32. package/dist/commands/init/tools/shared/skill-manifest.d.ts.map +1 -1
  33. package/dist/commands/init/tools/shared/skill-manifest.js +3 -0
  34. package/dist/config/oat-config.d.ts +12 -1
  35. package/dist/config/oat-config.d.ts.map +1 -1
  36. package/dist/config/oat-config.js +38 -2
  37. package/dist/config/resolve.d.ts.map +1 -1
  38. package/dist/config/resolve.js +8 -0
  39. package/dist/fs/assets.d.ts +1 -0
  40. package/dist/fs/assets.d.ts.map +1 -1
  41. package/dist/fs/assets.js +36 -1
  42. package/dist/release/public-package-contract.d.ts.map +1 -1
  43. package/dist/release/public-package-contract.js +1 -0
  44. package/package.json +2 -2
@@ -0,0 +1,310 @@
1
+ ---
2
+ name: oat-project-retro
3
+ version: 1.0.2
4
+ description: Use when the user requests or confirms a project retrospective — e.g. "run the project retro", "write project-retro.md", "retrospective this project", or confirms a previously offered retro. Do NOT auto-invoke merely because implementation or summary completed. Produces references/project-retro.md from project logs, execution learnings, and session/transcript evidence, with repo improvements and OAT upstream feedback.
5
+ disable-model-invocation: false
6
+ user-invocable: true
7
+ allowed-tools: Read, Write, Bash(git:*), Bash(pnpm:*), Bash(oat config:*), Bash(oat decision:*), Bash(oat project log:*), Bash(oat tools:*), Glob, Grep, AskUserQuestion
8
+ ---
9
+
10
+ # Project Retrospective
11
+
12
+ Generate an evidence-grounded project retrospective or apply approved
13
+ repo-improvement items from an existing retrospective.
14
+
15
+ ## Mode Resolution
16
+
17
+ Resolve exactly one mode before reading evidence:
18
+
19
+ - **Generate:** an explicit retro/retrospective request, a configured
20
+ post-approval `retro` sequence step, or confirmation of a retro offer.
21
+ - **Apply:** an explicit apply flag or wording such as "apply the retro
22
+ findings." Apply mode requires an existing artifact and never regenerates it.
23
+ - Explicit flags or wording beat inference. If the request remains ambiguous,
24
+ ask once.
25
+
26
+ Do not auto-invoke merely because implementation, summary, or completion work
27
+ finished. A configured sequence step or direct confirmation is explicit
28
+ consent to generate.
29
+
30
+ For apply mode, follow
31
+ [references/apply-procedure.md](references/apply-procedure.md) and skip the
32
+ generation process below.
33
+
34
+ Apply mode treats a docs item as an append-only project-log correction only
35
+ when its safe normalized target canonical path has the exact final path
36
+ component `project-log.md`; use `oat project log append` and never directly edit
37
+ the log.
38
+ Fail closed on absolute, traversing, or otherwise ambiguous targets. The
39
+ proposal must identify the prior heading or event being corrected and preserve
40
+ the original entry. Follow the reference's judgment flags, stable correction
41
+ identity, correction-commit, and later retro-writeback transitions. Perform
42
+ semantic post-side-effect recovery before appending again. Record `Applied-ref`
43
+ only after the correction and retro writeback are durably committed.
44
+
45
+ ## Progress Indicators
46
+
47
+ Print one banner and concise step indicators:
48
+
49
+ ```text
50
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
51
+ OAT ▸ PROJECT RETRO
52
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
53
+ ```
54
+
55
+ Use `[1/6] Resolving project and mode…` through `[6/6] Formatting and
56
+ committing…`. Name evidence inventory, synthesis, disposition, and project-log
57
+ steps as they begin.
58
+
59
+ ## Artifact Hygiene
60
+
61
+ Before finishing or committing, format every created or edited file with the
62
+ repository's documented write/fix formatter, preferably file-scoped. Run the
63
+ checks relevant to those files after formatting. Never leave a partial retro:
64
+ complete it fully or delete the newly created partial file.
65
+
66
+ ## Generate Process
67
+
68
+ ### Step 1: Resolve the Active Project
69
+
70
+ Use an explicit project path when supplied. Otherwise resolve:
71
+
72
+ ```bash
73
+ PROJECT_PATH=$(oat config get activeProject 2>/dev/null || true)
74
+ ```
75
+
76
+ If it is absent or invalid, ask for the project and resolve it beneath the
77
+ configured projects root. Derive `PROJECT_NAME` from the directory name.
78
+ Confirm the target before expensive transcript retrieval.
79
+
80
+ The output is always:
81
+
82
+ ```text
83
+ {PROJECT_PATH}/references/project-retro.md
84
+ ```
85
+
86
+ ### Step 2: Inventory Evidence Honestly
87
+
88
+ Follow the reading order and environment detection in
89
+ [references/evidence-and-lanes.md](references/evidence-and-lanes.md).
90
+
91
+ Create an inventory before synthesis. Record every source in
92
+ `oat_retro_evidence_sources` with `status: used | unavailable`; name unavailable
93
+ sources in `## Evidence and Review Method`. Do not invent session-only claims.
94
+ When an evidence family is partial, split it into truthful source entries, for
95
+ example `archived-review-markdown: unavailable` and `gate-receipts: used`
96
+ instead of `review-artifacts: unavailable`. Do not add a `partial` evidence
97
+ status. Derivative current-run reconnaissance transcripts are not original
98
+ project-run evidence.
99
+
100
+ Use optional bounded, read-only reconnaissance lanes only when project size
101
+ justifies them. Root synthesis remains with the invoking agent.
102
+
103
+ ### Step 3: Render the Artifact
104
+
105
+ Copy `.oat/templates/project-retro.md` to the output path and render it against
106
+ [references/retro-quality-bar.md](references/retro-quality-bar.md).
107
+
108
+ Keep output concise by default. Every section must add distinct information.
109
+ Prefer references to evidence over repeated chronology. For a small project,
110
+ keep core sections brief. Use subsections and tables only for evidence-rich
111
+ projects where they improve decisions. This evidence-scaled depth adds no new
112
+ consent-bearing config surface.
113
+
114
+ Each material incident must stand alone: a reader can understand it without
115
+ opening another artifact. Use stable evidence anchors such as project-log event
116
+ IDs, artifact headings, review paths, decision IDs, and commit IDs. Anchors
117
+ supplement but never replace explanation.
118
+
119
+ Give each narrative section one job:
120
+
121
+ - `Challenges and Struggles` owns the complete incident narrative: what
122
+ happened, impact, response, and result.
123
+ - `Where We Changed Course` records only the trigger, changed direction, and
124
+ outcome.
125
+ - `Domain Learnings` abstracts reusable lessons without replaying chronology.
126
+ - `Gotchas for Humans` and `Gotchas for Autonomous Agents` contain
127
+ future-facing instructions rather than incident summaries.
128
+
129
+ Required contracts:
130
+
131
+ 1. Keep all core sections and only evidence-supported conditional sections.
132
+ 2. Render `## Current State` from register fields and frontmatter rollups. This
133
+ is the only freeform live-status surface that apply/file writeback refreshes.
134
+ 3. Phrase status elsewhere as generation-time evidence, not as live status.
135
+ 4. Separate the Repo Improvements and OAT Upstream Feedback lanes.
136
+ 5. Use stable `RP-NN` and `UP-NN` item IDs.
137
+ 6. Give every RP item a `Type`, authoritative `Disposition: apply | file`, and
138
+ fields/status matching that disposition.
139
+ 7. Give every register item a mutable `Disposition-note` initialized to `—`.
140
+ 8. Start every actionable item at `Status: proposed`.
141
+ 9. Keep the upstream section and its explicit empty-state line when no item is
142
+ warranted.
143
+ 10. Derive `oat_retro_promotions` from RP apply-items and `oat_retro_filing`
144
+ from UP items plus RP file-items.
145
+
146
+ Narrative outside `## Current State` is immutable historical analysis after
147
+ generation. It may describe an item's generation-time status when explicitly
148
+ qualified, but it must not claim a register item "remains" or "is currently"
149
+ in a mutable state. Proposal bodies remain immutable.
150
+
151
+ Before the artifact can be considered complete:
152
+
153
+ - set `oat_retro_project` to the non-null project slug;
154
+ - set `oat_retro_generated` to a non-null UTC generation timestamp in
155
+ `YYYY-MM-DDTHH:MM:SSZ` form;
156
+ - reject all unreplaced scaffold item examples and placeholders, including
157
+ example `RP-01`/`RP-02`/`UP-01` headings, brace-delimited instructional text,
158
+ and template-only empty item blocks;
159
+ - set `oat_generated: true` and `oat_template: false`; and
160
+ - remove `oat_template_name` entirely.
161
+
162
+ A rendered artifact must never retain scaffold-only template markers or null
163
+ provenance.
164
+
165
+ ### Step 4: Resolve Post-Generation Consent
166
+
167
+ Read effective `workflow.retro.apply` and `workflow.retro.filing` configuration.
168
+
169
+ **Interactive run:**
170
+
171
+ 1. Present the generated register summary.
172
+ 2. Ask whether to apply eligible RP apply-items now.
173
+ 3. If unfiled UP or RP file-items exist, offer the `oat-project-retro-file`
174
+ skill.
175
+
176
+ **Non-interactive run:**
177
+
178
+ - Apply only when `workflow.retro.apply` is `auto`.
179
+ - `ask` or absent means propose-only.
180
+ - Chain to `oat-project-retro-file` only when at least one
181
+ `workflow.retro.filing` destination is explicitly configured.
182
+ - Without filing config, file nothing and report that proposals remain.
183
+
184
+ All applications follow the apply procedure. Filing remains owned by
185
+ `oat-project-retro-file`; generate/apply mode does not file tracker items.
186
+
187
+ ### Step 5: Record the Run
188
+
189
+ Append a structural project-log entry with `oat project log append` when the
190
+ project log exists. Never hand-edit the project log. Use this exact one-line
191
+ receipt shape, with every key present exactly once:
192
+
193
+ ```text
194
+ retro artifact=<path> evidence_used=<csv> evidence_unavailable=<csv> promotions=<number> upstream=<number> apply=<performed|declined|skipped|deferred> filing=<performed|declined|skipped|deferred>
195
+ ```
196
+
197
+ `artifact` is the repo-relative retro path. `evidence_used` and
198
+ `evidence_unavailable` are deterministic source lists. Source identifiers are
199
+ deduplicated, sorted in bytewise ascending order, and serialized as
200
+ comma-separated values with no spaces; an empty list is `none`. Reject an
201
+ identifier unless it matches `[a-z0-9][a-z0-9._:-]*`; this excludes commas and
202
+ whitespace. `promotions` is the RP register count and `upstream` is the UP
203
+ register count. `apply` is the apply action outcome and `filing` is the filing
204
+ action outcome. Counts describe artifact contents; outcomes describe actions.
205
+ Never reuse a count key for an outcome or encode a count in `filing`.
206
+
207
+ Capture one immutable pre-action eligibility snapshot for each action after the
208
+ registers are rendered and before any apply consent decision or filing
209
+ dispatch. The apply snapshot contains the stable IDs of unsettled RP
210
+ `Disposition: apply` items. The filing snapshot contains the stable IDs and
211
+ lanes of unsettled UP items plus RP `Disposition: file` items. Never recompute
212
+ initial eligibility from post-action register state.
213
+
214
+ For each snapshot, record:
215
+
216
+ - `INITIAL_ELIGIBLE`: the number of members in that pre-action snapshot;
217
+ - `DECISION`: `not-applicable | declined | deferred | entered`;
218
+ - `COMPLETION`: `not-started | normal | failed`; and
219
+ - `REMAINING_INITIAL`: how many members of that same snapshot remain unsettled
220
+ after the action. Ignore newly created eligible work until the next run.
221
+
222
+ Validate `0 <= REMAINING_INITIAL <= INITIAL_ELIGIBLE`, then derive the outcome
223
+ with this total precedence function:
224
+
225
+ ```text
226
+ if INITIAL_ELIGIBLE == 0 => skipped
227
+ else if DECISION == declined => declined
228
+ else if DECISION != entered => deferred
229
+ else if COMPLETION != normal => deferred
230
+ else if REMAINING_INITIAL > 0 => deferred
231
+ else => performed
232
+ ```
233
+
234
+ This samples initial eligibility exactly once. A successful action that settles
235
+ every snapshot member is `performed`, never `skipped` because the post-action
236
+ set became empty. Exact recovered no-ops count as normal completion when they
237
+ settle the snapshot member. Item-level rejection is settled work; action-level
238
+ rejection before entry is `declined`.
239
+
240
+ For filing, use one lane-tagged union snapshot and one outcome. If any initially
241
+ eligible repo or upstream lane remains unsettled because its destination is
242
+ absent or configured `none`, the mixed action is `deferred` even when another
243
+ lane completed normally. It is `performed` only when normal completion settles
244
+ all initially eligible lanes.
245
+
246
+ | Scenario | Initial eligible | Decision | Completion | Remaining initial | Outcome |
247
+ | ------------------------------------- | ---------------- | -------------- | ----------- | ----------------- | --------- |
248
+ | Initially empty | 0 | not-applicable | not-started | 0 | skipped |
249
+ | Interactive action rejection | 2 | declined | not-started | 2 | declined |
250
+ | Absent non-interactive consent | 2 | deferred | not-started | 2 | deferred |
251
+ | Configured apply deferral | 2 | deferred | not-started | 2 | deferred |
252
+ | Action failure | 2 | entered | failed | 1 | deferred |
253
+ | Normal completion with remaining work | 2 | entered | normal | 1 | deferred |
254
+ | All settled successfully | 2 | entered | normal | 0 | performed |
255
+ | Mixed filing lanes partly deferred | 3 | entered | normal | 1 | deferred |
256
+ | Mixed filing lanes all settled | 3 | entered | normal | 0 | performed |
257
+
258
+ Build the one-line body in `RECEIPT_BODY`, then use this complete invocation.
259
+ The producer and ref are stable literals:
260
+
261
+ ```bash
262
+ oat project log append --project "$PROJECT_PATH" --structural \
263
+ --producer oat-project-retro \
264
+ --ref project-retro \
265
+ --body "$RECEIPT_BODY"
266
+ ```
267
+
268
+ Do not append if body validation fails. After the command succeeds, verify the
269
+ generated structural heading uses producer `oat-project-retro` and ref
270
+ `project-retro`, and verify the appended body exactly equals `RECEIPT_BODY`.
271
+
272
+ ### Step 6: Format, Verify, and Commit
273
+
274
+ Format the retro, any approved promotion targets, and any decision records.
275
+ Verify:
276
+
277
+ - required core sections exist;
278
+ - evidence availability is explicit;
279
+ - every RP item has a valid disposition and matching fields/status;
280
+ - every register item has a `Disposition-note`;
281
+ - rollups are derivable from register fields;
282
+ - `Current State` is derived from register fields and frontmatter rollups and
283
+ contains no contradictory status claim;
284
+ - `oat_retro_project` is a non-null project slug;
285
+ - `oat_retro_generated` is a valid UTC generation timestamp;
286
+ - no unreplaced scaffold item examples, placeholders, or brace-delimited
287
+ instructions remain;
288
+ - rendered template metadata is retired; and
289
+ - final verification confirms the structural receipt has all required keys
290
+ exactly once, both register counts are numeric, and count keys are never
291
+ reused for action outcomes; and
292
+ - no unrelated implementation file changed.
293
+
294
+ Commit the artifact, project-log append, and any approved apply outputs. Use
295
+ one reviewed batch when items are tightly coupled; otherwise use one commit per
296
+ item as described in the apply procedure. Never stage unrelated changes.
297
+
298
+ ## Success Criteria
299
+
300
+ - The resolved mode matches explicit user/config intent.
301
+ - `references/project-retro.md` is complete, evidence-grounded, and not marked
302
+ as a template.
303
+ - Missing evidence is named; hypotheses remain hypotheses.
304
+ - Both feedback lanes are explicit and machine-scannable.
305
+ - Register statuses and frontmatter rollups agree.
306
+ - `Current State` agrees with the registers and rollups; immutable historical
307
+ narrative does not masquerade as live status.
308
+ - No promotion is applied or item filed without interactive approval or
309
+ explicit non-interactive configuration.
310
+ - The project log and commit preserve the outcome without unrelated changes.
@@ -0,0 +1,212 @@
1
+ # Retro Promotion Apply Procedure
2
+
3
+ Use this procedure only for `RP-NN` items whose authoritative field is
4
+ `Disposition: apply`. Never mutate RP file-items or any UP item; those belong
5
+ to `oat-project-retro-file`.
6
+
7
+ ## Classification and Routing
8
+
9
+ | Type | Default disposition | Apply behavior |
10
+ | -------------------- | ------------------- | ----------------------------------------------------- |
11
+ | `docs` | `apply` | Edit canonical repository documentation |
12
+ | `agents-instruction` | `apply` | Edit the narrowest existing agent instruction surface |
13
+ | `rule` | `apply` | Edit the canonical scoped rule |
14
+ | `decision` | `apply` | Create a durable record with `oat decision new` |
15
+ | `code-follow-up` | `file` | Leave for the filing skill |
16
+
17
+ `Disposition` is authoritative when it differs from the default. Apply mode
18
+ processes only apply-items with `Status: proposed | approved`. It skips
19
+ `applied` and `rejected` items, so interrupted or repeated runs resume
20
+ idempotently.
21
+
22
+ ## Consent
23
+
24
+ - Interactive runs present each proposed item, target, rationale, and concrete
25
+ edit. Apply only approved items.
26
+ - Non-interactive runs apply only when `workflow.retro.apply: auto`.
27
+ - A configured `auto` value authorizes the bounded register changes, not
28
+ architecture, security, product-scope, credential, or destructive changes.
29
+ Stop for explicit direction at those boundaries.
30
+
31
+ When approval occurs before editing, set `Status: approved`. If execution
32
+ continues immediately, this can be written back together with the final
33
+ `applied` state.
34
+
35
+ ## Application by Type
36
+
37
+ 1. **Docs:** update the canonical existing page. Avoid duplicate documents.
38
+ Route a docs item to the append-only correction special case only when its
39
+ target canonical path passes this matcher:
40
+ 1. Parse the `Target` field value, removing at most one matching pair of
41
+ Markdown backticks.
42
+ 2. Reject an empty value, NUL, an absolute POSIX path, a Windows drive or UNC
43
+ path, a trailing separator, or any unresolved `..` segment.
44
+ 3. Convert `\` separators to `/`, remove leading `./`, remove interior `.`
45
+ segments, and collapse repeated separators.
46
+ 4. Route only when the normalized target's exact, case-sensitive final path
47
+ component is `project-log.md`. A lookalike is an ordinary docs target,
48
+ not a correction. Any ambiguous normalization stops with no write.
49
+
50
+ | Scenario | Target | Disposition |
51
+ | ------------------- | ------------------------------------------ | ------------- |
52
+ | Repo-relative POSIX | `.oat/projects/shared/demo/project-log.md` | route |
53
+ | Windows separators | `.oat\projects\shared\demo\project-log.md` | route |
54
+ | Exact basename | `project-log.md` | route |
55
+ | Lookalike suffix | `project-log.md.bak` | ordinary-docs |
56
+ | Prefixed basename | `my-project-log.md` | ordinary-docs |
57
+ | Nested child | `project-log.md/child` | ordinary-docs |
58
+ | Ambiguous traversal | `.oat/projects/../demo/project-log.md` | stop |
59
+ | Absolute path | `/tmp/project-log.md` | stop |
60
+
61
+ For a routed item:
62
+ - Use `oat project log append`; never directly edit `project-log.md`.
63
+ - Require the immutable proposal body to identify the prior heading or
64
+ event being corrected, preserve the original entry, and supply a stable
65
+ `ORIGINAL_ENTRY_ANCHOR`. Set `RP_ID` to the item's stable `RP-NN` ID.
66
+ - Construct `CORRECTION_BODY` with the exact stable identity first line
67
+ `Retro correction id=$RP_ID original=$ORIGINAL_ENTRY_ANCHOR`, followed by
68
+ the immutable correction text. The ID, anchor, and correction text must
69
+ match exactly during recovery.
70
+ - Perform semantic post-side-effect recovery before appending: search the
71
+ project log and Git state for the exact identity first line. Zero matches
72
+ permits one append. Exactly one match permits recovery only when the
73
+ original-entry anchor and full correction body are semantically exact; do
74
+ not append again. Multiple, partial, or divergent matches stop for
75
+ direction without appending.
76
+ - Only when recovery finds zero matches, run the complete judgment append
77
+ invocation exactly once:
78
+
79
+ ```bash
80
+ oat project log append --project "$PROJECT_PATH" \
81
+ --type feedback \
82
+ --scope project \
83
+ --area "retro correction $RP_ID" \
84
+ --body "$CORRECTION_BODY"
85
+ ```
86
+
87
+ - Commit the project-log append without retro writeback. Verify the commit
88
+ contains the normalized project-log path and exact correction body.
89
+ Capture its full 40-character SHA and exact generated heading.
90
+ - In a later retro-only writeback commit, set the RP status and
91
+ `Applied-ref`. The reference names the full 40-character correction commit
92
+ plus the exact generated heading, serialized as
93
+ `<40-character-sha> :: <exact-generated-heading>`. Consider `Applied-ref`
94
+ recorded only after that writeback commit succeeds; at that point the
95
+ correction and retro writeback are durably committed.
96
+
97
+ The transition table is authoritative:
98
+
99
+ | Scenario | Starting state | Required transition |
100
+ | ------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
101
+ | Fresh | No exact correction | Append once; commit project log; write back retro in a later commit |
102
+ | Uncommitted append | One exact uncommitted correction | Do not append; commit the recovered project-log mutation; then write back |
103
+ | Committed append | One exact committed correction and RP not applied | Do not append; verify full commit, path, and body; then write back |
104
+ | Append failure | Command fails | No correction commit or writeback; retain prior RP status |
105
+ | Correction commit failure | Append exists but commit fails | No writeback; retain prior RP status; recover exact append on retry |
106
+ | Writeback commit failure | Correction commit succeeds but retro commit fails | Preserve correction commit; restore non-applied artifact; retry writeback from recovered receipt |
107
+ | Ambiguous recovery | Multiple or divergent matches | Stop with no append, commit, or writeback |
108
+
109
+ This special case is limited to normalized `project-log.md` targets and does
110
+ not add or change the public RP type vocabulary. All other docs items
111
+ continue to update the canonical existing page under the normal docs apply
112
+ contract.
113
+
114
+ 2. **Agent instruction:** choose the narrowest existing applicable
115
+ `AGENTS.md`, skill, or provider-neutral instruction. Do not create nested
116
+ instruction files solely for discoverability.
117
+ 3. **Rule:** update the canonical rule whose scope matches the finding. Preserve
118
+ provider-neutral guidance and existing precedence.
119
+ 4. **Decision:** ensure the decision scaffold exists, then run:
120
+
121
+ ```bash
122
+ oat decision new "<title>" --status accepted --context "<context>" --decision "<decision>" --consequences "<consequences>"
123
+ ```
124
+
125
+ Before creating it, compute the slug with the CLI's lowercase,
126
+ ASCII-folded, hyphen-collapsed, 30-character whole-word rule (including
127
+ trailing stop-word trimming). Perform a **date-independent exact-slug**
128
+ lookup for `DR-<6 digits>-<slug>.md`; never use a loose suffix glob.
129
+
130
+ Use the granted `Glob` tool, rooted at the repository, with this pattern
131
+ after substituting the computed slug:
132
+
133
+ ```text
134
+ .oat/repo/reference/decisions/DR-??????-<slug>.md
135
+ ```
136
+
137
+ The six `?` characters anchor the date segment to exactly six characters,
138
+ and the remaining slug must match exactly. Handle the returned paths
139
+ deterministically:
140
+ - **Zero matches:** create the record with `oat decision new`, capture its
141
+ reported ID/path, and verify it represents the current proposal before
142
+ writeback.
143
+ - **Exactly one match:** read it and verify its normalized title, context,
144
+ decision, and consequences represent the current proposal. On a match,
145
+ treat this as interrupted post-side-effect recovery: do not create a
146
+ duplicate, and recover `Applied-ref` from that record's ID/path. On a
147
+ proposal mismatch, stop for direction and perform no write.
148
+ - **Multiple matches:** stop with an ambiguity error and perform no write;
149
+ never choose a record by date, ordering, or convenience.
150
+
151
+ Use only the generated or verified record and managed index. Never
152
+ hand-author a decision ID or edit the managed index.
153
+
154
+ 5. **Code follow-up:** do not implement it here, even when technically small.
155
+ A code follow-up defaults to `Disposition: file`.
156
+
157
+ ## Per-Item Writeback
158
+
159
+ After a successful application:
160
+
161
+ - set `Status: applied`;
162
+ - set `Applied-ref` to the resulting commit/path reference; and
163
+ - clear `Disposition-note` to `—`; and
164
+ - recompute `oat_retro_promotions` from all RP apply-items; and
165
+ - refresh the bounded `## Current State` contents from register fields and
166
+ frontmatter rollups.
167
+
168
+ On explicit rejection, set `Status: rejected` and write the reason to the
169
+ mutable `Disposition-note` field. On transient failure, leave
170
+ `Status: proposed` (or `approved` when approval remains valid), record bounded
171
+ execution context in `Disposition-note`, report the failure, and continue only
172
+ when safe.
173
+
174
+ Apply mode may mutate only `Status`, `Applied-ref`, `Disposition-note`, and the
175
+ promotions rollup inside the artifact, plus the contents of `## Current State`.
176
+ It must not alter file-items, UP items, `oat_retro_filing`, item IDs,
177
+ dispositions, proposal bodies, or any other narrative. Refresh `Current State`
178
+ without rewriting proposal bodies. Proposal bodies are stable and immutable
179
+ after generation.
180
+
181
+ Compute `oat_retro_promotions` exactly:
182
+
183
+ - `none` when no apply items exist;
184
+ - `proposed` when apply items exist and none are settled;
185
+ - `partial` for a mix of settled and unsettled apply items; and
186
+ - `complete` when all apply items are settled.
187
+
188
+ `proposed` and `approved` are unsettled; `applied` and `rejected` are settled.
189
+
190
+ ## Commit and Resume Strategy
191
+
192
+ - Use one commit per item when targets are independent, review boundaries
193
+ differ, or one item may fail without invalidating the rest.
194
+ - Use one reviewed batch when the items are inseparable edits to the same
195
+ canonical surface.
196
+ - Include the target edit and its artifact status writeback in the same commit
197
+ whenever possible. The project-log correction route is the explicit
198
+ exception: its correction commit must precede the later retro-only writeback
199
+ commit so `Applied-ref` can name an already durable correction.
200
+ - Before each commit, format touched files, run surface-relevant checks, and
201
+ verify the item still has the expected pre-apply status.
202
+ - On re-run, rescan the artifact and process only remaining
203
+ `proposed | approved` apply-items. Never repeat an `applied` item.
204
+
205
+ For **every apply type**, perform post-side-effect recovery before repeating an
206
+ eligible item: inspect the declared target for the exact proposed semantic
207
+ change, verify the existing result represents the current proposal, and
208
+ recover `Applied-ref` when it does. This includes docs, agent-instruction,
209
+ rule, and decision items. A matching side effect plus missing writeback is an
210
+ interrupted success, not permission to apply twice. A partial, divergent, or
211
+ unverifiable target requires direction; never overwrite or claim it
212
+ automatically.
@@ -0,0 +1,91 @@
1
+ # Retro Evidence and Reconnaissance
2
+
3
+ ## Required Reading Order
4
+
5
+ Inventory and read available evidence in this order:
6
+
7
+ 1. `project-log.md` — always check first; use its append-only entries as
8
+ workflow evidence.
9
+ 2. `oat-execution-learnings.md` — when present, extract observations, impact,
10
+ and recommendations without treating them as already proven.
11
+ 3. Lifecycle artifacts — at minimum `implementation.md`, `state.md`, and
12
+ `plan.md`; also read load-bearing `discovery.md`, `design.md`, `spec.md`,
13
+ reviews, references, and evidence ledgers when present.
14
+ 4. Session/run evidence — use the environment-appropriate route below.
15
+
16
+ Implementation outcomes and committed evidence outrank planned behavior.
17
+ Record each source as `used` or `unavailable` in retro frontmatter.
18
+ When an evidence family is partial, split it into truthful source entries, for
19
+ example `archived-review-markdown: unavailable` and `gate-receipts: used`
20
+ instead of `review-artifacts: unavailable`. Do not add a `partial` evidence
21
+ status. Derivative current-run reconnaissance transcripts are not original
22
+ project-run evidence.
23
+
24
+ Return and preserve stable evidence anchors for load-bearing claims: prefer
25
+ project-log event IDs, artifact headings, review paths, decision IDs, and
26
+ commit IDs over line numbers. Anchors supplement but never replace explanation;
27
+ the rendered incident narrative must remain understandable without opening the
28
+ referenced source.
29
+
30
+ ## Environment Detection
31
+
32
+ ### Cloud tooling available
33
+
34
+ Use the host's cloud run-info, events, and transcript/detail tooling. Fetch
35
+ relevant first-class child runs when their identifiers matter. Prefer bounded
36
+ reconnaissance over loading a giant transcript into root context.
37
+
38
+ ### Local transcript access
39
+
40
+ Use the current host's local agent session transcript/history. Keep the search
41
+ bound to the current project/run and avoid quoting secrets or irrelevant user
42
+ history.
43
+
44
+ ### No session access
45
+
46
+ State that session evidence is unavailable and continue from durable
47
+ artifacts. Do not infer tool output, operator corrections, or chronology that
48
+ exists only in a missing transcript.
49
+
50
+ ## Transcript Caveat
51
+
52
+ Cloud or local transcript exports may omit terminal tool-result bodies. When
53
+ they do, committed ledgers, reviews, implementation notes, and project-log
54
+ entries are authoritative for runtime detail. A command mention is not proof
55
+ of its result. Mark an unresolved mechanism as inconclusive.
56
+
57
+ ## Reconnaissance Lanes
58
+
59
+ Recon lanes are optional and read-only. Scale them to evidence volume:
60
+
61
+ - **Small project:** root reads evidence directly; no dispatch required.
62
+ - **Medium project:** two or three lanes, usually durable artifacts,
63
+ transcript chronology, and dual-feedback classification.
64
+ - **Large or long-running project:** add focused lanes for implementation
65
+ decisions, orchestration/liveness, failure taxonomy, and durable-guidance
66
+ gaps.
67
+
68
+ Every lane returns compact conclusions with stable evidence anchors, uncertainty
69
+ labels, repo-improvement candidates, and OAT-upstream candidates. Lanes do not
70
+ write the retro or apply changes. Root synthesis verifies each load-bearing
71
+ anchor against committed artifacts before preserving it in the retro.
72
+
73
+ Minimum conceptual coverage, whether dispatched or performed directly:
74
+
75
+ 1. durable project outcomes and decisions;
76
+ 2. session chronology and operator corrections when available; and
77
+ 3. explicit classification into repo feedback versus OAT upstream feedback.
78
+
79
+ ## Evidence Labels
80
+
81
+ Use these labels consistently in synthesis:
82
+
83
+ - **Confirmed:** directly supported by durable evidence or matching independent
84
+ sources.
85
+ - **Hypothesis:** plausible mechanism with incomplete proof; name what would
86
+ confirm it.
87
+ - **Inconclusive:** evidence rules out some explanations but cannot establish
88
+ the mechanism.
89
+
90
+ Prefer classification over blame. Do not convert a later successful run into
91
+ proof of an earlier failure's cause.