deft-directive-spec-reconstruct · git:20261005.3456c67 · 2026-10-05 · sha256 4f0d3f2cc18f1656
deft-directive-spec-reconstruct git:20261005.3456c67A
Immutable. This exact content never changes and is served at /api/v1/blob/4f0d3f2cc18f1656.
--- name: deft-directive-spec-reconstruct description: >- Brownfield specification reconstruction + advise drift guard (#1589). Draft-only synthesis from completed xBRIEFs + #1595 codebase MAP; never auto-promotes. Use when reconstructing a failed/stale spec, recovering requirements, or checking semantic spec drift. Do NOT trigger on ordinary spec:render / spec:validate / verify:spec-prd-fresh. triggers: - reconstruct spec - recover spec - rebuild spec - spec is stale - spec is failed - spec:reconstruct - verify:spec-drift - spec drift --- <!-- AUTO-GENERATED by task packs:render -- DO NOT EDIT MANUALLY --> <!-- Purpose: rendered skill --> <!-- Source of truth: packs/skills/skills-pack-0.1.json --> <!-- Regenerate with: task packs:render --> <!-- Edit the source, not this file. Slice instead of loading every SKILL.md: task packs:slice skills by-trigger --trigger <kw> (or list) --> # Spec Reconstruct + Drift Guard (#1589) Recover a trustworthy project specification from completed xBRIEFs, then advise when completions skip requirements coverage. Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY. ## When to Use - Spec baseline has failed or drifted after RFC/ADR/feature landings - Operator says "reconstruct spec", "recover spec", or "spec is stale/failed" - Auditing semantic drift via `verify:spec-drift` - ⊗ Ordinary `spec:render` / `spec:validate` / `verify:spec-prd-fresh` freshness work ## Live surfaces (re-authored) - Policy: `packages/core/src/policy/spec-guard.ts` via `plan["x-directive/policy"].specGuard` - Reconstruct: `packages/core/src/spec-reconstruct/` + `task spec:reconstruct` - Drift: `packages/core/src/verify-source/spec-drift.ts` + `task verify:spec-drift` - Sync hook: extend `syncSpecificationAfterScopeMove` (#2566) - Code oracle: shipped `#1595` codebase MAP + `verify:codebase-map-fresh` - Corpus: `xbrief/completed/` - Installer skill deposit under `.deft/core/skills/` ## C1 — draft-only reconstruct ```bash task spec:reconstruct -- --project-root . # consumer: task deft:spec:reconstruct ``` - ! Emit a **draft candidate only** under `xbrief/.audit/spec-reconstruct-draft.json` - ! Tag provenance + confidence; keep observed behavior, intended requirement, and unresolved conflict as separate fields - ! Fold with supersession awareness; defer remainder past adjudication budget to `pending-human-decisions` - ! Sufficiency feeds `resolveSpecAuthority` (one greenfield predicate) — count is discovery heuristic only - ! Consume `#1595` codebase MAP as code oracle; do not build a parallel agent-read oracle - ⊗ Auto-promote draft to `xbrief/specification.xbrief.json` - ⊗ Treat registry write / projection-fresh alone as proof requirements match reality ## C2 — advise drift guard - ! Resolve `plan.policy.specGuard` via `readPlanPolicy` (`policy:show --field=specGuard`) - ! Declare completion impact as `plan.items[].x-directive/specImpact` (`none|delta|new`) — never a bare key - ! Wire advise trigger by **extending** `syncSpecificationAfterScopeMove` (#2566) - ! Audit with `task verify:spec-drift` (0 clean / 1 drift / 2 unassessable) - ! Discharge only against baseline revision + per-completion requirements/delta coverage - ⊗ Clear unresolved drift with registry/render-only or unrelated spec touches - ⊗ Splice advisory validate into `task check` in v1 - ⊗ Enforce-default on the framework tree ## C3 — reserved - ! Ship `sqaPass` schema only; engine is a documented no-op in v1 ## Hardening - ~ After draft: run interview/probe with a **bounded adjudication budget** - ! Remainder stays in pending-human-decisions until human resolve - ! Only after hardening may the operator promote a specification artifact ## Anti-Patterns - ⊗ Retired Python policy/spec-render script paths as implementation targets (Prefer-A Bound re-author onto TypeScript surfaces) - ⊗ Bare `plan.policy.specGuard` / bare `specImpact` under #1650 - ⊗ Parallel code-oracle beside #1595 - ⊗ Second greenfield predicate that can disagree with `resolveSpecAuthority` - ⊗ Building the C3 SQA judgment engine in v1 ## EXIT deft-directive-spec-reconstruct complete — draft written and/or drift audited; chain to interview/probe for hardening, then operator-promoted `spec:render` only after explicit promote.