@deftai/directive-content 0.92.0 → 0.94.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/.agents/skills/deft-directive-xbrief/SKILL.md +11 -0
- package/Taskfile.yml +8 -3
- package/UPGRADING.md +14 -0
- package/ci-cd/README.md +57 -0
- package/ci-cd/blacksmith/README.md +32 -0
- package/ci-cd/blacksmith/examples/lint-vs-test-split.md +98 -0
- package/ci-cd/blacksmith/migration-prompt.md +80 -0
- package/ci-cd/blacksmith/overview.md +58 -0
- package/ci-cd/blacksmith/runner-tiers.md +80 -0
- package/coding/coding.md +7 -1
- package/coding/docs.md +44 -0
- package/coding/review.md +50 -0
- package/commands.md +81 -3
- package/conventions/content-manifest.json +6 -1
- package/deployments/README.md +8 -0
- package/docs/openclaw-agent-host.md +46 -0
- package/docs/skill-discovery-hosts.md +84 -0
- package/docs/slash-multi-host.md +241 -0
- package/main.md +1 -0
- package/package.json +1 -1
- package/packs/rules/rules-pack-0.1.json +137 -1
- package/packs/skills/skills-pack-0.1.json +22 -6
- package/packs/strategies/strategies-pack-0.1.json +1 -1
- package/skills/deft-directive-pre-pr/SKILL.md +8 -5
- package/skills/deft-directive-review-cycle/SKILL.md +67 -23
- package/skills/deft-directive-setup/SKILL.md +10 -2
- package/skills/deft-directive-swarm/SKILL.md +7 -0
- package/skills/deft-directive-swarm/references/core-ops.md +2 -0
- package/skills/deft-directive-swarm/references/core-phase-5-6.md +2 -0
- package/skills/deft-directive-xbrief/SKILL.md +77 -0
- package/strategies/research.md +26 -1
- package/tasks/verify.yml +10 -0
- package/templates/agent-prompt-preamble.md +33 -0
- package/templates/swarm-greptile-poller-prompt.md +18 -15
- package/tools/greptile.md +1 -1
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"research"
|
|
122
122
|
],
|
|
123
123
|
"path": "strategies/research.md",
|
|
124
|
-
"body": "# Research Strategy\n\nLook before you leap — investigate the domain before planning.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**⚠️ See also**: [strategies/interview.md](./interview.md) | [strategies/discuss.md](./discuss.md) | [strategies/map.md](./map.md)\n\n> Adapted from [GSD](https://github.com/gsd-build/get-shit-done) research phase.\n\n---\n\n## When to Use\n\n- ~ Before planning a feature in an unfamiliar domain (auth, payments, real-time, etc.)\n- ~ When the feature involves libraries or APIs the agent hasn't used in this project\n- ? Skip for well-understood domains where the agent has strong existing context\n\n## Output\n\n! Before writing output artifacts, follow the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light).\n\nProduce `vbrief/proposed/{feature}-research.vbrief.json` with two mandatory narratives:\n\n! After emitting this scope vBRIEF, surface the GitHub-issue tracking hint from [emit-hints.md](./emit-hints.md) — name all three patterns (none / `--umbrella` / `--per-vbrief`).\n\n### `DontHandRoll` narrative\n\nProblems that look simple but have existing, battle-tested solutions.\n\n- ! For each problem area, specify: **problem**, **recommended library/tool**, **why not hand-roll**\n- ! Check the project's existing dependencies first -- don't add a library when one is already available\n- ~ Consult official docs for the recommended library (use Context7 or equivalent)\n\n**Example narrative content:**\n```\nProblem: JWT validation\nUse: jose\nRationale: Edge cases in token expiry, key rotation, algorithm confusion\n\nProblem: Email templates\nUse: react-email\nRationale: HTML email rendering is notoriously broken across clients\n\nProblem: Rate limiting\nUse: express-rate-limit\nRationale: IP spoofing, distributed state, Redis integration\n```\n\n### `CommonPitfalls` narrative\n\nWhat goes wrong in this domain, why, and how to avoid it.\n\n- ! For each pitfall: **what happens**, **why it happens**, **how to avoid it**, **warning signs**\n- ~ Informed by library docs, codebase patterns, and known failure modes\n- ~ Prioritize pitfalls that agents specifically tend to hit (stubs, missing error handling, hardcoded values)\n\n**Example narrative content:**\n```\nPitfall: Storing plain-text passwords\nWhat: User passwords saved without hashing\nWhy: Agent implements the happy path and forgets security\nAvoid: Use bcrypt/argon2, never store raw passwords\nWarning signs: No crypto import in auth module, password field stored as-is\n```\n\n### `IPRisk` narrative (#738)\n\n! When the project description, the `Don't Hand-Roll` survey, or the\nresearch notes reference third-party intellectual property (IP), the\nresearch phase MUST run the IP-risk heuristic from\n[`../references/ip-risk.md`](../references/ip-risk.md) -- canonical\nimplementation `scripts/ip_risk.py:detect_ip_terms` -- and persist a\nplain-English `IPRisk` narrative on the research vBRIEF.\n\nThe heuristic is permissive on purpose: recognizable IP names (Magic:\nThe Gathering, Pokemon, etc.), fictional-universe terms (Hogwarts,\nTatooine), branded characters, sports leagues, and trademarked products\nall trigger a hit.\n\n- ! When `detect_ip_terms` returns at least one hit, the research output\n MUST: (1) ask the explicit monetization-intent question (personal vs\n commercial); (2) emit `plain_risk_summary(hits, intent)` into the\n `IPRisk` narrative; (3) plan to inject the protection scope items\n (`ip_risk_scope_items(intent)`) at SPECIFICATION-generation time.\n- ! On `commercial` intent, surface the **non-optional** lawyer-\n consultation recommendation in the research output -- this carries\n forward into the interview output and the SPECIFICATION via the\n `IPRisk` narrative.\n- ⊗ Treat the absence of detected terms as proof that the project is\n IP-free. The heuristic only knows about the curated lists; when the\n research scope is vague, ask the user directly whether the project is\n based on a game / film / sports league / brand.\n- ⊗ Provide legal advice -- Deft is not a law firm. The only\n recommendation it makes is **consult a lawyer**.\n\n---\n\n## How Research Feeds Downstream\n\n- ! **Planning** reads research before task decomposition — acceptance criteria account for pitfalls\n- ! **Execution** references \"Don't Hand-Roll\" — agent uses recommended libraries, not custom code\n- ~ **Verification** checks for pitfall warning signs during stub detection\n\n## Research Scope Rules\n\n- ! Research the **current feature only** — not the entire project\n- ! Time-box research — if it takes longer than the feature, scope is wrong\n- ⊗ Research as a reason to delay execution indefinitely\n- ~ Research persists as a vBRIEF in `vbrief/proposed/`\n\n---\n\n## Then: Chaining Gate\n\nAfter research is complete, return to the [chaining gate](./interview.md#chaining-gate)\nso the user can run additional preparatory strategies or proceed to spec generation.\n\n- ! On completion, register artifacts in `./vbrief/plan.vbrief.json`:\n - Update `completedStrategies`: increment `runCount` for `\"research\"`,\n append artifact path (`vbrief/proposed/{feature}-research.vbrief.json`)\n - Append the path to the flat `artifacts` array\n- ! Return to [interview.md Chaining Gate](./interview.md#chaining-gate)\n- ! The research findings MUST inform subsequent strategies and spec generation:\n - \"Don't Hand-Roll\" items become constraints in the specification\n - \"Common Pitfalls\" become acceptance criteria or NFRs\n- ⊗ End the session after research without returning to the chaining gate\n or the invoking strategy's next-step menu\n\n! **Standalone context:** If invoked from a standalone strategy (e.g. map's\n standalone next-step menu) rather than from the interview chaining gate,\n return to the invoking strategy's menu instead.\n\n---\n\n## Workflow\n\n1. **Scope** -- Identify the domain and feature boundaries for research\n2. **Survey** -- Check existing project dependencies, official docs, and known pitfalls\n3. **Document** -- Produce `vbrief/proposed/{feature}-research.vbrief.json` with `DontHandRoll` and `CommonPitfalls` narratives\n4. **Chain** -- Return to [interview.md Chaining Gate](./interview.md#chaining-gate), or -- if invoked from a standalone strategy (e.g. map's standalone next-step menu) -- return to the invoking strategy's menu per the [standalone-context rule](#then-chaining-gate) above\n\n## Anti-Patterns\n\n- ⊗ Building custom solutions for solved problems\n- ⊗ Skipping research for unfamiliar domains (\"how hard can auth be?\")\n- ⊗ Research that produces a reading list instead of actionable guidance\n- ⊗ Research that doesn't flow into planning (written and never referenced)\n- ⊗ Ending after research without chaining into specification generation (chained mode; in standalone context, returning to the invoking strategy's menu satisfies the completion requirement per the [standalone-context rule](#then-chaining-gate))\n"
|
|
124
|
+
"body": "# Research Strategy\n\nLook before you leap — investigate the domain before planning.\n\nLegend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.\n\n**⚠️ See also**: [strategies/interview.md](./interview.md) | [strategies/discuss.md](./discuss.md) | [strategies/map.md](./map.md)\n\n> Adapted from [GSD](https://github.com/gsd-build/get-shit-done) research phase.\n\n---\n\n## When to Use\n\n- ~ Before planning a feature in an unfamiliar domain (auth, payments, real-time, etc.)\n- ~ When the feature involves libraries or APIs the agent hasn't used in this project\n- ? Skip for well-understood domains where the agent has strong existing context\n\n## Scope Confirmation Gate (#1273)\n\n! Before autonomous research begins, present one blocking scope-confirmation prompt and wait for the user's selection. Use the deterministic question contract: the final two numbered options MUST be `Discuss` and `Back`.\n\nPrompt:\n> \"What should this research focus on before I investigate autonomously?\"\n\n1. Confirm the inferred feature/domain scope (Recommended)\n2. Refine the feature boundary or priority areas\n3. Provide sample data, artifacts, constraints, or sensitive areas to account for\n4. Discuss\n5. Back\n\n- ! **Confirmed-scope postcondition (required before survey):** research MUST NOT start the survey until a confirmed research scope is recorded in notes. Confirmation is achieved by **any** of: option **1** (accept inferred scope as-is), or option **2**/**3** after free-form capture (the free-form answer **is** the confirmation of scope — it replaces option-1 confirmation; do not re-open option 1 after capture).\n- ! On option **1** (confirm inferred scope): record the inferred feature/domain as the confirmed research scope and proceed to the survey step.\n- ! On option **2** (refine boundary): ask a **follow-up free-form question** in the next message (one question only) to capture the refined feature boundary or priority areas; wait for the user's answer; record that free-form text as the **confirmed** research scope; then proceed to survey. ⊗ Proceed to survey after option 2 without collecting free-form refinement text. ⊗ Leave research blocked after option 2 with no follow-up path.\n- ! On option **3** (artifacts/constraints/sensitivity): ask a **follow-up free-form question** in the next message (one question only) for sample data paths, artifacts to analyze, constraints, or sensitive areas; wait for the user's answer; record provided artifacts/constraints/sensitivity flags **and** treat the current feature/domain (plus those inputs) as the **confirmed** research scope; then proceed to survey. ⊗ Proceed to survey after option 3 without collecting free-form artifact/constraint input. ⊗ Leave research blocked after option 3 with no follow-up path.\n- ! If the user declines free-form input after option 2 or 3 (empty answer / \"skip\" / \"none\"): re-present the Scope Confirmation Gate once; if they pick option **1**, confirm inferred scope and proceed; if they again decline capture without confirming, stop research and return to the chaining gate or invoking menu — do not survey on unconfirmed scope.\n- ! Record the confirmed scope, any provided artifacts, and any sensitivity flags in the research notes before the survey step.\n- ⊗ Start the survey from project description alone without a confirmed research scope (option 1 acceptance or option 2/3 free-form confirmation).\n\n## Output\n\n! Before writing output artifacts, follow the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light).\n\nProduce `vbrief/proposed/{feature}-research.vbrief.json` with two mandatory narratives:\n\n! After emitting this scope vBRIEF, surface the GitHub-issue tracking hint from [emit-hints.md](./emit-hints.md) — name all three patterns (none / `--umbrella` / `--per-vbrief`).\n\n### `DontHandRoll` narrative\n\nProblems that look simple but have existing, battle-tested solutions.\n\n- ! For each problem area, specify: **problem**, **recommended library/tool**, **why not hand-roll**\n- ! Check the project's existing dependencies first -- don't add a library when one is already available\n- ~ Consult official docs for the recommended library (use Context7 or equivalent)\n\n**Example narrative content:**\n```\nProblem: JWT validation\nUse: jose\nRationale: Edge cases in token expiry, key rotation, algorithm confusion\n\nProblem: Email templates\nUse: react-email\nRationale: HTML email rendering is notoriously broken across clients\n\nProblem: Rate limiting\nUse: express-rate-limit\nRationale: IP spoofing, distributed state, Redis integration\n```\n\n### `CommonPitfalls` narrative\n\nWhat goes wrong in this domain, why, and how to avoid it.\n\n- ! For each pitfall: **what happens**, **why it happens**, **how to avoid it**, **warning signs**\n- ~ Informed by library docs, codebase patterns, and known failure modes\n- ~ Prioritize pitfalls that agents specifically tend to hit (stubs, missing error handling, hardcoded values)\n\n**Example narrative content:**\n```\nPitfall: Storing plain-text passwords\nWhat: User passwords saved without hashing\nWhy: Agent implements the happy path and forgets security\nAvoid: Use bcrypt/argon2, never store raw passwords\nWarning signs: No crypto import in auth module, password field stored as-is\n```\n\n### `IPRisk` narrative (#738)\n\n! When the project description, the `Don't Hand-Roll` survey, or the\nresearch notes reference third-party intellectual property (IP), the\nresearch phase MUST run the IP-risk heuristic from\n[`../references/ip-risk.md`](../references/ip-risk.md) -- canonical\nimplementation `scripts/ip_risk.py:detect_ip_terms` -- and persist a\nplain-English `IPRisk` narrative on the research vBRIEF.\n\nThe heuristic is permissive on purpose: recognizable IP names (Magic:\nThe Gathering, Pokemon, etc.), fictional-universe terms (Hogwarts,\nTatooine), branded characters, sports leagues, and trademarked products\nall trigger a hit.\n\n- ! When `detect_ip_terms` returns at least one hit, the research output\n MUST: (1) ask the explicit monetization-intent question (personal vs\n commercial); (2) emit `plain_risk_summary(hits, intent)` into the\n `IPRisk` narrative; (3) plan to inject the protection scope items\n (`ip_risk_scope_items(intent)`) at SPECIFICATION-generation time.\n- ! On `commercial` intent, surface the **non-optional** lawyer-\n consultation recommendation in the research output -- this carries\n forward into the interview output and the SPECIFICATION via the\n `IPRisk` narrative.\n- ⊗ Treat the absence of detected terms as proof that the project is\n IP-free. The heuristic only knows about the curated lists; when the\n research scope is vague, ask the user directly whether the project is\n based on a game / film / sports league / brand.\n- ⊗ Provide legal advice -- Deft is not a law firm. The only\n recommendation it makes is **consult a lawyer**.\n\n---\n\n## How Research Feeds Downstream\n\n- ! **Planning** reads research before task decomposition — acceptance criteria account for pitfalls\n- ! **Execution** references \"Don't Hand-Roll\" — agent uses recommended libraries, not custom code\n- ~ **Verification** checks for pitfall warning signs during stub detection\n\n## Research Scope Rules\n\n- ! Research the **current feature only** — not the entire project\n- ! Time-box research — if it takes longer than the feature, scope is wrong\n- ⊗ Research as a reason to delay execution indefinitely\n- ~ Research persists as a vBRIEF in `vbrief/proposed/`\n\n---\n\n## Then: Chaining Gate\n\nAfter research is complete, return to the [chaining gate](./interview.md#chaining-gate)\nso the user can run additional preparatory strategies or proceed to spec generation.\n\n- ! On completion, register artifacts in `./vbrief/plan.vbrief.json`:\n - Update `completedStrategies`: increment `runCount` for `\"research\"`,\n append artifact path (`vbrief/proposed/{feature}-research.vbrief.json`)\n - Append the path to the flat `artifacts` array\n- ! Return to [interview.md Chaining Gate](./interview.md#chaining-gate)\n- ! Present the chaining gate as a blocking question and wait for a user selection before any spec generation or additional scope vBRIEF generation.\n- ! Explain at handoff that `completedStrategies` records that research ran, while `vbrief/proposed/{feature}-research.vbrief.json` remains a planning artifact in the scope lifecycle until a later strategy promotes or consumes it.\n- ! The research findings MUST inform subsequent strategies and spec generation:\n - \"Don't Hand-Roll\" items become constraints in the specification\n - \"Common Pitfalls\" become acceptance criteria or NFRs\n- ⊗ Generate implementation scope vBRIEFs directly from research findings or proceed to spec generation before the user chooses from the chaining gate.\n- ⊗ End the session after research without returning to the chaining gate\n or the invoking strategy's next-step menu\n\n! **Standalone context:** If invoked from a standalone strategy (e.g. map's\n standalone next-step menu) rather than from the interview chaining gate,\n return to the invoking strategy's menu instead.\n\n---\n\n## Workflow\n\n1. **Scope confirmation** -- Ask the blocking scope-confirmation prompt, wait for the user, and record scope/artifact/sensitivity inputs\n2. **Survey** -- Check existing project dependencies, official docs, and known pitfalls\n3. **Document** -- Produce `vbrief/proposed/{feature}-research.vbrief.json` with `DontHandRoll` and `CommonPitfalls` narratives\n4. **Chain** -- Return to [interview.md Chaining Gate](./interview.md#chaining-gate), or -- if invoked from a standalone strategy (e.g. map's standalone next-step menu) -- return to the invoking strategy's menu per the [standalone-context rule](#then-chaining-gate) above\n\n## Anti-Patterns\n\n- ⊗ Building custom solutions for solved problems\n- ⊗ Skipping research for unfamiliar domains (\"how hard can auth be?\")\n- ⊗ Starting autonomous research before the Scope Confirmation Gate has captured or explicitly skipped user-provided artifacts/constraints\n- ⊗ Research that produces a reading list instead of actionable guidance\n- ⊗ Research that doesn't flow into planning (written and never referenced)\n- ⊗ Ending after research without chaining into specification generation (chained mode; in standalone context, returning to the invoking strategy's menu satisfies the completion requirement per the [standalone-context rule](#then-chaining-gate))\n"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
"id": "roadmap",
|
|
@@ -19,7 +19,7 @@ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
|
19
19
|
|
|
20
20
|
**See also**: [deft-directive-review-cycle](../deft-directive-review-cycle/SKILL.md) | [deft-directive-build](../deft-directive-build/SKILL.md) | [RWLDL tool](../../tools/RWLDL.md)
|
|
21
21
|
|
|
22
|
-
> **Formerly `deft-rwldl`** -- renamed to
|
|
22
|
+
> **Formerly `deft-rwldl`** -- renamed and scoped to PR readiness. For the broader iterative quality improvement loop (micro/macro review), see [tools/RWLDL.md](../../tools/RWLDL.md).
|
|
23
23
|
|
|
24
24
|
## Branch-Protection Policy Guard
|
|
25
25
|
|
|
@@ -64,7 +64,7 @@ task verify:plan-sequence -- --target-kind <entry-kind> --target <entry-id>
|
|
|
64
64
|
|
|
65
65
|
> **Invariant:** every change MUST pass the full gate at least once before merge. Pre-PR is the merge chokepoint — NOT every iteration commit.
|
|
66
66
|
|
|
67
|
-
- ! **Iteration lane (Phases 2–3 loop):** use affected/static gates on changed paths — `vitest run --coverage <paths>`, relevant `verify:*` on touched files, `task coverage:hotspots` — instead of full `task check` on every
|
|
67
|
+
- ! **Iteration lane (Phases 2–3 loop):** use affected/static gates on changed paths — `vitest run --coverage <paths>`, relevant `verify:*` on touched files, `task coverage:hotspots` — instead of full `task check` on every pre-PR iteration.
|
|
68
68
|
- ! **Merge chokepoint (Phase 3 Lint exit + final confirm):** run full `task check` once before push/PR; Phase 3c targeted coverage precedes but does not replace the full gate.
|
|
69
69
|
- ! **Escape-rate safety (#1703 Tier-1):** before recommending fleet-wide fast-lane tightening, cite `#1703` Tier-1 telemetry (`helped/crud-metrics.jsonl`) and `task eval:health` — do NOT invent a separate escape-rate surface.
|
|
70
70
|
- ~ **In-engine incrementality (#1713):** content-hash cache + runner-delegated affected selection are sibling work (#1713).
|
|
@@ -74,7 +74,7 @@ task verify:plan-sequence -- --target-kind <entry-kind> --target <entry-id>
|
|
|
74
74
|
|
|
75
75
|
- ! Before pushing a branch for PR creation
|
|
76
76
|
- ! After completing implementation but before the final merge-chokepoint `task check` (#1704)
|
|
77
|
-
- ~ After addressing bot reviewer findings (run one
|
|
77
|
+
- ~ After addressing bot reviewer findings (run one pre-PR pass before pushing the fix batch)
|
|
78
78
|
- ? During mid-implementation checkpoints on large changes
|
|
79
79
|
|
|
80
80
|
## Loop Phases
|
|
@@ -92,6 +92,9 @@ Each iteration proceeds through all phases in order. Do NOT skip phases or reord
|
|
|
92
92
|
- ! When strengthening a rule (e.g. upgrading `~` to `!`), grep for the term in the full file and verify no weaker-strength duplicate remains
|
|
93
93
|
- ~ Note any inconsistencies, missing RFC2119 markers, stale cross-references, or incomplete sections
|
|
94
94
|
- ~ Check that CHANGELOG.md entries match the actual changes made
|
|
95
|
+
- ! If the change alters **user-visible behavior**, apply [coding/docs.md](../../coding/docs.md) (#447): update the matching user-facing surface (CHANGELOG when user/operator-visible, CLI help / commands.md for new or changed verbs/flags, README/getting-started for install/first-run, skill/strategy triggers when entry points change) in this PR
|
|
96
|
+
- ⊗ Claim documentation was updated without those files in the diff
|
|
97
|
+
- ~ Pure internal refactors with no user-visible behavior change do not require user-facing doc updates
|
|
95
98
|
|
|
96
99
|
### Phase 2 -- Write
|
|
97
100
|
|
|
@@ -107,7 +110,7 @@ Each iteration proceeds through all phases in order. Do NOT skip phases or reord
|
|
|
107
110
|
|
|
108
111
|
! Run the merge-chokepoint gate and fix any failures (#1704).
|
|
109
112
|
|
|
110
|
-
- ! Run full `task check` (fmt + lint + typecheck + tests + coverage + verify:*) — the merge chokepoint, not every
|
|
113
|
+
- ! Run full `task check` (fmt + lint + typecheck + tests + coverage + verify:*) — the merge chokepoint, not every pre-PR iteration
|
|
111
114
|
- ! Fix all failures before proceeding to Phase 3b
|
|
112
115
|
- ~ If a lint fix requires changing a file, that counts as a change for the Loop phase
|
|
113
116
|
|
|
@@ -169,7 +172,7 @@ After exiting:
|
|
|
169
172
|
|
|
170
173
|
## Anti-Patterns
|
|
171
174
|
|
|
172
|
-
- ⊗ Submit a PR without running
|
|
175
|
+
- ⊗ Submit a PR without running this pre-PR loop (Read-Write-Lint-Diff) -- every PR branch should pass at least one full cycle
|
|
173
176
|
- ⊗ Exit the loop after the Lint phase without completing the Diff phase -- Diff catches scope creep and unintended changes that Lint cannot detect
|
|
174
177
|
- ⊗ Skip the Read phase and jump directly to Lint -- Read catches semantic issues (missing content, wrong RFC2119 markers, incomplete acceptance criteria) that linters do not check
|
|
175
178
|
- ⊗ Make out-of-scope fixes during Write -- this introduces scope creep that Diff will flag, forcing another iteration
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deft-directive-review-cycle
|
|
3
3
|
description: >-
|
|
4
|
-
Greptile /
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
babysit on Deft-managed repos (#2261).
|
|
4
|
+
Greptile / GitHub adapter for coding/review.md: babysit a PR to merge-ready
|
|
5
|
+
— audit process prerequisites, fetch bot findings, fix in one batch commit,
|
|
6
|
+
exit when no P0/P1 remain. Supersedes Cursor global babysit on Deft-managed
|
|
7
|
+
repos (#2261 / #1471).
|
|
9
8
|
---
|
|
10
9
|
<!-- AUTO-GENERATED by task packs:render -- DO NOT EDIT MANUALLY -->
|
|
11
10
|
<!-- Purpose: rendered skill -->
|
|
@@ -19,6 +18,14 @@ Structured workflow for responding to bot reviewer (Greptile) findings on a PR.
|
|
|
19
18
|
|
|
20
19
|
Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
21
20
|
|
|
21
|
+
## Principle Authority (#1471 / #212)
|
|
22
|
+
|
|
23
|
+
! Universal review-cycle principles live in [`coding/review.md`](../../coding/review.md) (RFC2119): read-all-findings, severity P0/P1/P2 + merge-blocking semantics, single batch commit, cross-file grep of changed terms, local structured-data validation (SHOULD), no push mid-review, exit when no P0/P1 remain (P2 non-blocking), and post-merge closing-keyword verification.
|
|
24
|
+
|
|
25
|
+
! This skill is the **Greptile + GitHub adapter** only: polling cadence, confidence-score thresholds, check-run detection, dual-source fetch (`gh` + MCP) for Comments Outside Diff, fail-closed Step 6 `ReviewerStatus`, review-monitor lease, and merge gates. Apply `coding/review.md` for the process; do not restate that principle list inline.
|
|
26
|
+
|
|
27
|
+
~ Future adapters (CodeRabbit, Codacy, host babysit) SHOULD implement the same `coding/review.md` principles with their own mechanics.
|
|
28
|
+
|
|
22
29
|
## Platform Requirements
|
|
23
30
|
|
|
24
31
|
! This skill requires **GitHub** as the SCM platform and the **GitHub CLI (`gh`)** to be installed and authenticated. PR comment fetching, check-run queries, and review submission all depend on `gh`.
|
|
@@ -97,7 +104,7 @@ gh api repos/<owner>/<repo>/commits/<sha>/check-runs --jq '.check_runs[] | selec
|
|
|
97
104
|
|
|
98
105
|
! Before touching code, verify ALL prerequisites are satisfied. Fix any gaps first:
|
|
99
106
|
|
|
100
|
-
1. ! Verify `skills/deft-directive-pre-pr/SKILL.md` was run before PR creation -- the PR branch should have passed at least one full
|
|
107
|
+
1. ! Verify `skills/deft-directive-pre-pr/SKILL.md` was run before PR creation -- the PR branch should have passed at least one full pre-PR cycle (Read-Write-Lint-Diff). If not, run it now before proceeding.
|
|
101
108
|
2. ! `PROJECT-DEFINITION.xbrief.json` and `xbrief/` lifecycle folders have scope xBRIEF coverage for all changes in the PR
|
|
102
109
|
3. ! `CHANGELOG.md` has entries under `[Unreleased]` for the PR's changes
|
|
103
110
|
4. ! `task check` passes fully (fmt + lint + typecheck + tests + coverage ≥75%)
|
|
@@ -147,16 +154,13 @@ Both commands extract the "Comments Outside Diff" section with surrounding conte
|
|
|
147
154
|
|
|
148
155
|
### Step 2: Analyze ALL findings before changing anything
|
|
149
156
|
|
|
150
|
-
!
|
|
157
|
+
! Apply [`coding/review.md`](../../coding/review.md) before any code change: read **all** findings, classify P0/P1/P2, and plan **one** batch. Do not start per-finding fixes mid-read.
|
|
158
|
+
|
|
159
|
+
Greptile adapter analysis extras:
|
|
151
160
|
|
|
152
|
-
- Read every finding across all files
|
|
153
161
|
- Identify cross-file dependencies (a term, value, or field mentioned in multiple files)
|
|
154
|
-
- Categorize by severity (P0, P1, P2 — where P0 is critical/blocking, P1 is a real defect, P2 is a style or non-blocking suggestion)
|
|
155
|
-
- Plan a single coherent batch of fixes
|
|
156
162
|
- ! **Scope-check each finding against the active story xBRIEF** (`plan.items[].narrative.Acceptance`) before coding — see Out-of-AC gate (#2881) below
|
|
157
163
|
|
|
158
|
-
⊗ Start fixing individual findings as you encounter them.
|
|
159
|
-
|
|
160
164
|
### Out-of-AC findings / active-story scope gate (#2881)
|
|
161
165
|
|
|
162
166
|
Babysit and review-cycle are **not** a second unbounded implementation mandate. When Greptile (or another reviewer) raises design-adjacent work outside the active story's acceptance criteria, default to follow-up — not silent redesign mid-babysit (PR #2871 / #2869 → #2880 recurrence).
|
|
@@ -188,10 +192,10 @@ Babysit and review-cycle are **not** a second unbounded implementation mandate.
|
|
|
188
192
|
|
|
189
193
|
### Step 3: Fix all findings in ONE batch commit
|
|
190
194
|
|
|
191
|
-
! Apply
|
|
195
|
+
! Apply [`coding/review.md`](../../coding/review.md) single-batch, cross-file grep, and local structured-data validation rules. Land **all** in-scope fixes in one commit (or one intentional batch), never per-finding pushes.
|
|
196
|
+
|
|
197
|
+
Greptile adapter pre-commit gate:
|
|
192
198
|
|
|
193
|
-
- ! For any fix that touches a value, term, or field appearing in multiple files: grep for it across the full PR file set and update every occurrence in the same commit
|
|
194
|
-
- ! Validate structured data files locally before committing (e.g. `python3 -m json.tool` for JSON, YAML lint for YAML) — do not rely on the bot to catch syntax errors
|
|
195
199
|
- ! Before committing any Greptile fix, re-read the FULL current Greptile review and confirm all P0/P1 issues are addressed in the staged changes — this is the pre-commit gate that prevents per-finding fix commits
|
|
196
200
|
- ! Run `task check` before committing
|
|
197
201
|
- ! **Fail-loud completion claim (#1006)**: when reporting fix-batch completion (to the user, in the commit message, in a PR comment, or in a status message to a parent agent), MUST surface the OUTCOMES not the intent -- name the P0/P1 finding count addressed ("addressed 3/3 P0 findings, 2/2 P1 findings, 0 deferred" -- NOT "all findings addressed"), report the `task check` result with the test-collection counts ("task check: 412 collected, 412 passed, 0 skipped, 0 xfailed" -- NOT "task check passed"), and explicitly call out any finding intentionally deferred with the reason. Apply `coding/coding.md` `## Fail Loud: Completion Claims Require Outcome Verification (#1006)` to every claim emitted during the review cycle
|
|
@@ -200,8 +204,6 @@ Babysit and review-cycle are **not** a second unbounded implementation mandate.
|
|
|
200
204
|
- ? **Pre-existing failure carve-out**: If `task check` fails due to a pre-existing issue unrelated to the PR's changes, a partial test suite run is acceptable ONLY if BOTH conditions are met: (a) the `task check` failure is pre-existing with an open GitHub issue number tracking it, AND (b) the PR description explicitly notes the failure and includes the issue reference (e.g. "task check: test_foo fails due to #NNN (pre-existing)"). Without both conditions, the full `task check` pass remains mandatory.
|
|
201
205
|
- ~ Commit message: `fix: address Greptile review findings (batch)`
|
|
202
206
|
|
|
203
|
-
⊗ Push individual fix commits per finding — always batch.
|
|
204
|
-
|
|
205
207
|
### Step 3b: Proactive test coverage scan
|
|
206
208
|
|
|
207
209
|
! After committing the fix batch but before pushing, scan the changed lines for untested code paths:
|
|
@@ -221,7 +223,9 @@ Babysit and review-cycle are **not** a second unbounded implementation mandate.
|
|
|
221
223
|
|
|
222
224
|
! After pushing, the agent MUST autonomously poll for review updates and continue the review cycle without stopping to ask the user. Do not pause for confirmation, do not ask "should I continue?", do not wait for user input between push and review completion. The review/fix loop is designed to run to the exit condition without human intervention.
|
|
223
225
|
|
|
224
|
-
|
|
226
|
+
! Mid-review push rule: see [`coding/review.md`](../../coding/review.md) (no push while review in progress). Adapter rationale: every push re-triggers Greptile and resets the review clock.
|
|
227
|
+
|
|
228
|
+
⊗ Push any additional commits — including unrelated fixes, doc updates, or lessons — while waiting for the bot to finish reviewing the current head. If you discover additional work while waiting, stage it locally but do NOT push until the current review completes.
|
|
225
229
|
|
|
226
230
|
|
|
227
231
|
|
|
@@ -266,7 +270,7 @@ Remediation:
|
|
|
266
270
|
- `gh pr checks <N>`
|
|
267
271
|
- `gh api repos/<owner>/<repo>/pulls/<N> -q .head.sha` for HEAD pin
|
|
268
272
|
- `gh api repos/<owner>/<repo>/commits/<sha>/check-runs` for Greptile terminal check-run
|
|
269
|
-
5. Evaluate the same Step 6 fail-closed all-of (terminal check-run + HEAD SHA + Last reviewed commit + confidence
|
|
273
|
+
5. Evaluate the same Step 6 fail-closed all-of (terminal check-run + HEAD SHA + Last reviewed commit + confidence meets resolved min (policy/dogfood/default; see Step 6 #3095) + no P0/P1).
|
|
270
274
|
6. Surface missing-task once to the operator/parent on first detection; do not silently rebrand freestyle sleep as `pr:watch`.
|
|
271
275
|
|
|
272
276
|
⊗ Fake a successful `pr:watch` or `review-monitor:*` gate when every dual-invoke probe failed.
|
|
@@ -274,7 +278,7 @@ Remediation:
|
|
|
274
278
|
⊗ Invent ad-hoc `sleep` / main-session poll / OpenClaw cron loops outside Approach 1–3 when the skill already names this fallback (#2878 / statusreport#153 recurrence).
|
|
275
279
|
⊗ Skip Step 6 fail-closed fields because deterministic tasks are missing — the gh surfaces above remain mandatory.
|
|
276
280
|
|
|
277
|
-
! When `clean_gate_holdout=ci_failures` and Greptile otherwise satisfies the probe-side Step 6 fields (SHA match on HEAD, confidence
|
|
281
|
+
! When `clean_gate_holdout=ci_failures` and Greptile otherwise satisfies the probe-side Step 6 fields (SHA match on HEAD, confidence meets resolved min (policy/dogfood/default; see Step 6 #3095), no P0/P1, not errored): **MUST NOT** idle-poll hoping CI heals. Treat Greptile CLEAN + CI red with the **same ownership** as a Greptile P0 for a merge-ready worker — one fix batch, re-push, re-probe.
|
|
278
282
|
|
|
279
283
|
! On persistent `ci_failures` holdout: exit the Greptile wait immediately, fetch failing check annotations (`gh pr checks <N>`, CodeQL / required-check details, or `ci_failed_checks` from `pr:watch --json`), fix or escalate with evidence, then re-enter the review loop after CI is green.
|
|
280
284
|
|
|
@@ -320,6 +324,35 @@ Remediation:
|
|
|
320
324
|
|
|
321
325
|
⊗ Treat a stall as silent -- if the elapsed clock crosses the 10-minute threshold the agent MUST surface the menu, even if the agent is mid-poll. Continuing to poll past the threshold without user input is forbidden.
|
|
322
326
|
|
|
327
|
+
### Owner Continuity Gate (#3090)
|
|
328
|
+
|
|
329
|
+
! After any claim of `drive-to: merge-ready`, babysit, shepherd, or "driving review-cycle / merge" on an **open PR**, the **same turn** MUST end in exactly one of:
|
|
330
|
+
|
|
331
|
+
- **A.** Approach 1 monitor live + sticky `<!-- deft:review-owner -->` lease registered (or #2878 gh-only lease equivalent). Parent yields with an **active** child / monitor and emits `review_cycle: in_progress:<pr>#<monitor_or_lease_ref>`.
|
|
332
|
+
- **B.** Parent-retained ownership: parent does **not** mark the work complete; the next concrete action is an explicit dual-source poll/fix (Step 1 + Step 6). Emit `review_cycle: in_progress:<pr>#parent-retained` (or lease id when a sticky lease exists).
|
|
333
|
+
- **C.** Explicit finish to caller/principal: `BLOCKED` / needs decision / `FAILED` with PR URL + HEAD SHA + why. Emit `review_cycle: skipped:<reason>` or keep `in_progress` only when a live owner remains; never freeform `started`.
|
|
334
|
+
|
|
335
|
+
! **`review_cycle` evidence enum (portable — all consumers / handoffs / preamble §11 / swarm finish messages):** **only**
|
|
336
|
+
- `done` — Step 6 fail-closed all-of met on current HEAD (terminal check + HEAD pin + confidence bar + **0 P0/P1** via **dual-source**)
|
|
337
|
+
- `in_progress:<pr>#<monitor_or_lease_ref>` — verifiable sticky lease, registered monitor id, or documented `parent-retained` ownership
|
|
338
|
+
- `skipped:<reason>` — intentional skip (e.g. no-pr, operator cancel)
|
|
339
|
+
- `n/a` — work never entered review-cycle
|
|
340
|
+
|
|
341
|
+
! Layer **L4** `status: pass` (or equivalent process-green handoff) is **illegal** unless `review_cycle: done` **or** `review_cycle: in_progress:…` with **verifiable** sticky lease / parent-retained ownership documented on that turn.
|
|
342
|
+
|
|
343
|
+
! Opening a PR may use `in_progress` + lease; the **merge path** requires `done` (stricter product merge bars remain out of scope).
|
|
344
|
+
|
|
345
|
+
! When dual-source fetch shows open P0/P1 under Step 6 / CLEAN evaluation: continue the fix loop **or** exit **BLOCKED** to the parent — never idle.
|
|
346
|
+
|
|
347
|
+
! Optional machine gate: `deft verify:l4-owner --pr <N>` (or `task verify:l4-owner -- --pr <N>`; dual-invoke same order as other gates). Exit **0** only when a sticky lease is fresh on the PR **or** the caller asserts `--review-cycle done` after Step 6 (lease-or-done machine gate). `skipped` / `n/a` / parent-retained are process evidence only and do **not** satisfy this machine gate. Exit **1** on silent hold (no lease, no done). Pair with existing monitor-without-lease regression (#2797).
|
|
348
|
+
|
|
349
|
+
⊗ End an owning turn with **0 children**, **no sticky lease**, and **no finish signal** after a drive-to-merge / babysit / shepherd claim (**silent hold**).
|
|
350
|
+
⊗ Treat check-run **SUCCESS alone** as CLEAN or merge-ready while dual-source P0/P1 remain open.
|
|
351
|
+
⊗ Emit freeform `review_cycle: started` / `pending` / `initiated` or L4 `status: pass` without **A** (or parent-retained **B** with explicit next action) or full Step 6 `done`.
|
|
352
|
+
⊗ Solve Owner Continuity via host cron-as-Approach-1 or always-block-parent-until-merge — use A/B/C above (#2876 / #3090).
|
|
353
|
+
|
|
354
|
+
~ **Eval / regression (#3090):** Given PR open + check SUCCESS + open inline P1s + agent text claims driving merge + turn ends with 0 subagents and no lease → **FAIL** (Owner Continuity Gate), not PASS.
|
|
355
|
+
|
|
323
356
|
### Review Monitoring
|
|
324
357
|
! **Background / independent dispatch (#1880 Gap D):** Long-running review-cycle owners and pollers (>~3 min) MUST be dispatched independently / in the background so the parent conversation stays interactive. On Cursor, use the Task tool background path (`run_in_background: true`). This generalizes the Approach-1 sub-agent monitor rule to implementation and fix workers as well — foreground dispatch is reserved for short tasks. The parent receives completion via `DONE` / `BLOCKED` / `FAILED` per `templates/agent-prompt-preamble.md` §11.
|
|
325
358
|
|
|
@@ -368,7 +401,7 @@ Remediation:
|
|
|
368
401
|
|
|
369
402
|
1. ! Launch via the matching primitive: `start_agent` (Warp), `spawn_subagent` (grok-build / TUI / non-Warp), the Cursor `Task` tool with `run_in_background: true` (`cursor-composer` / `cursor-cloud-agent`, #1877), **or OpenClaw `sessions_spawn` (`openclaw`, #2876)** with a prompt that instructs it to poll for Greptile completion. For `spawn_subagent`, Cursor `Task`, and OpenClaw `sessions_spawn` the prompt MUST reference the canonical poller template `templates/swarm-greptile-poller-prompt.md` (with placeholders filled) plus the agent preamble; the working directory / context must be the PR branch (worktree or equivalent for hybrid).
|
|
370
403
|
2. ! The sub-agent polls using the mechanism for its primitive: for `spawn_subagent` use `get_command_or_subagent_output` (adaptive cadence: ~20-30s first check after push, ~60s second, ~90s thereafter; Greptile typically lands in 3-7 min); for `start_agent` the native messaging path; for the Cursor `Task` tool the backgrounded-task completion-notification path; for OpenClaw `sessions_spawn` the host session completion / messaging channel (prefer `task pr:watch` inside the child when available). Front-load the first check to catch fast reviews.
|
|
371
|
-
3. ! When the exit condition is met (Greptile review current on the HEAD commit SHA, confidence
|
|
404
|
+
3. ! When the exit condition is met (Greptile review current on the HEAD commit SHA, confidence meets resolved min (policy/dogfood/default; see Step 6 #3095), no P0/P1 remaining), the sub-agent reports completion back to the parent (via `send_message_to_agent`, the spawn_subagent result channel, or the OpenClaw sessions completion channel).
|
|
372
405
|
4. ! The main conversation pane stays fully interactive during monitoring -- the user (or parent monitor) can continue other work.
|
|
373
406
|
5. ! On receiving the completion message / result, the parent re-fetches findings (both gh pr view --comments and the secondary source) and proceeds to Step 5.
|
|
374
407
|
|
|
@@ -385,6 +418,11 @@ Remediation:
|
|
|
385
418
|
|
|
386
419
|
~ Recurrence: enterprize PR #43 (2026-08-02) — first monitor polled live, host settled empty/unknown; parent spawned a second same-`taskName` monitor; dual lease collision while PR stayed open. See also `meta/lessons.md` and FC04 / growth friction R1 + R10.
|
|
387
420
|
|
|
421
|
+
|
|
422
|
+
### Completion latch on settle replay (#3092)
|
|
423
|
+
|
|
424
|
+
! **Empty settle** is not a latch hit — use Empty announce ≠ done (#3044) above. When the parent has already emitted **one** consolidate for a monitor/leaf `runId` and the harness re-delivers an **identical or equivalent** non-empty settle for the same key, stay **silent** (no re-QC, no second final; host silent token when defined). Re-open only on new runId, principal reopen, or material new evidence. Full MUST: `templates/agent-prompt-preamble.md` §11.5.
|
|
425
|
+
|
|
388
426
|
### Single review-monitor lease (#3044 / #2814)
|
|
389
427
|
|
|
390
428
|
! **One sticky lease per PR:** ownership is the single sticky GitHub PR comment `<!-- deft:review-owner -->` (or the dual-invoke `review-monitor:register` form that writes it). Parallel ownership is forbidden.
|
|
@@ -448,7 +486,7 @@ NOTES: <short>
|
|
|
448
486
|
- Second check: wait ~60 seconds, then poll
|
|
449
487
|
- Subsequent checks: wait ~90 seconds, then poll
|
|
450
488
|
2. ! Poll using `gh pr view <number> --comments` and `gh pr checks <number>` in the same shell session
|
|
451
|
-
3. ! When the exit condition is met (Greptile review current, confidence
|
|
489
|
+
3. ! When the exit condition is met (Greptile review current, confidence meets resolved min (policy/dogfood/default; see Step 6 #3095), no P0/P1), exit the loop and proceed to Step 5
|
|
452
490
|
4. ! If the user interrupts (Ctrl+C or equivalent), exit gracefully and report current review status
|
|
453
491
|
|
|
454
492
|
! Greptile may advance its review by **editing an existing PR issue comment** rather than creating a new PR review object. Do NOT rely solely on `pulls/{number}/reviews` — that endpoint may remain stale at an older commit SHA even after Greptile has reviewed the latest commit.
|
|
@@ -489,7 +527,7 @@ NOTES: <short>
|
|
|
489
527
|
```
|
|
490
528
|
|
|
491
529
|
A missing or non-matching completion marker is `unknown`. See [`../../templates/swarm-greptile-poller-prompt.md`](../../templates/swarm-greptile-poller-prompt.md) `### Last reviewed commit:` for the canonical regex shared with the push-driven poller loop.
|
|
492
|
-
4. ! **Confidence
|
|
530
|
+
4. ! **Confidence meets resolved min (#3095)** — the parsed `Confidence Score: X/5` is **>=** the resolved floor from `plan.policy.review.minGreptileConfidence` (inspect: `task policy:show --field=minGreptileConfidence`; `pr:watch` / `pr:merge-ready` share this SoT). Resolution order: typed project policy > framework dogfood detect (framework source → **5**) > consumer default (**4**, legacy confidence > 3 / 4/5+). A score below the floor, an unparsed confidence, or an absent confidence is `unknown`. Directive dogfood MUST NOT exit CLEAN on 4/5.
|
|
493
531
|
5. ! **No P0/P1 findings** — the triple-tier (+ Tier 2.5) detector reports zero P0 and zero P1 findings (P2 issues are non-blocking style suggestions and do not gate the loop).
|
|
494
532
|
|
|
495
533
|
! All five fields MUST hold on the SAME single fresh fetch. The agent MUST NOT assemble a "pass" by combining a terminal check-run observed on one poll with a confidence parsed on an earlier poll — the read is atomic per the SHA-pinned-AT-READ-TIME rule above.
|
|
@@ -564,6 +602,8 @@ task lifecycle:event -- emit plan:approved \
|
|
|
564
602
|
|
|
565
603
|
## Post-Merge Verification
|
|
566
604
|
|
|
605
|
+
! Apply [`coding/review.md`](../../coding/review.md) post-merge closing-keyword verification. Adapter HOW for GitHub:
|
|
606
|
+
|
|
567
607
|
! After a PR is squash-merged, verify that all referenced issues were actually closed. Squash merges can silently fail to process closing keywords (`Closes #N`, `Fixes #N`) from the PR body (#167).
|
|
568
608
|
|
|
569
609
|
1. ! For each issue referenced with a closing keyword in the PR body, run:
|
|
@@ -579,6 +619,10 @@ task lifecycle:event -- emit plan:approved \
|
|
|
579
619
|
|
|
580
620
|
## Anti-Patterns
|
|
581
621
|
|
|
622
|
+
- ⊗ End owning turn with 0 children, no sticky lease, and no finish after drive-to-merge / babysit / shepherd claim — silent hold (#3090)
|
|
623
|
+
- ⊗ Emit freeform `review_cycle: started` / `pending` / `initiated` or L4 `status: pass` without `done` or verifiable `in_progress:<pr>#…` lease/parent-retained (#3090)
|
|
624
|
+
- ⊗ Treat check-run SUCCESS alone as CLEAN / merge-ready while dual-source P0/P1 remain (#3090)
|
|
625
|
+
- ⊗ Ignore [`coding/review.md`](../../coding/review.md) while running this adapter — universal batch/severity/exit/post-merge rules live there
|
|
582
626
|
- ⊗ Route PR shepherding to Cursor global `babysit` on Deft-managed repos when `.deft/core/` is installed -- use this review-cycle skill instead (#2261)
|
|
583
627
|
- ⊗ Route OpenClaw babysit/shepherd/watch to main-session gh poll + cron when `sessions_spawn` is available -- use Approach 1 with `sessions_spawn` (#2876 / #2261)
|
|
584
628
|
- ⊗ Treat OpenClaw `cron` alone as Approach 1 — cron/timer is Approach 2 only if spawn is unavailable (#2876)
|
|
@@ -655,7 +655,9 @@ omit = [
|
|
|
655
655
|
- **anything else** (discuss, yolo, speckit, research, brownfield, map, etc.) →
|
|
656
656
|
1. ! Read `deft/strategies/{strategy-name}.md` **right now, in this same turn**
|
|
657
657
|
2. ! Begin the strategy's workflow immediately — ask its first question
|
|
658
|
-
3. !
|
|
658
|
+
3. ! For `research`, the first question is the strategy's Scope Confirmation Gate (#1273); ask it and wait before any autonomous research begins.
|
|
659
|
+
4. ! For `research`, after the research artifact is written, surface the strategy's Then: Chaining Gate and wait for a user selection; do NOT create scope xBRIEFs from research output unless the user later chooses a spec-generating path; do NOT fall through to the interview output path after research.
|
|
660
|
+
5. ! **STOP reading this section** — do NOT use the interview process below
|
|
659
661
|
|
|
660
662
|
- ⊗ Default to interview without reading PROJECT-DEFINITION.xbrief.json
|
|
661
663
|
- ⊗ Continue reading below when PROJECT-DEFINITION.xbrief.json specifies a non-interview strategy
|
|
@@ -760,8 +762,14 @@ Per [strategies/interview.md](../../strategies/interview.md#interview-rules-shar
|
|
|
760
762
|
**Spec Structure (both paths):**
|
|
761
763
|
- ! Overview, Architecture
|
|
762
764
|
- ! Implementation Plan: scope xBRIEFs in `xbrief/proposed/` with phases and dependencies
|
|
763
|
-
- ! Explicit dependency mapping
|
|
765
|
+
- ! Explicit dependency mapping MUST use the field consumers actually read for the scope shape:
|
|
766
|
+
- **Story-shaped scopes** (`plan.metadata.kind = "story"` or scopes intended for swarm allocation / decompose): sequential/blocked work MUST set `plan.metadata.swarm.depends_on` to an array of **resolvable story identifiers**. Swarm readiness, decompose, and queue traversal read **only** this field for story ordering — not `plan.metadata.dependencies` alone. ! Each `depends_on` entry MUST equal the blocking scope's `plan.id` when that field is set; otherwise the blocking artifact's **filename stem** (basename with `.xbrief.json` / `.vbrief.json` stripped — the same stem readiness uses as `story_id`). ⊗ Use rendered titles, free-form prose, date-only prefixes, or unstripped full filenames — those do not resolve and leave the generated scope blocked.
|
|
767
|
+
- **Phase/epic or cross-scope roadmap batches**: MAY also set plan-level `plan.metadata.dependencies` for roadmap/export readers.
|
|
768
|
+
- `edges` / `references` may supplement documentation but **do not** replace `plan.metadata.swarm.depends_on` for sequential story scopes.
|
|
769
|
+
- ! When multiple scopes are produced in one Phase 3 pass, encode machine-readable dependency ordering before finishing the write: independent scopes use empty `plan.metadata.swarm.depends_on` (`[]`); sequential/blocked story scopes use non-empty `plan.metadata.swarm.depends_on`. Optionally mirror the same DAG in `plan.metadata.dependencies` for roadmap views.
|
|
764
770
|
- ~ Scopes designed for parallel work by multiple agents
|
|
771
|
+
- ⊗ Deposit sequential story-shaped scopes with only `plan.metadata.dependencies` / `edges` / `references` and missing `plan.metadata.swarm.depends_on` — orchestration will treat them as independent or reject readiness.
|
|
772
|
+
- ⊗ Deposit multiple generated scope xBRIEFs with no dependency metadata and rely on filenames or human prose for ordering.
|
|
765
773
|
- ! Testing Strategy and Deployment captured in narratives
|
|
766
774
|
- ⊗ Write code — specification only
|
|
767
775
|
|
|
@@ -115,6 +115,12 @@ Large multi-host skills use a **host-neutral core** plus **one** per-host adapte
|
|
|
115
115
|
⊗ Multi-sentence progress-only first response after announce with zero tools / yield (#2943 text-repetition hang).
|
|
116
116
|
⊗ Treat thin DONE (no PR URL / merge evidence) as success (#2943).
|
|
117
117
|
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### Completion latch after first consolidate (#3092)
|
|
121
|
+
|
|
122
|
+
! After the parent emits **one** user/caller-visible consolidate for a child `runId` / settle batch, **identical or equivalent completion replay** for the same key MUST be **silent** (no tools, no re-QC, no second final; host silent token when defined, e.g. OpenClaw `NO_REPLY`). Re-open only on new `runId`/batch, principal explicit reopen, or materially new evidence (new HEAD, new blocker class). Replay storms: at most one fail-loud note, then silent. Full MUST: `templates/agent-prompt-preamble.md` §11.5. Depth: `references/core-phase-5-6.md`. Orthogonal to empty settle ≠ done (#3044).
|
|
123
|
+
|
|
118
124
|
## Runtime Capability Detection (summary)
|
|
119
125
|
|
|
120
126
|
! Before selecting a launch method, probe the environment. Full probe text: [`references/core-phase-3.md`](references/core-phase-3.md).
|
|
@@ -152,6 +158,7 @@ Large multi-host skills use a **host-neutral core** plus **one** per-host adapte
|
|
|
152
158
|
- ⊗ Prose-only phase handoff after cohort complete (“I will spawn…”) (#2934)
|
|
153
159
|
- ⊗ Multi-sentence progress-only first response after leaf announce with zero tools / yield (#2943)
|
|
154
160
|
- ⊗ Treat thin DONE (no PR URL / merge evidence) as success (#2943)
|
|
161
|
+
- ⊗ Second+ user-visible consolidate for the same child runId without new evidence (#3092)
|
|
155
162
|
- ⊗ Assign overlapping files to multiple agents
|
|
156
163
|
- ⊗ Merge before Greptile exit condition (score > 3, no P0/P1)
|
|
157
164
|
- ⊗ Skip Phase 0 approval before Phase 1
|
|
@@ -143,3 +143,5 @@ CONSTRAINTS:
|
|
|
143
143
|
- ⊗ End a cohort phase-boundary turn with only narrative “I will spawn…” / “review next” and zero next-phase tool calls and no explicit terminal status (`blocked` / `awaiting-human` / `done`) (#2934)
|
|
144
144
|
- ⊗ Multi-sentence progress-only first response after leaf completion announce (`subagent_announce` / parent-push) with zero tools / yield — tool-first ground-truth batch or host yield only (#2943 text-repetition hang)
|
|
145
145
|
- ⊗ Treat thin DONE (completion without PR URL / merge evidence) as success — re-dispatch or take over after ground truth (#2943)
|
|
146
|
+
- ⊗ Second+ user-visible consolidate / final for the same child `runId` / settle batch without new evidence or principal reopen — completion latch silent-replay path (`templates/agent-prompt-preamble.md` §11.5 / #3092)
|
|
147
|
+
- ⊗ Full dual-source re-QC solely because the harness re-delivered the same settle event (#3092)
|
|
@@ -37,6 +37,8 @@ For each agent's PR:
|
|
|
37
37
|
|
|
38
38
|
! **Parent tool-first after leaf announce (#2943):** On the first parent turn after a leaf completion event (`subagent_announce` / parent-push / host completion notify), the parent MUST either (a) emit a **tool-first** ground-truth batch (`gh` / `git` / worktree or file status), or (b) **yield** (`sessions_yield` on OpenClaw, or host equivalent). ⊗ Multi-sentence progress-only first response with zero tools / yield — the text-repetition hang class.
|
|
39
39
|
|
|
40
|
+
! **Completion latch after first consolidate (#3092):** After the parent has emitted **one** user/caller-visible consolidate for a child `runId` / settle batch (accept or reject), **identical or equivalent completion replay** for the same key MUST be **silent** (no tools, no re-QC, no second final; host silent token when defined, e.g. OpenClaw `NO_REPLY`). Re-open only on new `runId`/batch, principal explicit reopen, or **materially new** evidence (new HEAD, new blocker class) — not fat re-embeds of the same rollup. Replay storms: at most one fail-loud note, then silent. Full MUST + anti-patterns: `templates/agent-prompt-preamble.md` §11.5. Orthogonal to empty settle ≠ done (#3044).
|
|
41
|
+
|
|
40
42
|
### Complete xBRIEFs
|
|
41
43
|
|
|
42
44
|
! The cohort's story xBRIEFs are completed by the deterministic **cohort completion sweep** in Phase 6 (`task swarm:complete-cohort`, Phase 6 Step 1.5 below), which runs AFTER the merge cascade. Do NOT move story xBRIEFs out of `xbrief/active/` before their PRs merge — a pre-merge move creates premature state if the merge cascade fails. This section is where the monitor records, per story, what the post-merge sweep will finalize:
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deft-directive-xbrief
|
|
3
|
+
description: >-
|
|
4
|
+
Create and verify dense xBRIEF artifacts (json|md|both) at an explicit --out
|
|
5
|
+
path. On-demand pack templates for scope/playbook/mission/project styles.
|
|
6
|
+
Use when compressing SoT into xBRIEF or running xbrief:create /
|
|
7
|
+
xbrief:verify. Do NOT trigger on scope lifecycle
|
|
8
|
+
(promote/activate/complete).
|
|
9
|
+
triggers:
|
|
10
|
+
- xbrief create
|
|
11
|
+
- xbrief verify
|
|
12
|
+
- create xbrief
|
|
13
|
+
- verify xbrief
|
|
14
|
+
- compress into xbrief
|
|
15
|
+
- xbrief:create
|
|
16
|
+
- xbrief:verify
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
<!-- AUTO-GENERATED by task packs:render -- DO NOT EDIT MANUALLY -->
|
|
20
|
+
<!-- Purpose: rendered skill -->
|
|
21
|
+
<!-- Source of truth: packs/skills/skills-pack-0.1.json -->
|
|
22
|
+
<!-- Regenerate with: task packs:render -->
|
|
23
|
+
<!-- Edit the source, not this file. Slice instead of loading every SKILL.md: task packs:slice skills by-trigger --trigger <kw> (or list) -->
|
|
24
|
+
|
|
25
|
+
# Deft Directive xBRIEF — on-demand create/verify
|
|
26
|
+
|
|
27
|
+
Create and verify dense xBRIEF artifacts (json|md|both) at an explicit path. Pack templates load on use — not an always-on novel.
|
|
28
|
+
|
|
29
|
+
Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
30
|
+
|
|
31
|
+
## When to Use
|
|
32
|
+
|
|
33
|
+
- Need a dense SoT brief (scope, playbook, mission, project) without freestyling long prose
|
|
34
|
+
- Operator or agent says `xbrief create`, `xbrief verify`, or `compress into xbrief`
|
|
35
|
+
- ⊗ Scope lifecycle work (promote / activate / complete) — use scope:* / intake instead
|
|
36
|
+
|
|
37
|
+
## How (CLI)
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
deft xbrief:create -- --format <json|md|both> --out <path> [--style scope|playbook|mission|project] [--title T] [--id ID] [--force]
|
|
41
|
+
deft xbrief:verify -- --format <json|md|both> --out <path> [--style scope|playbook|mission|project]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- ! `--format` and `--out` are **required**
|
|
45
|
+
- ! `both` writes a stem pair: `*.xbrief.json` + `*.xbrief.md`
|
|
46
|
+
- ! Paths expand portably (`~`, `%USERPROFILE%`); writes stay under project root (fail closed)
|
|
47
|
+
- ! create/verify **do not** move lifecycle folders
|
|
48
|
+
|
|
49
|
+
## Pack on use
|
|
50
|
+
|
|
51
|
+
- ~ Full grammar + templates: `task packs:slice skills by-trigger --trigger xbrief` (or this skill path)
|
|
52
|
+
- ~ Schema spine: `content/vbrief/schemas/xbrief-core-0.8.schema.json`
|
|
53
|
+
- ⊗ Dump pack novels into always-on bootstrap or into SoT artifacts
|
|
54
|
+
|
|
55
|
+
## Create vs lifecycle
|
|
56
|
+
|
|
57
|
+
| Verb | Meaning |
|
|
58
|
+
|------|---------|
|
|
59
|
+
| `xbrief:create` / `xbrief:verify` | Write or check an artifact at `--out` |
|
|
60
|
+
| `scope:*` / intake | Lifecycle birth and folder/status transitions |
|
|
61
|
+
| `xbrief:preflight` | Implementation-intent gate (unchanged) |
|
|
62
|
+
|
|
63
|
+
## Token budget
|
|
64
|
+
|
|
65
|
+
- ! Keep this skill postcard-sized; load pack/CLI help only when creating or verifying
|
|
66
|
+
- ⊗ Inline full schema manuals or multi-style novels into the always-on body
|
|
67
|
+
|
|
68
|
+
## Anti-Patterns
|
|
69
|
+
|
|
70
|
+
- ⊗ Overload `scope:promote` (or any lifecycle verb) to mean "compress text"
|
|
71
|
+
- ⊗ Invent `xbrief:promote` for create
|
|
72
|
+
- ⊗ Escape project root with `--out`
|
|
73
|
+
- ⊗ Auto-write to personal memory stores from this skill
|
|
74
|
+
|
|
75
|
+
## Exit
|
|
76
|
+
|
|
77
|
+
deft-directive-xbrief complete — create/verify done; chain to scope:* only when lifecycle is intended.
|
package/strategies/research.md
CHANGED
|
@@ -22,6 +22,27 @@ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
|
|
|
22
22
|
- ~ When the feature involves libraries or APIs the agent hasn't used in this project
|
|
23
23
|
- ? Skip for well-understood domains where the agent has strong existing context
|
|
24
24
|
|
|
25
|
+
## Scope Confirmation Gate (#1273)
|
|
26
|
+
|
|
27
|
+
! Before autonomous research begins, present one blocking scope-confirmation prompt and wait for the user's selection. Use the deterministic question contract: the final two numbered options MUST be `Discuss` and `Back`.
|
|
28
|
+
|
|
29
|
+
Prompt:
|
|
30
|
+
> "What should this research focus on before I investigate autonomously?"
|
|
31
|
+
|
|
32
|
+
1. Confirm the inferred feature/domain scope (Recommended)
|
|
33
|
+
2. Refine the feature boundary or priority areas
|
|
34
|
+
3. Provide sample data, artifacts, constraints, or sensitive areas to account for
|
|
35
|
+
4. Discuss
|
|
36
|
+
5. Back
|
|
37
|
+
|
|
38
|
+
- ! **Confirmed-scope postcondition (required before survey):** research MUST NOT start the survey until a confirmed research scope is recorded in notes. Confirmation is achieved by **any** of: option **1** (accept inferred scope as-is), or option **2**/**3** after free-form capture (the free-form answer **is** the confirmation of scope — it replaces option-1 confirmation; do not re-open option 1 after capture).
|
|
39
|
+
- ! On option **1** (confirm inferred scope): record the inferred feature/domain as the confirmed research scope and proceed to the survey step.
|
|
40
|
+
- ! On option **2** (refine boundary): ask a **follow-up free-form question** in the next message (one question only) to capture the refined feature boundary or priority areas; wait for the user's answer; record that free-form text as the **confirmed** research scope; then proceed to survey. ⊗ Proceed to survey after option 2 without collecting free-form refinement text. ⊗ Leave research blocked after option 2 with no follow-up path.
|
|
41
|
+
- ! On option **3** (artifacts/constraints/sensitivity): ask a **follow-up free-form question** in the next message (one question only) for sample data paths, artifacts to analyze, constraints, or sensitive areas; wait for the user's answer; record provided artifacts/constraints/sensitivity flags **and** treat the current feature/domain (plus those inputs) as the **confirmed** research scope; then proceed to survey. ⊗ Proceed to survey after option 3 without collecting free-form artifact/constraint input. ⊗ Leave research blocked after option 3 with no follow-up path.
|
|
42
|
+
- ! If the user declines free-form input after option 2 or 3 (empty answer / "skip" / "none"): re-present the Scope Confirmation Gate once; if they pick option **1**, confirm inferred scope and proceed; if they again decline capture without confirming, stop research and return to the chaining gate or invoking menu — do not survey on unconfirmed scope.
|
|
43
|
+
- ! Record the confirmed scope, any provided artifacts, and any sensitivity flags in the research notes before the survey step.
|
|
44
|
+
- ⊗ Start the survey from project description alone without a confirmed research scope (option 1 acceptance or option 2/3 free-form confirmation).
|
|
45
|
+
|
|
25
46
|
## Output
|
|
26
47
|
|
|
27
48
|
! Before writing output artifacts, follow the [Preparatory Guard](./artifact-guards.md#preparatory-guard-light).
|
|
@@ -127,9 +148,12 @@ so the user can run additional preparatory strategies or proceed to spec generat
|
|
|
127
148
|
append artifact path (`vbrief/proposed/{feature}-research.vbrief.json`)
|
|
128
149
|
- Append the path to the flat `artifacts` array
|
|
129
150
|
- ! Return to [interview.md Chaining Gate](./interview.md#chaining-gate)
|
|
151
|
+
- ! Present the chaining gate as a blocking question and wait for a user selection before any spec generation or additional scope vBRIEF generation.
|
|
152
|
+
- ! Explain at handoff that `completedStrategies` records that research ran, while `vbrief/proposed/{feature}-research.vbrief.json` remains a planning artifact in the scope lifecycle until a later strategy promotes or consumes it.
|
|
130
153
|
- ! The research findings MUST inform subsequent strategies and spec generation:
|
|
131
154
|
- "Don't Hand-Roll" items become constraints in the specification
|
|
132
155
|
- "Common Pitfalls" become acceptance criteria or NFRs
|
|
156
|
+
- ⊗ Generate implementation scope vBRIEFs directly from research findings or proceed to spec generation before the user chooses from the chaining gate.
|
|
133
157
|
- ⊗ End the session after research without returning to the chaining gate
|
|
134
158
|
or the invoking strategy's next-step menu
|
|
135
159
|
|
|
@@ -141,7 +165,7 @@ so the user can run additional preparatory strategies or proceed to spec generat
|
|
|
141
165
|
|
|
142
166
|
## Workflow
|
|
143
167
|
|
|
144
|
-
1. **Scope** --
|
|
168
|
+
1. **Scope confirmation** -- Ask the blocking scope-confirmation prompt, wait for the user, and record scope/artifact/sensitivity inputs
|
|
145
169
|
2. **Survey** -- Check existing project dependencies, official docs, and known pitfalls
|
|
146
170
|
3. **Document** -- Produce `vbrief/proposed/{feature}-research.vbrief.json` with `DontHandRoll` and `CommonPitfalls` narratives
|
|
147
171
|
4. **Chain** -- Return to [interview.md Chaining Gate](./interview.md#chaining-gate), or -- if invoked from a standalone strategy (e.g. map's standalone next-step menu) -- return to the invoking strategy's menu per the [standalone-context rule](#then-chaining-gate) above
|
|
@@ -150,6 +174,7 @@ so the user can run additional preparatory strategies or proceed to spec generat
|
|
|
150
174
|
|
|
151
175
|
- ⊗ Building custom solutions for solved problems
|
|
152
176
|
- ⊗ Skipping research for unfamiliar domains ("how hard can auth be?")
|
|
177
|
+
- ⊗ Starting autonomous research before the Scope Confirmation Gate has captured or explicitly skipped user-provided artifacts/constraints
|
|
153
178
|
- ⊗ Research that produces a reading list instead of actionable guidance
|
|
154
179
|
- ⊗ Research that doesn't flow into planning (written and never referenced)
|
|
155
180
|
- ⊗ Ending after research without chaining into specification generation (chained mode; in standalone context, returning to the invoking strategy's menu satisfies the completion requirement per the [standalone-context rule](#then-chaining-gate))
|
package/tasks/verify.yml
CHANGED
|
@@ -496,6 +496,16 @@ tasks:
|
|
|
496
496
|
vars:
|
|
497
497
|
ENGINE_CMD: 'verify-review-monitor {{.CLI_ARGS}}'
|
|
498
498
|
|
|
499
|
+
l4-owner:
|
|
500
|
+
desc: "Owner Continuity / L4 owner gate (#3090): exit 0 only if sticky review-owner lease is fresh or --review-cycle done (forbid freeform started/pending). Three-state exit (0 ready / 1 silent hold / 2 config)."
|
|
501
|
+
dir: '{{.USER_WORKING_DIR}}'
|
|
502
|
+
deps:
|
|
503
|
+
- task: :engine:_ts-build
|
|
504
|
+
cmds:
|
|
505
|
+
- task: :engine:invoke
|
|
506
|
+
vars:
|
|
507
|
+
ENGINE_CMD: 'verify-l4-owner {{.CLI_ARGS}}'
|
|
508
|
+
|
|
499
509
|
subagent-alive:
|
|
500
510
|
desc: "Fail-closed worker liveness gate (#2824): missing/STALE heartbeats for in-flight drive-to:merge* workers exit 1 with REDISPATCH_OK. Three-state exit (0 alive / 1 stale-or-missing / 2 config error)."
|
|
501
511
|
dir: '{{.USER_WORKING_DIR}}'
|
|
@@ -545,13 +545,46 @@ Every worker MUST send a final status message before exiting its tool loop, rega
|
|
|
545
545
|
|
|
546
546
|
! **Empty announce ≠ done / single review-monitor lease (#3044 / FC04 residual):** An empty settle, missing `STATUS:` line, or `status: unknown` from a review-monitor (`subagent_announce` with `(no output)` included) is **not** DONE/CLEAN/merge-ready. Parent MUST same-turn ground truth (`gh pr view` + checks + HEAD) and MUST NOT spawn a second monitor while the prior owner is running or only falsely settled. Prefer one sticky `<!-- deft:review-owner -->` lease and a non-empty `STATUS`/`HEAD`/`CHECKS`/`MERGE` handback. Full MUST language: `skills/deft-directive-review-cycle/SKILL.md` + OpenClaw host adapter residual.
|
|
547
547
|
|
|
548
|
+
! **`review_cycle` evidence enum (#3090):** Handoffs, swarm finish messages, and L4 process claims MUST use only `done` | `in_progress:<pr>#<monitor_or_lease_ref>` | `skipped:<reason>` | `n/a`. Freeform `started` / `pending` / `initiated` is forbidden. L4 `status: pass` is illegal unless `review_cycle: done` (Step 6 fail-closed on HEAD) or `review_cycle: in_progress:…` with a verifiable sticky lease / parent-retained ownership. After a drive-to:merge-ready / babysit / shepherd claim, the same turn MUST end in Owner Continuity Gate A/B/C (monitor+lease, parent-retained next dual-source action, or explicit BLOCKED/FAILED finish) — never silent hold. Optional machine gate: `deft verify:l4-owner --pr <N>` / `task verify:l4-owner -- --pr <N>`. Full MUST language: `skills/deft-directive-review-cycle/SKILL.md` Owner Continuity Gate.
|
|
549
|
+
|
|
548
550
|
! **Parent tool-first after leaf completion (#2943):** When a parent / monitor receives a leaf completion event (`subagent_announce`, parent-push, or host completion notify), its **first response** MUST be a **tool-first** ground-truth batch (`gh` / `git` / worktree or file status) **or** a host **yield** (`sessions_yield` on OpenClaw, or equivalent). ⊗ Multi-sentence progress-only first response with zero tools / yield — the OpenClaw text-repetition hang class (#2943).
|
|
549
551
|
|
|
550
552
|
⊗ Treat thin DONE (no PR URL / merge evidence) as success (#2943).
|
|
551
553
|
⊗ Treat empty/unknown review-monitor settle as DONE without same-turn ground truth, or dual-spawn a second monitor while the first lease is live (#3044).
|
|
554
|
+
⊗ Emit freeform `review_cycle: started` / `pending` / `initiated` or L4 `status: pass` without `done` or verifiable `in_progress:<pr>#…` (#3090).
|
|
552
555
|
|
|
553
556
|
Per-step acks during the run are noise. ONE start message, ONE final message; intermediate messages only on `BLOCKED` / `FAILED`. The final message lets the dispatcher distinguish a clean exit from a silent timeout when the lifecycle event arrives.
|
|
554
557
|
|
|
558
|
+
## 11.5 Completion latch — one consolidate per runId (#3092)
|
|
559
|
+
|
|
560
|
+
Multi-agent **orchestrators** (OpenClaw parent seats, Cursor Task parents, grok-build swarm monitors, any parent that receives child settle / completion events) MUST apply a portable **completion latch**. Host-level announce dedupe is complementary and imperfect; this is the **agent-side** default when the same settled batch is re-delivered.
|
|
561
|
+
|
|
562
|
+
### Completion latch (MUST)
|
|
563
|
+
|
|
564
|
+
1. **One user- or caller-visible consolidate per child `runId` / settle batch** (or the explicit equivalent batch key the harness provides — e.g. spawn id, task id, announce id). Accept or reject for that batch still counts as the one consolidate.
|
|
565
|
+
2. After that consolidate is emitted, **identical or equivalent completion replay** for the same key ⇒ **silent**: no tools, no re-QC, no second final answer. When the host defines a silent token (example: OpenClaw `NO_REPLY`), use it; otherwise emit no outbound user/caller message.
|
|
566
|
+
3. **Re-open only when:**
|
|
567
|
+
- new `runId` / new child batch key, **or**
|
|
568
|
+
- caller / principal **explicit** steer to reopen, **or**
|
|
569
|
+
- the completion payload carries **materially new** evidence (new HEAD, new blocker class, new PR URL / merge state) — not a re-paste or fat re-embedding of the same rollup / full task text.
|
|
570
|
+
4. If the harness **storms** replays with no new key: **at most one** fail-loud note to the caller (`completion replay storm; ignoring`), then silent. ⊗ Infinite consolidate loops.
|
|
571
|
+
5. Fat completion payloads that re-embed full task text, prior prompts, or prior consolidate prose **MUST NOT** be treated as a new mission or as material new evidence.
|
|
572
|
+
|
|
573
|
+
### Eval checklist (second settle same runId)
|
|
574
|
+
|
|
575
|
+
Given: parent already emitted a consolidate for `runId=R` (or harness batch key `R`).
|
|
576
|
+
Second settle event for `R` arrives with the same claims / equivalent rollup.
|
|
577
|
+
**Expect:** silent / host silent-token path — **not** a new investigation narrative, dual-source re-fetch, or second user-visible final.
|
|
578
|
+
|
|
579
|
+
### Normative anti-patterns
|
|
580
|
+
|
|
581
|
+
- ⊗ Second+ user-visible "final" for the same settled `runId` without new evidence or explicit reopen
|
|
582
|
+
- ⊗ Full dual-source / full test re-run solely because the settle event was delivered again
|
|
583
|
+
- ⊗ Treating "send consolidated final **now**" wording on a **replay** as authorization to undo a prior consolidate for that batch
|
|
584
|
+
- ⊗ Treating fat prompt / task-text re-embeds in completion payloads as a new mission (#3092)
|
|
585
|
+
|
|
586
|
+
Cross-links: swarm Phase 5 completion-notification / parent handback (`skills/deft-directive-swarm/references/core-phase-5-6.md`); review-monitor empty-settle DoD remains #3044 (empty ≠ done) and is orthogonal — empty is not a latch hit; identical non-empty replay after a prior consolidate **is** a latch hit.
|
|
587
|
+
|
|
555
588
|
## 12. Session ritual + `task verify:cache-fresh` gates before `start_agent` (#1348 / #1127)
|
|
556
589
|
|
|
557
590
|
Dispatchers (this orchestrator, swarm Phase 4 dispatch, monitor agents, scheduled / cloud runs) run in a headless worker context and MUST set `DEFT_SESSION_RITUAL_SKIP=1` for dispatched implementation workers. The interactive parent session remains responsible for `task session:start`; worker processes bypass the local `.deft/ritual-state.json` gate explicitly so they do not need per-clone interactive ritual state. When the bypass would hide a stale/missing ritual state, `task verify:session-ritual` prints a warning to stderr; preserve that warning in the dispatch log.
|