dorfl 0.1.2 → 0.2.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.
- package/dist/advance-drivers.d.ts +1 -1
- package/dist/advance-drivers.d.ts.map +1 -1
- package/dist/advance-drivers.js +15 -3
- package/dist/advance-drivers.js.map +1 -1
- package/dist/advance-lifecycle-template.d.ts.map +1 -1
- package/dist/advance-lifecycle-template.js +76 -4
- package/dist/advance-lifecycle-template.js.map +1 -1
- package/dist/advance-treeless-publish.d.ts +23 -0
- package/dist/advance-treeless-publish.d.ts.map +1 -1
- package/dist/advance-treeless-publish.js +41 -0
- package/dist/advance-treeless-publish.js.map +1 -1
- package/dist/advance.d.ts +59 -7
- package/dist/advance.d.ts.map +1 -1
- package/dist/advance.js +389 -82
- package/dist/advance.js.map +1 -1
- package/dist/advancing-lock.d.ts +30 -2
- package/dist/advancing-lock.d.ts.map +1 -1
- package/dist/advancing-lock.js +50 -0
- package/dist/advancing-lock.js.map +1 -1
- package/dist/agent-launch.d.ts +12 -0
- package/dist/agent-launch.d.ts.map +1 -1
- package/dist/agent-launch.js +22 -12
- package/dist/agent-launch.js.map +1 -1
- package/dist/agent-stop.d.ts +40 -2
- package/dist/agent-stop.d.ts.map +1 -1
- package/dist/agent-stop.js +30 -2
- package/dist/agent-stop.js.map +1 -1
- package/dist/apply-decide.d.ts +17 -3
- package/dist/apply-decide.d.ts.map +1 -1
- package/dist/apply-decide.js +36 -7
- package/dist/apply-decide.js.map +1 -1
- package/dist/apply-merge-action.d.ts +17 -5
- package/dist/apply-merge-action.d.ts.map +1 -1
- package/dist/apply-merge-action.js +43 -8
- package/dist/apply-merge-action.js.map +1 -1
- package/dist/apply-persist.d.ts +57 -26
- package/dist/apply-persist.d.ts.map +1 -1
- package/dist/apply-persist.js +166 -37
- package/dist/apply-persist.js.map +1 -1
- package/dist/apply-stuck-action.d.ts +151 -0
- package/dist/apply-stuck-action.d.ts.map +1 -0
- package/dist/apply-stuck-action.js +125 -0
- package/dist/apply-stuck-action.js.map +1 -0
- package/dist/brand.d.ts +12 -1
- package/dist/brand.d.ts.map +1 -1
- package/dist/brand.js +2 -1
- package/dist/brand.js.map +1 -1
- package/dist/cli-spinner.d.ts +1 -1
- package/dist/cli-spinner.js +1 -1
- package/dist/cli.d.ts +10 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +320 -63
- package/dist/cli.js.map +1 -1
- package/dist/close-job-template.js +1 -1
- package/dist/complete.d.ts +6 -3
- package/dist/complete.d.ts.map +1 -1
- package/dist/complete.js +91 -37
- package/dist/complete.js.map +1 -1
- package/dist/config.d.ts +55 -9
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +56 -4
- package/dist/config.js.map +1 -1
- package/dist/continue-branch.d.ts.map +1 -1
- package/dist/continue-branch.js +22 -0
- package/dist/continue-branch.js.map +1 -1
- package/dist/decision-engine.d.ts +38 -10
- package/dist/decision-engine.d.ts.map +1 -1
- package/dist/decision-engine.js +10 -6
- package/dist/decision-engine.js.map +1 -1
- package/dist/do-autopick.d.ts.map +1 -1
- package/dist/do-autopick.js +11 -1
- package/dist/do-autopick.js.map +1 -1
- package/dist/do-config.d.ts +1 -1
- package/dist/do.d.ts +49 -56
- package/dist/do.d.ts.map +1 -1
- package/dist/do.js +419 -30
- package/dist/do.js.map +1 -1
- package/dist/env-config.d.ts.map +1 -1
- package/dist/env-config.js +12 -4
- package/dist/env-config.js.map +1 -1
- package/dist/failure-cause.d.ts +3 -2
- package/dist/failure-cause.d.ts.map +1 -1
- package/dist/failure-cause.js +28 -1
- package/dist/failure-cause.js.map +1 -1
- package/dist/format.d.ts +6 -6
- package/dist/format.d.ts.map +1 -1
- package/dist/format.js +10 -27
- package/dist/format.js.map +1 -1
- package/dist/frontmatter.d.ts +16 -4
- package/dist/frontmatter.d.ts.map +1 -1
- package/dist/frontmatter.js +27 -1
- package/dist/frontmatter.js.map +1 -1
- package/dist/gc.d.ts +65 -6
- package/dist/gc.d.ts.map +1 -1
- package/dist/gc.js +126 -9
- package/dist/gc.js.map +1 -1
- package/dist/github.d.ts +14 -0
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +73 -0
- package/dist/github.js.map +1 -1
- package/dist/harness.d.ts +25 -0
- package/dist/harness.d.ts.map +1 -1
- package/dist/harness.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/install-ci-branch-protection.d.ts +132 -38
- package/dist/install-ci-branch-protection.d.ts.map +1 -1
- package/dist/install-ci-branch-protection.js +190 -48
- package/dist/install-ci-branch-protection.js.map +1 -1
- package/dist/install-ci-core.d.ts +21 -1
- package/dist/install-ci-core.d.ts.map +1 -1
- package/dist/install-ci-core.js +10 -3
- package/dist/install-ci-core.js.map +1 -1
- package/dist/install-ci-github.d.ts +32 -0
- package/dist/install-ci-github.d.ts.map +1 -1
- package/dist/install-ci-github.js +73 -0
- package/dist/install-ci-github.js.map +1 -1
- package/dist/install-skills.d.ts +123 -0
- package/dist/install-skills.d.ts.map +1 -0
- package/dist/install-skills.js +100 -0
- package/dist/install-skills.js.map +1 -0
- package/dist/intake-trigger-template.js +1 -1
- package/dist/intake.d.ts +17 -4
- package/dist/intake.d.ts.map +1 -1
- package/dist/intake.js +23 -7
- package/dist/intake.js.map +1 -1
- package/dist/integration-core.d.ts +10 -7
- package/dist/integration-core.d.ts.map +1 -1
- package/dist/integration-core.js +174 -60
- package/dist/integration-core.js.map +1 -1
- package/dist/integrator.d.ts +1 -1
- package/dist/integrator.d.ts.map +1 -1
- package/dist/integrator.js +19 -3
- package/dist/integrator.js.map +1 -1
- package/dist/isolation.d.ts +2 -2
- package/dist/isolation.d.ts.map +1 -1
- package/dist/isolation.js +9 -0
- package/dist/isolation.js.map +1 -1
- package/dist/item-lock.d.ts +196 -129
- package/dist/item-lock.d.ts.map +1 -1
- package/dist/item-lock.js +329 -254
- package/dist/item-lock.js.map +1 -1
- package/dist/ledger-write.d.ts +31 -26
- package/dist/ledger-write.d.ts.map +1 -1
- package/dist/ledger-write.js +100 -122
- package/dist/ledger-write.js.map +1 -1
- package/dist/lifecycle-gather.d.ts +17 -0
- package/dist/lifecycle-gather.d.ts.map +1 -1
- package/dist/lifecycle-gather.js +7 -1
- package/dist/lifecycle-gather.js.map +1 -1
- package/dist/lifecycle-pools.d.ts +40 -3
- package/dist/lifecycle-pools.d.ts.map +1 -1
- package/dist/lifecycle-pools.js +26 -6
- package/dist/lifecycle-pools.js.map +1 -1
- package/dist/merge-question-surfacer.d.ts +15 -1
- package/dist/merge-question-surfacer.d.ts.map +1 -1
- package/dist/merge-question-surfacer.js +18 -3
- package/dist/merge-question-surfacer.js.map +1 -1
- package/dist/migrate-stuck-locks.d.ts +129 -0
- package/dist/migrate-stuck-locks.d.ts.map +1 -0
- package/dist/migrate-stuck-locks.js +355 -0
- package/dist/migrate-stuck-locks.js.map +1 -0
- package/dist/needs-attention.d.ts +293 -16
- package/dist/needs-attention.d.ts.map +1 -1
- package/dist/needs-attention.js +532 -57
- package/dist/needs-attention.js.map +1 -1
- package/dist/orphan-sidecar.d.ts +8 -4
- package/dist/orphan-sidecar.d.ts.map +1 -1
- package/dist/orphan-sidecar.js +35 -2
- package/dist/orphan-sidecar.js.map +1 -1
- package/dist/pi-harness.d.ts +16 -0
- package/dist/pi-harness.d.ts.map +1 -1
- package/dist/pi-harness.js +82 -2
- package/dist/pi-harness.js.map +1 -1
- package/dist/placement.d.ts +3 -3
- package/dist/placement.js +1 -1
- package/dist/prd-to-spec.d.ts.map +1 -1
- package/dist/prd-to-spec.js +9 -5
- package/dist/prd-to-spec.js.map +1 -1
- package/dist/protocol/CLAIM-PROTOCOL.md +17 -10
- package/dist/protocol/REVIEW-PROTOCOL.md +4 -1
- package/dist/protocol/SURFACE-PROTOCOL.md +16 -2
- package/dist/protocol/TASKING-PROTOCOL.md +3 -1
- package/dist/protocol/WORK-CONTRACT.md +22 -18
- package/dist/protocol/task-template.md +1 -1
- package/dist/reap-branches.d.ts +12 -9
- package/dist/reap-branches.d.ts.map +1 -1
- package/dist/reap-branches.js +25 -7
- package/dist/reap-branches.js.map +1 -1
- package/dist/recover-isolated.d.ts +12 -0
- package/dist/recover-isolated.d.ts.map +1 -1
- package/dist/recover-isolated.js +5 -0
- package/dist/recover-isolated.js.map +1 -1
- package/dist/repo-config.d.ts +23 -2
- package/dist/repo-config.d.ts.map +1 -1
- package/dist/repo-config.js +53 -7
- package/dist/repo-config.js.map +1 -1
- package/dist/repo-mirror.d.ts.map +1 -1
- package/dist/repo-mirror.js +18 -2
- package/dist/repo-mirror.js.map +1 -1
- package/dist/review-verdict.js +1 -1
- package/dist/review-verdict.js.map +1 -1
- package/dist/run.d.ts +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +54 -19
- package/dist/run.js.map +1 -1
- package/dist/scan.d.ts +17 -8
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js +22 -8
- package/dist/scan.js.map +1 -1
- package/dist/select-priority.d.ts +2 -2
- package/dist/select-priority.js +1 -1
- package/dist/select-priority.js.map +1 -1
- package/dist/sidecar-apply.js +1 -1
- package/dist/sidecar-apply.js.map +1 -1
- package/dist/sidecar.d.ts +45 -10
- package/dist/sidecar.d.ts.map +1 -1
- package/dist/sidecar.js +82 -2
- package/dist/sidecar.js.map +1 -1
- package/dist/skills/answer-questions/SKILL.md +89 -0
- package/dist/skills/capture-signal/SKILL.md +52 -0
- package/dist/skills/convert-from-prd-to-spec/SKILL.md +90 -0
- package/dist/skills/drive-tasks/SKILL.md +218 -0
- package/dist/skills/from-idea/SKILL.md +83 -0
- package/dist/skills/merge-prs/SKILL.md +70 -0
- package/dist/skills/orchestrate/SKILL.md +101 -0
- package/dist/skills/promote/SKILL.md +35 -0
- package/dist/skills/review/SKILL.md +16 -0
- package/dist/skills/setup/SKILL.md +258 -0
- package/dist/skills/setup/protocol/ADR-FORMAT.md +47 -0
- package/dist/skills/setup/protocol/CLAIM-PROTOCOL.md +224 -0
- package/dist/skills/setup/protocol/REVIEW-PROTOCOL.md +122 -0
- package/dist/skills/setup/protocol/SURFACE-PROTOCOL.md +135 -0
- package/dist/skills/setup/protocol/TASKING-PROTOCOL.md +124 -0
- package/dist/skills/setup/protocol/WORK-CONTRACT.md +280 -0
- package/dist/skills/setup/protocol/spec-template.md +71 -0
- package/dist/skills/setup/protocol/task-template.md +65 -0
- package/dist/skills/surface-questions/SKILL.md +16 -0
- package/dist/skills/to-spec/SKILL.md +34 -0
- package/dist/skills/to-task/SKILL.md +19 -0
- package/dist/skills/triage-observations/SKILL.md +78 -0
- package/dist/skills/work/SKILL.md +51 -0
- package/dist/slug-namespace.d.ts +5 -5
- package/dist/slug-namespace.js +5 -5
- package/dist/slug-namespace.js.map +1 -1
- package/dist/spec-complete.d.ts.map +1 -1
- package/dist/spec-complete.js +2 -3
- package/dist/spec-complete.js.map +1 -1
- package/dist/start.d.ts.map +1 -1
- package/dist/start.js +51 -57
- package/dist/start.js.map +1 -1
- package/dist/surface-gate.d.ts.map +1 -1
- package/dist/surface-gate.js +10 -3
- package/dist/surface-gate.js.map +1 -1
- package/dist/surface-persist.js +1 -1
- package/dist/surface-persist.js.map +1 -1
- package/dist/tasker-review-loop.d.ts +4 -3
- package/dist/tasker-review-loop.d.ts.map +1 -1
- package/dist/tasker-review-loop.js.map +1 -1
- package/dist/tasking-lock.d.ts +2 -2
- package/dist/tasking-lock.d.ts.map +1 -1
- package/dist/tasking-lock.js +53 -32
- package/dist/tasking-lock.js.map +1 -1
- package/dist/tasking.d.ts +40 -6
- package/dist/tasking.d.ts.map +1 -1
- package/dist/tasking.js +224 -12
- package/dist/tasking.js.map +1 -1
- package/dist/triage-persist.d.ts +10 -6
- package/dist/triage-persist.d.ts.map +1 -1
- package/dist/triage-persist.js +34 -4
- package/dist/triage-persist.js.map +1 -1
- package/dist/vendor/incur/agents.d.ts +58 -0
- package/dist/vendor/incur/agents.d.ts.map +1 -0
- package/dist/vendor/incur/agents.js +343 -0
- package/dist/vendor/incur/agents.js.map +1 -0
- package/dist/verify-workflow-template.js +1 -1
- package/dist/watch-session.d.ts +11 -3
- package/dist/watch-session.d.ts.map +1 -1
- package/dist/watch-session.js +94 -7
- package/dist/watch-session.js.map +1 -1
- package/dist/work-layout.d.ts +7 -3
- package/dist/work-layout.d.ts.map +1 -1
- package/dist/work-layout.js +6 -3
- package/dist/work-layout.js.map +1 -1
- package/dist/workspace.d.ts +1 -1
- package/package.json +2 -2
- package/src/advance-drivers.ts +16 -3
- package/src/advance-lifecycle-template.ts +89 -4
- package/src/advance-treeless-publish.ts +45 -0
- package/src/advance.ts +467 -87
- package/src/advancing-lock.ts +96 -1
- package/src/agent-launch.ts +37 -12
- package/src/agent-stop.ts +60 -2
- package/src/apply-decide.ts +36 -7
- package/src/apply-merge-action.ts +45 -7
- package/src/apply-persist.ts +228 -54
- package/src/apply-stuck-action.ts +260 -0
- package/src/brand.ts +14 -2
- package/src/cli-spinner.ts +1 -1
- package/src/cli.ts +401 -70
- package/src/close-job-template.ts +1 -1
- package/src/complete.ts +110 -52
- package/src/config.ts +107 -13
- package/src/continue-branch.ts +22 -0
- package/src/decision-engine.ts +55 -17
- package/src/do-autopick.ts +12 -1
- package/src/do-config.ts +1 -1
- package/src/do.ts +511 -38
- package/src/env-config.ts +12 -4
- package/src/failure-cause.ts +30 -1
- package/src/format.ts +10 -30
- package/src/frontmatter.ts +35 -5
- package/src/gc.ts +172 -9
- package/src/github.ts +78 -0
- package/src/harness.ts +25 -0
- package/src/index.ts +10 -0
- package/src/install-ci-branch-protection.ts +282 -57
- package/src/install-ci-core.ts +30 -3
- package/src/install-ci-github.ts +86 -0
- package/src/install-skills.ts +166 -0
- package/src/intake-trigger-template.ts +1 -1
- package/src/intake.ts +46 -11
- package/src/integration-core.ts +199 -65
- package/src/integrator.ts +22 -9
- package/src/isolation.ts +11 -2
- package/src/item-lock.ts +485 -341
- package/src/ledger-write.ts +135 -150
- package/src/lifecycle-gather.ts +29 -6
- package/src/lifecycle-pools.ts +67 -9
- package/src/merge-question-surfacer.ts +28 -4
- package/src/migrate-stuck-locks.ts +451 -0
- package/src/needs-attention.ts +857 -84
- package/src/orphan-sidecar.ts +47 -6
- package/src/pi-harness.ts +82 -2
- package/src/placement.ts +3 -3
- package/src/prd-to-spec.ts +13 -5
- package/src/reap-branches.ts +38 -14
- package/src/recover-isolated.ts +17 -0
- package/src/repo-config.ts +55 -6
- package/src/repo-mirror.ts +23 -1
- package/src/review-verdict.ts +1 -1
- package/src/run.ts +64 -18
- package/src/scan.ts +22 -8
- package/src/select-priority.ts +3 -3
- package/src/sidecar-apply.ts +1 -1
- package/src/sidecar.ts +138 -11
- package/src/slug-namespace.ts +7 -7
- package/src/spec-complete.ts +2 -3
- package/src/start.ts +53 -59
- package/src/surface-gate.ts +10 -3
- package/src/surface-persist.ts +1 -1
- package/src/tasker-review-loop.ts +4 -3
- package/src/tasking-lock.ts +52 -36
- package/src/tasking.ts +261 -17
- package/src/triage-persist.ts +56 -12
- package/src/vendor/incur/LICENSE +21 -0
- package/src/vendor/incur/README.md +19 -0
- package/src/vendor/incur/agents.ts +392 -0
- package/src/verify-workflow-template.ts +1 -1
- package/src/watch-session.ts +102 -7
- package/src/work-layout.ts +6 -3
- package/src/workspace.ts +1 -1
package/dist/apply-decide.d.ts
CHANGED
|
@@ -20,8 +20,19 @@ import { type DecisionDecider, type DecisionOutcome } from './decision-engine.js
|
|
|
20
20
|
* from the agent's VERDICT, NOT a human `promote-*` field.
|
|
21
21
|
*
|
|
22
22
|
* **The allowed set** (the SUBSET the apply rung passes to `decide`):
|
|
23
|
-
* `{task | spec | adr |
|
|
24
|
-
*
|
|
23
|
+
* `{task | spec | adr | dispose | resolve | ask}` \u2014 i.e. `{mint-task | mint-spec |
|
|
24
|
+
* mint-adr | dispose-source | resolve-no-mint | ask-follow-up}`. The `dispose`
|
|
25
|
+
* verdict replaced the older `delete` token (task
|
|
26
|
+
* `apply-disposition-delete-to-dispose-regime-polymorphic`, spec
|
|
27
|
+
* `surface-stuck-as-questions-and-retire-stuck-lock-state` decision #5): the
|
|
28
|
+
* disposal is now REGIME-POLYMORPHIC (observation \u2192 `git rm`, task \u2192
|
|
29
|
+
* `git mv` to `tasks/cancelled/`, spec \u2192 `git mv` to `specs/dropped/`), so a
|
|
30
|
+
* task can no longer be hard-deleted by the apply rung. `resolve` was added
|
|
31
|
+
* by the task `apply-decide-resolve-verdict-mint-nothing` so the decider can
|
|
32
|
+
* honestly handle "the human answered, keep the note on record, mint nothing"
|
|
33
|
+
* (previously it had no valid verdict for that case and looped on `ask`,
|
|
34
|
+
* re-surfacing an already-answered question every tick). `adr` was DEFERRED at the
|
|
35
|
+
* keystone launch (no
|
|
25
36
|
* ADR-mint path existed yet) and is now WIRED by the follow-on task
|
|
26
37
|
* `agentic-apply-mint-adr-route`, which added the {@link
|
|
27
38
|
* import('./mint-adr.js').mintAdr} route and widened this set. Intake's set is
|
|
@@ -91,7 +102,10 @@ export declare function buildApplyDecisionInput(opts: {
|
|
|
91
102
|
* the human's recorded ANSWER(S) + the SOURCE item and emit a single
|
|
92
103
|
* `{outcome, \u2026}` verdict ({@link parseDecisionVerdict} reads it). The agent decides
|
|
93
104
|
* what to DO with the answered signal \u2014 mint a self-contained task, mint a SPEC,
|
|
94
|
-
* mint an ADR,
|
|
105
|
+
* mint an ADR, DISPOSE the source (regime-polymorphic: an observation is
|
|
106
|
+
* git-rm-ed, a task is `git mv`-ed to `tasks/cancelled/`, a spec to
|
|
107
|
+
* `specs/dropped/`), resolve it (settle the loop, mint nothing, KEEP the note),
|
|
108
|
+
* or ask one BATCH of follow-up questions \u2014
|
|
95
109
|
* grounded in the source's full context. It writes NOTHING (the engine acts on
|
|
96
110
|
* the verdict).
|
|
97
111
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-decide.d.ts","sourceRoot":"","sources":["../src/apply-decide.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAA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M,CAAC,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,kBAAkB,GAAG,SAAS,CAyBjC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CA0D1E;AAED,8EAA8E;AAC9E,MAAM,WAAW,0BAA0B;IAC1C,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,CAAC;CACpD;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,GAAE,0BAA+B,GACtC,YAAY,CAuBd"}
|
package/dist/apply-decide.js
CHANGED
|
@@ -23,8 +23,19 @@ import { parseDecisionVerdict, } from './decision-engine.js';
|
|
|
23
23
|
* from the agent's VERDICT, NOT a human `promote-*` field.
|
|
24
24
|
*
|
|
25
25
|
* **The allowed set** (the SUBSET the apply rung passes to `decide`):
|
|
26
|
-
* `{task | spec | adr |
|
|
27
|
-
*
|
|
26
|
+
* `{task | spec | adr | dispose | resolve | ask}` \u2014 i.e. `{mint-task | mint-spec |
|
|
27
|
+
* mint-adr | dispose-source | resolve-no-mint | ask-follow-up}`. The `dispose`
|
|
28
|
+
* verdict replaced the older `delete` token (task
|
|
29
|
+
* `apply-disposition-delete-to-dispose-regime-polymorphic`, spec
|
|
30
|
+
* `surface-stuck-as-questions-and-retire-stuck-lock-state` decision #5): the
|
|
31
|
+
* disposal is now REGIME-POLYMORPHIC (observation \u2192 `git rm`, task \u2192
|
|
32
|
+
* `git mv` to `tasks/cancelled/`, spec \u2192 `git mv` to `specs/dropped/`), so a
|
|
33
|
+
* task can no longer be hard-deleted by the apply rung. `resolve` was added
|
|
34
|
+
* by the task `apply-decide-resolve-verdict-mint-nothing` so the decider can
|
|
35
|
+
* honestly handle "the human answered, keep the note on record, mint nothing"
|
|
36
|
+
* (previously it had no valid verdict for that case and looped on `ask`,
|
|
37
|
+
* re-surfacing an already-answered question every tick). `adr` was DEFERRED at the
|
|
38
|
+
* keystone launch (no
|
|
28
39
|
* ADR-mint path existed yet) and is now WIRED by the follow-on task
|
|
29
40
|
* `agentic-apply-mint-adr-route`, which added the {@link
|
|
30
41
|
* import('./mint-adr.js').mintAdr} route and widened this set. Intake's set is
|
|
@@ -47,7 +58,8 @@ export const APPLY_ALLOWED_OUTCOMES = [
|
|
|
47
58
|
'task',
|
|
48
59
|
'spec',
|
|
49
60
|
'adr',
|
|
50
|
-
'
|
|
61
|
+
'dispose',
|
|
62
|
+
'resolve',
|
|
51
63
|
'ask',
|
|
52
64
|
];
|
|
53
65
|
/**
|
|
@@ -88,7 +100,10 @@ export function buildApplyDecisionInput(opts) {
|
|
|
88
100
|
* the human's recorded ANSWER(S) + the SOURCE item and emit a single
|
|
89
101
|
* `{outcome, \u2026}` verdict ({@link parseDecisionVerdict} reads it). The agent decides
|
|
90
102
|
* what to DO with the answered signal \u2014 mint a self-contained task, mint a SPEC,
|
|
91
|
-
* mint an ADR,
|
|
103
|
+
* mint an ADR, DISPOSE the source (regime-polymorphic: an observation is
|
|
104
|
+
* git-rm-ed, a task is `git mv`-ed to `tasks/cancelled/`, a spec to
|
|
105
|
+
* `specs/dropped/`), resolve it (settle the loop, mint nothing, KEEP the note),
|
|
106
|
+
* or ask one BATCH of follow-up questions \u2014
|
|
92
107
|
* grounded in the source's full context. It writes NOTHING (the engine acts on
|
|
93
108
|
* the verdict).
|
|
94
109
|
*
|
|
@@ -130,9 +145,23 @@ export function buildApplyDecisionPrompt(input) {
|
|
|
130
145
|
` a self-contained ADR (docs/adr/, the context/decision/why shape) carrying`,
|
|
131
146
|
` the WHY from the answer(s). Emit {"outcome":"adr","adrSlug":"\u2026",`,
|
|
132
147
|
` "adrTitle":"\u2026","adrBody":"\u2026 (markdown AFTER the frontmatter)"}.`,
|
|
133
|
-
` - "
|
|
134
|
-
` {"outcome":"
|
|
135
|
-
`
|
|
148
|
+
` - "dispose": the answer means this signal should be DISPOSED. Emit`,
|
|
149
|
+
` {"outcome":"dispose","disposeReason":"\u2026"}. REGIME-POLYMORPHIC on the`,
|
|
150
|
+
` SOURCE type: an OBSERVATION is git-rm-ed in a single revertible commit`,
|
|
151
|
+
` (reason rides the message, git history is the archive); a TASK is git-mv-ed`,
|
|
152
|
+
` to \`tasks/cancelled/\` (RETAINED, reason recorded in the moved body's`,
|
|
153
|
+
` \`reason:\` frontmatter); a SPEC is git-mv-ed to \`specs/dropped/\` (RETAINED).`,
|
|
154
|
+
` A task can NEVER be hard-deleted by the apply rung \u2014 dispose is the`,
|
|
155
|
+
` only path off the board.`,
|
|
156
|
+
` - "resolve": the answer SETTLES this item and there is NOTHING to mint (no`,
|
|
157
|
+
` task/spec/adr) \u2014 the correct move is to CLOSE the question-loop while`,
|
|
158
|
+
` KEEPING the note on record (e.g. an evidence/watch-item observation whose`,
|
|
159
|
+
` answer is "acknowledged, keep this on record, no artifact"). The answers are`,
|
|
160
|
+
` harvested into the item body and the loop is cleared; the note is RETAINED`,
|
|
161
|
+
` (this is the sibling of "dispose", which DROPS the observation-note or`,
|
|
162
|
+
` moves a task/spec to its terminal \u2014 pick "resolve" when the observation`,
|
|
163
|
+
` should SURVIVE in place, "dispose" when it should not). Emit`,
|
|
164
|
+
` {"outcome":"resolve","resolveReason":"\u2026"}.`,
|
|
136
165
|
` - "ask": you need more from the human before acting. Emit`,
|
|
137
166
|
` {"outcome":"ask","question":"\u2026"} \u2014 ask everything you still need as ONE`,
|
|
138
167
|
` batch (never a drip); the engine appends it and re-pauses.`,
|
package/dist/apply-decide.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-decide.js","sourceRoot":"","sources":["../src/apply-decide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AACjD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,WAAW,EAAe,MAAM,cAAc,CAAC;AACvD,OAAO,EAAC,uBAAuB,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,YAAY,EAAE,cAAc,EAAoB,MAAM,cAAc,CAAC;AAC7E,OAAO,EAIN,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAE9B
|
|
1
|
+
{"version":3,"file":"apply-decide.js","sourceRoot":"","sources":["../src/apply-decide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AACjD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,WAAW,EAAe,MAAM,cAAc,CAAC;AACvD,OAAO,EAAC,uBAAuB,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,YAAY,EAAE,cAAc,EAAoB,MAAM,cAAc,CAAC;AAC7E,OAAO,EAIN,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAA+B;IACjE,MAAM;IACN,MAAM;IACN,KAAK;IACL,SAAS;IACT,SAAS;IACT,KAAK;CACL,CAAC;AAkCF;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAQvC;IACA,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7D,IAAI,CAAC,UAAU,CAAC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YAChB,OAAO,EAAE,OAAO,CAAC,QAAQ,IAAI,EAAE;YAC/B,MAAM,EAAE,wBAAwB,CAAC,KAAK,CAAC;YACvC,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,SAAS;YACT,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,GAAG,EAAE,KAAK,CAAC,GAAG;SACd,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CACd,qCAAqC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CACpF,CAAC;QACH,CAAC;QACD,OAAO,oBAAoB,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -82,11 +82,23 @@ export interface DetectedMergeAction {
|
|
|
82
82
|
*/
|
|
83
83
|
export declare function parseMergeAnswer(text: string): MergeActionVerb | undefined;
|
|
84
84
|
/**
|
|
85
|
-
* Detect the
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
85
|
+
* Detect the `kind: merge` action verb that should drive the next apply run.
|
|
86
|
+
* The apply rung's pre-decider kind-check; returns `undefined` when there is
|
|
87
|
+
* nothing for the dispatcher to act on.
|
|
88
|
+
*
|
|
89
|
+
* ORDERING (task `merge-action-nits-followup` nit 1). The re-stale re-surface
|
|
90
|
+
* path (`advance.ts` `maybeRunMergeAction` restale branch) APPENDS a new
|
|
91
|
+
* `kind: merge` follow-up via `appendQuestions` rather than clearing the prior
|
|
92
|
+
* `answer=merge` on the original entry — that append-and-keep-history shape is
|
|
93
|
+
* canonical, but a naive FIRST-match lookup would re-fire against the STALE
|
|
94
|
+
* prior answer instead of the human's fresh follow-up. So:
|
|
95
|
+
*
|
|
96
|
+
* 1. If ANY `kind: merge` entry is UNANSWERED, return `undefined` — that is
|
|
97
|
+
* the re-paused state (a freshly-appended follow-up awaiting an answer),
|
|
98
|
+
* and the apply MUST NOT fire against a stale prior sibling.
|
|
99
|
+
* 2. Otherwise return the LATEST answered `kind: merge` entry — a fresh
|
|
100
|
+
* follow-up answer wins over the stale one, and a plain single-entry
|
|
101
|
+
* merge-question sidecar behaves as before.
|
|
90
102
|
*
|
|
91
103
|
* The sidecar is read OFF DISK keyed off the namespaced item identity; the
|
|
92
104
|
* model is parsed via the SAME `parseSidecar` the rest of the engine uses.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-merge-action.d.ts","sourceRoot":"","sources":["../src/apply-merge-action.ts"],"names":[],"mappings":"AAEA,OAAO,EAKN,KAAK,YAAY,EAEjB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAEN,KAAK,qBAAqB,EAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,uEAAuE;AACvE,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD,yFAAyF;AACzF,MAAM,WAAW,mBAAmB;IACnC,kEAAkE;IAClE,IAAI,EAAE,eAAe,CAAC;IACtB,2DAA2D;IAC3D,KAAK,EAAE,YAAY,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAe1E;AAED
|
|
1
|
+
{"version":3,"file":"apply-merge-action.d.ts","sourceRoot":"","sources":["../src/apply-merge-action.ts"],"names":[],"mappings":"AAEA,OAAO,EAKN,KAAK,YAAY,EAEjB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAEN,KAAK,qBAAqB,EAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAA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YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,mEAAmE;AACnE,MAAM,MAAM,kBAAkB;AAC7B,qFAAqF;AACnF,QAAQ;AACV,yFAAyF;GACvF,oBAAoB;AACtB;;;;;;GAMG;GACD,SAAS;AACX;;;;GAIG;GACD,SAAS;AACX,mFAAmF;GACjF,MAAM;AACR,mFAAmF;GACjF,MAAM,CAAC;AAEV,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAChC,KAAK,EAAE,gBAAgB,KACnB,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAmEhC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,kBAAkB,CACvC,KAAK,EAAE,gBAAgB,GACrB,OAAO,CAAC,iBAAiB,CAAC,CA4L5B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import { isEntryAnswered, parseSidecar, resolveSidecarIdentity, sidecarPathFor, } from './sidecar.js';
|
|
4
4
|
import { run as runProc } from './git.js';
|
|
5
5
|
import { createJob } from './workspace.js';
|
|
6
6
|
import { performIntegration, } from './integration-core.js';
|
|
@@ -38,11 +38,23 @@ export function parseMergeAnswer(text) {
|
|
|
38
38
|
return undefined;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* Detect the
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
41
|
+
* Detect the `kind: merge` action verb that should drive the next apply run.
|
|
42
|
+
* The apply rung's pre-decider kind-check; returns `undefined` when there is
|
|
43
|
+
* nothing for the dispatcher to act on.
|
|
44
|
+
*
|
|
45
|
+
* ORDERING (task `merge-action-nits-followup` nit 1). The re-stale re-surface
|
|
46
|
+
* path (`advance.ts` `maybeRunMergeAction` restale branch) APPENDS a new
|
|
47
|
+
* `kind: merge` follow-up via `appendQuestions` rather than clearing the prior
|
|
48
|
+
* `answer=merge` on the original entry — that append-and-keep-history shape is
|
|
49
|
+
* canonical, but a naive FIRST-match lookup would re-fire against the STALE
|
|
50
|
+
* prior answer instead of the human's fresh follow-up. So:
|
|
51
|
+
*
|
|
52
|
+
* 1. If ANY `kind: merge` entry is UNANSWERED, return `undefined` — that is
|
|
53
|
+
* the re-paused state (a freshly-appended follow-up awaiting an answer),
|
|
54
|
+
* and the apply MUST NOT fire against a stale prior sibling.
|
|
55
|
+
* 2. Otherwise return the LATEST answered `kind: merge` entry — a fresh
|
|
56
|
+
* follow-up answer wins over the stale one, and a plain single-entry
|
|
57
|
+
* merge-question sidecar behaves as before.
|
|
46
58
|
*
|
|
47
59
|
* The sidecar is read OFF DISK keyed off the namespaced item identity; the
|
|
48
60
|
* model is parsed via the SAME `parseSidecar` the rest of the engine uses.
|
|
@@ -60,9 +72,14 @@ export function detectAnsweredMergeAction(cwd, item) {
|
|
|
60
72
|
catch {
|
|
61
73
|
return undefined;
|
|
62
74
|
}
|
|
63
|
-
|
|
64
|
-
return undefined;
|
|
75
|
+
// (1) Unanswered `kind: merge` follow-up ⇒ re-paused; the apply must NOT fire.
|
|
65
76
|
for (const entry of model.entries) {
|
|
77
|
+
if (entry.kind === 'merge' && !isEntryAnswered(entry))
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
// (2) LATEST answered `kind: merge` entry — a fresh follow-up beats a stale one.
|
|
81
|
+
for (let i = model.entries.length - 1; i >= 0; i--) {
|
|
82
|
+
const entry = model.entries[i];
|
|
66
83
|
if (entry.kind !== 'merge')
|
|
67
84
|
continue;
|
|
68
85
|
if (!isEntryAnswered(entry))
|
|
@@ -153,6 +170,24 @@ function mergeBaseMoved(job, env) {
|
|
|
153
170
|
export async function performMergeAction(input) {
|
|
154
171
|
const note = input.note ?? (() => { });
|
|
155
172
|
const { verb } = input.action;
|
|
173
|
+
// INVARIANT (task `merge-action-nits-followup` nit 4). The merge-question
|
|
174
|
+
// surfacer only emits `kind: merge` sidecars for TASKS, so the hard-coded
|
|
175
|
+
// `type: 'task'` on the `createJob` call below is correct in practice — but
|
|
176
|
+
// if a future surfacer change ever stamps a `kind: merge` sidecar on a
|
|
177
|
+
// non-task item (e.g. a spec-level unmerged branch), the branch name
|
|
178
|
+
// `work/task-<slug>` would silently mis-target. Fail LOUDLY here so the
|
|
179
|
+
// invariant is asserted at the dispatcher's entry rather than manifesting
|
|
180
|
+
// as a mysterious rebase/push mis-target downstream.
|
|
181
|
+
const identity = resolveSidecarIdentity(input.item);
|
|
182
|
+
if (identity.type !== 'task') {
|
|
183
|
+
throw new Error(`performMergeAction: sidecar source item \`${input.item}\` has type ` +
|
|
184
|
+
`\`${identity.type}\`, but the answered-merge dispatcher only supports ` +
|
|
185
|
+
`\`task\` items (the surfacer only stamps \`kind: merge\` on tasks; the ` +
|
|
186
|
+
`branch name \`work/task-<slug>\` would silently mis-target otherwise). ` +
|
|
187
|
+
`This is the entry-invariant asserted by nit 4 of task ` +
|
|
188
|
+
`\`merge-action-nits-followup\` — reconcile the surfacer or extend the ` +
|
|
189
|
+
`dispatcher before landing a non-task source item.`);
|
|
190
|
+
}
|
|
156
191
|
if (verb === 'hold') {
|
|
157
192
|
return {
|
|
158
193
|
outcome: 'hold',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-merge-action.js","sourceRoot":"","sources":["../src/apply-merge-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,Y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KAAK,CAAC,YAAY;YAChC,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,IAAI;SACJ,CAAC,CAAC;QAEH,IAAI,WAAW,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;YACzC,OAAO;gBACN,OAAO,EAAE,QAAQ;gBACjB,OAAO,EACN,sBAAsB,KAAK,CAAC,IAAI,2BAA2B;oBAC3D,UAAU,KAAK,CAAC,IAAI,WAAW,GAAG,CAAC,aAAa,kBAAkB;oBAClE,mEAAmE;gBACpE,WAAW;aACX,CAAC;QACH,CAAC;QACD,IAAI,WAAW,CAAC,OAAO,KAAK,oBAAoB,EAAE,CAAC;YAClD,OAAO;gBACN,OAAO,EAAE,oBAAoB;gBAC7B,OAAO,EACN,sBAAsB,KAAK,CAAC,IAAI,4BAA4B,KAAK,CAAC,IAAI,KAAK;oBAC3E,oBAAoB,GAAG,CAAC,aAAa,8BAA8B;gBACpE,WAAW;aACX,CAAC;QACH,CAAC;QACD,uEAAuE;QACvE,+DAA+D;QAC/D,yEAAyE;QACzE,8DAA8D;QAC9D,OAAO;YACN,OAAO,EAAE,SAAS;YAClB,OAAO,EACN,WAAW,CAAC,MAAM;gBAClB,sBAAsB,KAAK,CAAC,IAAI,yCAAyC;oBACxE,IAAI,WAAW,CAAC,OAAO,4CAA4C;YACrE,WAAW;SACX,CAAC;IACH,CAAC;YAAS,CAAC;QACV,IAAI,CAAC;YACJ,GAAG,CAAC,OAAO,EAAE,CAAC;QACf,CAAC;QAAC,MAAM,CAAC;YACR,mEAAmE;YACnE,sEAAsE;QACvE,CAAC;IACF,CAAC;AACF,CAAC"}
|
package/dist/apply-persist.d.ts
CHANGED
|
@@ -11,10 +11,15 @@ import { APPLY_LIFECYCLE_FOLDERS, resolveItemPathByIdentity } from './item-path.
|
|
|
11
11
|
* - **append / re-pause** — when the apply has NEW questions to ask: append
|
|
12
12
|
* `qN+1…`, stay `needsAnswers:true`, re-pause (the "all answered?" flips back
|
|
13
13
|
* to false); OR
|
|
14
|
-
* - **
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* - **dispose** — when the caller decided the SOURCE should be DISPOSED
|
|
15
|
+
* (`dispose` set): REGIME-POLYMORPHIC on the source's type (task
|
|
16
|
+
* `apply-disposition-delete-to-dispose-regime-polymorphic`, spec
|
|
17
|
+
* `surface-stuck-as-questions-and-retire-stuck-lock-state` decision #5):
|
|
18
|
+
* an OBSERVATION is `git rm`-ed with its sidecar in one revertible commit
|
|
19
|
+
* (reason in the message, git history = archive); a TASK is `git mv`-ed to
|
|
20
|
+
* `tasks/cancelled/` (RETAINED, `reason:` written into the moved body); a
|
|
21
|
+
* SPEC is `git mv`-ed to `specs/dropped/` (RETAINED). A task can NEVER be
|
|
22
|
+
* hard-deleted from here — dispose is the only path off the board; OR
|
|
18
23
|
* - **resolve fully** (the default) — clear `needsAnswers` + DELETE the sidecar
|
|
19
24
|
* in the SAME atomic commit (the invariant `needsAnswers:false ⟺ no active
|
|
20
25
|
* sidecar`); the item advances toward build by its normal lifecycle.
|
|
@@ -25,19 +30,19 @@ import { APPLY_LIFECYCLE_FOLDERS, resolveItemPathByIdentity } from './item-path.
|
|
|
25
30
|
* no `keep`/`triaged:keep` resting state. A sidecar entry is BINARY (no-answer |
|
|
26
31
|
* answered); what to DO with a fully-answered OBSERVATION is decided by the
|
|
27
32
|
* AGENTIC apply decision in the advance tick (`advance.ts` `applyRung` over the
|
|
28
|
-
* shared `decide` engine), which then routes here (re-pause /
|
|
33
|
+
* shared `decide` engine), which then routes here (re-pause / dispose / via
|
|
29
34
|
* `promoteObservation` for a mint). A signal is still-open, acted-on, or deleted
|
|
30
35
|
* — there is no \"retain as resolved\" state.
|
|
31
36
|
*
|
|
32
37
|
* The work-item (task/spec) terminal MOVES (`tasks/cancelled`, `specs/dropped`) and
|
|
33
|
-
* the `
|
|
38
|
+
* the stuck (lock `state: stuck`) LIFECYCLE state are a SEPARATE lifecycle concern (a
|
|
34
39
|
* task/spec is dropped by its own lifecycle, not by a question answer) — they are
|
|
35
40
|
* NOT routed from here any more (they were the removed disposition vocabulary).
|
|
36
41
|
*
|
|
37
42
|
* It is the SIBLING of {@link import('./surface-persist.js').persistSurfacedQuestions}:
|
|
38
43
|
* that is the SURFACE rung's one-commit primitive (append-or-create + set
|
|
39
44
|
* `needsAnswers`); this is the APPLY rung's (apply answers + resolve / re-pause /
|
|
40
|
-
*
|
|
45
|
+
* dispose). Kept file-orthogonal so the rung bodies land in different tasks.
|
|
41
46
|
*
|
|
42
47
|
* **NEVER invents an answer (US #4).** The apply rung applies ONLY what the human
|
|
43
48
|
* authored — the recorded `answer:` text. It does NOT fill, guess, or author an
|
|
@@ -70,7 +75,7 @@ declare const APPLIED_HEADING = "## Applied answers";
|
|
|
70
75
|
* (backward compat — no marker ⇒ nothing to strip ⇒ identical bytes).
|
|
71
76
|
*
|
|
72
77
|
* The sibling task `templates-mark-transient-open-questions-block` introduces
|
|
73
|
-
* the markers in the
|
|
78
|
+
* the markers in the spec/task templates; this task exports the constants so
|
|
74
79
|
* the two tasks agree on the literal byte sequence.
|
|
75
80
|
*/
|
|
76
81
|
export declare const OPEN_QUESTIONS_MARKER_OPEN = "<!-- open-questions -->";
|
|
@@ -92,19 +97,30 @@ export interface ApplyAnsweredQuestionsOptions {
|
|
|
92
97
|
* a caller-supplied batch). When non-empty, the apply APPENDS them (`qN+1…`,
|
|
93
98
|
* never mutating an answered entry) and RE-PAUSES (`needsAnswers:true` stays) —
|
|
94
99
|
* the "all answered?" flips back to false. Empty/omitted ⇒ resolve the item (or
|
|
95
|
-
*
|
|
100
|
+
* dispose it, when `dispose` is set).
|
|
96
101
|
*/
|
|
97
102
|
appendQuestions?: NewQuestion[];
|
|
98
103
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* the
|
|
104
|
+
* DISPOSE the SOURCE (the agentic `dispose` verdict, or a direct disposal):
|
|
105
|
+
* REGIME-POLYMORPHIC on the source's type (task
|
|
106
|
+
* `apply-disposition-delete-to-dispose-regime-polymorphic`, spec
|
|
107
|
+
* `surface-stuck-as-questions-and-retire-stuck-lock-state` decision #5):
|
|
108
|
+
* - OBSERVATION → `git rm` the source + its answered sidecar in a STANDALONE
|
|
109
|
+
* revertible commit, the `reason` recorded in the commit message (git
|
|
110
|
+
* history is the archive; notes leave by deletion, decision 12);
|
|
111
|
+
* - TASK → `git mv` the source to the task regime's won't-proceed terminal
|
|
112
|
+
* `tasks/cancelled/` (RETAINED, `reason:` written into the moved body's
|
|
113
|
+
* frontmatter); the sidecar is `git rm`-ed in the same commit;
|
|
114
|
+
* - SPEC → `git mv` the source to `specs/dropped/` (RETAINED); sidecar
|
|
115
|
+
* `git rm`-ed in the same commit.
|
|
116
|
+
* A TASK can NEVER be hard-deleted through this option — dispose is the only
|
|
117
|
+
* path off the board, true by construction (there is no `delete: true` escape
|
|
118
|
+
* hatch here). Fires DIRECT (no preview/confirm — decision 12). Mutually
|
|
119
|
+
* exclusive with `appendQuestions` (re-pause and dispose cannot both happen on
|
|
120
|
+
* one apply); when both are given the re-pause wins (you cannot dispose a
|
|
121
|
+
* source you are still asking about).
|
|
106
122
|
*/
|
|
107
|
-
|
|
123
|
+
dispose?: {
|
|
108
124
|
reason: string;
|
|
109
125
|
};
|
|
110
126
|
/** Advisory committer id for the commit subject. Defaults to git user.name. */
|
|
@@ -121,14 +137,26 @@ export type ApplyTerminal =
|
|
|
121
137
|
/** New questions appended; stayed needsAnswers:true and re-paused. */
|
|
122
138
|
| 'repaused'
|
|
123
139
|
/**
|
|
124
|
-
* The SOURCE was
|
|
125
|
-
* a direct
|
|
126
|
-
* STANDALONE revertible commit, the reason
|
|
127
|
-
* history = archive).
|
|
128
|
-
* resting marker. This is the apply rung applying the human's
|
|
129
|
-
* (human-authored, not a unilateral agent destruction of a
|
|
140
|
+
* The SOURCE (an OBSERVATION) was disposed BY DELETION (the agentic `dispose`
|
|
141
|
+
* verdict on an observation, or a direct disposal): the source (+ its answered
|
|
142
|
+
* sidecar) were `git rm`-ed in a STANDALONE revertible commit, the reason in
|
|
143
|
+
* the commit message (git history = archive). Notes leave by being GONE —
|
|
144
|
+
* there is no resting marker. This is the apply rung applying the human's
|
|
145
|
+
* RATIFIED answer (human-authored, not a unilateral agent destruction of a
|
|
146
|
+
* live signal). Preserved verbatim as `'deleted'` for observation disposals;
|
|
147
|
+
* see {@link ApplyTerminal | 'disposed'} for the task/spec branches.
|
|
130
148
|
*/
|
|
131
149
|
| 'deleted'
|
|
150
|
+
/**
|
|
151
|
+
* The SOURCE (a TASK or SPEC) was DISPOSED to its regime's won't-proceed
|
|
152
|
+
* terminal (task `apply-disposition-delete-to-dispose-regime-polymorphic`,
|
|
153
|
+
* spec `surface-stuck-as-questions-and-retire-stuck-lock-state` decision #5):
|
|
154
|
+
* a task `git mv`-ed to `tasks/cancelled/`, a spec `git mv`-ed to
|
|
155
|
+
* `specs/dropped/`. The file is RETAINED (git history + terminal folder is
|
|
156
|
+
* the archive), with the human's `reason:` written into the moved body's
|
|
157
|
+
* frontmatter and the answered sidecar `git rm`-ed in the same commit.
|
|
158
|
+
*/
|
|
159
|
+
| 'disposed'
|
|
132
160
|
/**
|
|
133
161
|
* The item file was GONE by the time apply tried to write (a concurrent
|
|
134
162
|
* promote/terminal-move/delete between capture and write). Apply exited
|
|
@@ -163,9 +191,12 @@ export declare class ApplyPersistError extends Error {
|
|
|
163
191
|
*
|
|
164
192
|
* 1. **append / re-pause** — `appendQuestions` is non-empty: append `qN+1…`,
|
|
165
193
|
* keep `needsAnswers:true`, re-pause (one commit, body + sidecar).
|
|
166
|
-
* 2. **
|
|
167
|
-
*
|
|
168
|
-
*
|
|
194
|
+
* 2. **dispose** — `dispose` is set (the `dispose` verdict): REGIME-POLYMORPHIC
|
|
195
|
+
* on the source's type — an OBSERVATION is `git rm`-ed with its sidecar in
|
|
196
|
+
* a standalone revertible commit (reason in the message); a TASK is `git
|
|
197
|
+
* mv`-ed to `tasks/cancelled/` (`reason:` written into the moved body,
|
|
198
|
+
* sidecar `git rm`-ed in the same commit); a SPEC is `git mv`-ed to
|
|
199
|
+
* `specs/dropped/` (same shape as the task branch).
|
|
169
200
|
* 3. **resolve fully** (the default) — clear `needsAnswers` + delete the sidecar
|
|
170
201
|
* in ONE commit; the item advances toward build by its normal lifecycle.
|
|
171
202
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-persist.d.ts","sourceRoot":"","sources":["../src/apply-persist.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply-persist.d.ts","sourceRoot":"","sources":["../src/apply-persist.ts"],"names":[],"mappings":"AAKA,OAAO,EAMN,KAAK,WAAW,EAIhB,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,uBAAuB,EACvB,yBAAyB,EACzB,MAAM,gBAAgB,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAMH,OAAO,EAAC,uBAAuB,EAAE,yBAAyB,EAAC,CAAC;AAE5D,oEAAoE;AACpE,QAAA,MAAM,eAAe,uBAAuB,CAAC;AAE7C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,0BAA0B,4BAA4B,CAAC;AACpE,eAAO,MAAM,2BAA2B,6BAA6B,CAAC;AAEtE,MAAM,WAAW,6BAA6B;IAC7C,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC;IAChC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,EAAE;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC;IAC3B,+EAA+E;IAC/E,EAAE,CAAC,EAAE,MA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