@gobing-ai/spur 0.3.41 → 0.3.42
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/.claude-plugin/marketplace.json +15 -0
- package/README.md +15 -1
- package/config/templates/AGENTS.md +5 -3
- package/config/workflows/task-pipeline.yaml +103 -12
- package/package.json +15 -12
- package/plugins/README.md +655 -0
- package/plugins/sp/README.md +621 -0
- package/plugins/sp/agents/expert-spur.md +109 -0
- package/plugins/sp/agents/super-coder.md +126 -0
- package/plugins/sp/agents/super-planner.md +283 -0
- package/plugins/sp/agents/super-reviewer.md +154 -0
- package/plugins/sp/commands/dev-arch.md +30 -0
- package/plugins/sp/commands/dev-brainstorm.md +40 -0
- package/plugins/sp/commands/dev-changelog.md +28 -0
- package/plugins/sp/commands/dev-daily.md +29 -0
- package/plugins/sp/commands/dev-debug.md +29 -0
- package/plugins/sp/commands/dev-dogfood.md +33 -0
- package/plugins/sp/commands/dev-featurechange.md +130 -0
- package/plugins/sp/commands/dev-find-conflict.md +51 -0
- package/plugins/sp/commands/dev-find-issue.md +76 -0
- package/plugins/sp/commands/dev-find-next.md +60 -0
- package/plugins/sp/commands/dev-fixall.md +33 -0
- package/plugins/sp/commands/dev-gitmsg.md +28 -0
- package/plugins/sp/commands/dev-gtd.md +97 -0
- package/plugins/sp/commands/dev-handover.md +26 -0
- package/plugins/sp/commands/dev-idea.md +50 -0
- package/plugins/sp/commands/dev-next.md +31 -0
- package/plugins/sp/commands/dev-parallel.md +30 -0
- package/plugins/sp/commands/dev-plan.md +46 -0
- package/plugins/sp/commands/dev-refine.md +48 -0
- package/plugins/sp/commands/dev-refineall.md +65 -0
- package/plugins/sp/commands/dev-refresh.md +32 -0
- package/plugins/sp/commands/dev-reverse.md +32 -0
- package/plugins/sp/commands/dev-review.md +31 -0
- package/plugins/sp/commands/dev-run.md +63 -0
- package/plugins/sp/commands/dev-runall.md +80 -0
- package/plugins/sp/commands/dev-simplify.md +39 -0
- package/plugins/sp/commands/dev-unit.md +29 -0
- package/plugins/sp/commands/dev-verify.md +48 -0
- package/plugins/sp/commands/dev-verifyall.md +72 -0
- package/plugins/sp/commands/dev-wrap.md +30 -0
- package/plugins/sp/commands/dev-wrapall.md +33 -0
- package/plugins/sp/commands/rule-add.md +18 -0
- package/plugins/sp/commands/rule-refine.md +18 -0
- package/plugins/sp/commands/rule-scan.md +18 -0
- package/plugins/sp/commands/spur-init.md +22 -0
- package/plugins/sp/commands/workflow-add.md +18 -0
- package/plugins/sp/commands/workflow-refine.md +18 -0
- package/plugins/sp/hooks/agent-hint.ts +60 -0
- package/plugins/sp/hooks/careful-guard.ts +147 -0
- package/plugins/sp/hooks/context-post-tool.ts +325 -0
- package/plugins/sp/hooks/context-session-start.ts +182 -0
- package/plugins/sp/hooks/context-session-stop.ts +95 -0
- package/plugins/sp/hooks/hooks.json +51 -0
- package/plugins/sp/hooks/pi/guard-extension.ts +341 -0
- package/plugins/sp/hooks/task-write-guard.ts +84 -0
- package/plugins/sp/plugin.json +8 -0
- package/plugins/sp/scripts/batch-preflight.ts +204 -0
- package/plugins/sp/scripts/daily-summary/daily-summary.ts +606 -0
- package/plugins/sp/scripts/daily-summary/logger.ts +28 -0
- package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +363 -0
- package/plugins/sp/scripts/dogfood-testing/validate-report.ts +168 -0
- package/plugins/sp/scripts/feature-sync-bounded.ts +451 -0
- package/plugins/sp/scripts/stage-registry-adapter.ts +1341 -0
- package/plugins/sp/scripts/task-size-precheck.ts +202 -0
- package/plugins/sp/scripts/validate-commands.ts +651 -0
- package/plugins/sp/scripts/validate-flag-contracts.ts +875 -0
- package/plugins/sp/skills/brainstorm/SKILL.md +361 -0
- package/plugins/sp/skills/brainstorm/agents/openai.yaml +14 -0
- package/plugins/sp/skills/brainstorm/examples/ideation-example.md +209 -0
- package/plugins/sp/skills/brainstorm/metadata.openclaw +7 -0
- package/plugins/sp/skills/brainstorm/references/grilling-interview.md +68 -0
- package/plugins/sp/skills/brainstorm/references/workflows.md +255 -0
- package/plugins/sp/skills/branch-workflow/SKILL.md +109 -0
- package/plugins/sp/skills/branch-workflow/references/branch-lifecycle.md +69 -0
- package/plugins/sp/skills/branch-workflow/references/worktree-patterns.md +100 -0
- package/plugins/sp/skills/code-implementation/SKILL.md +176 -0
- package/plugins/sp/skills/code-implementation/references/debugging.md +64 -0
- package/plugins/sp/skills/code-implementation/references/implementation-patterns.md +113 -0
- package/plugins/sp/skills/code-improvement/SKILL.md +231 -0
- package/plugins/sp/skills/code-improvement/references/deepening-signals.md +205 -0
- package/plugins/sp/skills/code-review/SKILL.md +112 -0
- package/plugins/sp/skills/code-review/references/receiving-code-review.md +70 -0
- package/plugins/sp/skills/code-review/references/review-lenses.md +117 -0
- package/plugins/sp/skills/code-review/references/self-review-checklist.md +53 -0
- package/plugins/sp/skills/code-review/references/verification-before-completion.md +68 -0
- package/plugins/sp/skills/code-simplification/SKILL.md +225 -0
- package/plugins/sp/skills/code-testing/SKILL.md +108 -0
- package/plugins/sp/skills/code-testing/references/stacks/bun-ts.md +165 -0
- package/plugins/sp/skills/code-testing/references/stacks/go.md +88 -0
- package/plugins/sp/skills/code-testing/references/stacks/python.md +117 -0
- package/plugins/sp/skills/code-testing/references/test-loop-breaker.md +37 -0
- package/plugins/sp/skills/code-testing/references/test-output-discipline.md +52 -0
- package/plugins/sp/skills/code-testing/references/unit-testing.md +212 -0
- package/plugins/sp/skills/code-verification/SKILL.md +535 -0
- package/plugins/sp/skills/code-verification/references/code-improvement.md +39 -0
- package/plugins/sp/skills/code-verification/references/secu-review.md +94 -0
- package/plugins/sp/skills/code-verification/references/verdict-schema.md +141 -0
- package/plugins/sp/skills/conflict-finding/SKILL.md +254 -0
- package/plugins/sp/skills/conflict-finding/references/authority-resolution.md +258 -0
- package/plugins/sp/skills/conflict-finding/references/comparison-protocol.md +277 -0
- package/plugins/sp/skills/conflict-finding/references/finding-contract.md +346 -0
- package/plugins/sp/skills/conflict-finding/references/remediation-routing.md +276 -0
- package/plugins/sp/skills/daily-summary/SKILL.md +171 -0
- package/plugins/sp/skills/daily-summary/agents/openai.yaml +13 -0
- package/plugins/sp/skills/doc-evolve/SKILL.md +175 -0
- package/plugins/sp/skills/doc-evolve/references/operations.md +93 -0
- package/plugins/sp/skills/dogfood-testing/SKILL.md +608 -0
- package/plugins/sp/skills/dogfood-testing/references/monitor-ledger.md +211 -0
- package/plugins/sp/skills/dogfood-testing/references/report-template.md +351 -0
- package/plugins/sp/skills/doubt-driven-development/SKILL.md +136 -0
- package/plugins/sp/skills/functional-review/SKILL.md +364 -0
- package/plugins/sp/skills/functional-review/references/verdict-schema.md +133 -0
- package/plugins/sp/skills/indexed-context/SKILL.md +164 -0
- package/plugins/sp/skills/issue-finding/SKILL.md +424 -0
- package/plugins/sp/skills/issue-finding/agents/openai.yaml +15 -0
- package/plugins/sp/skills/issue-finding/examples/expected-findings.json +27 -0
- package/plugins/sp/skills/issue-finding/examples/session-test-loop.jsonl +23 -0
- package/plugins/sp/skills/issue-finding/references/session-formats.md +121 -0
- package/plugins/sp/skills/next-feature/SKILL.md +125 -0
- package/plugins/sp/skills/next-feature/references/handoff-routing.md +92 -0
- package/plugins/sp/skills/next-feature/references/proposal-contract.md +49 -0
- package/plugins/sp/skills/next-feature/references/ranking-rubric.md +52 -0
- package/plugins/sp/skills/next-feature/references/signal-derivation.md +67 -0
- package/plugins/sp/skills/next-router/SKILL.md +181 -0
- package/plugins/sp/skills/next-router/references/messages.md +90 -0
- package/plugins/sp/skills/next-router/references/routing-table.md +216 -0
- package/plugins/sp/skills/parallel-execution/SKILL.md +148 -0
- package/plugins/sp/skills/parallel-execution/references/dispatch-surface.md +100 -0
- package/plugins/sp/skills/parallel-execution/references/fan-out-patterns.md +101 -0
- package/plugins/sp/skills/parallel-execution/references/result-synthesis.md +94 -0
- package/plugins/sp/skills/reverse-engineering/SKILL.md +375 -0
- package/plugins/sp/skills/reverse-engineering/agents/openai.yaml +18 -0
- package/plugins/sp/skills/source-driven-development/SKILL.md +124 -0
- package/plugins/sp/skills/spec-decomposition/SKILL.md +117 -0
- package/plugins/sp/skills/spec-decomposition/references/decomposition.md +539 -0
- package/plugins/sp/skills/spur-cli/SKILL.md +133 -0
- package/plugins/sp/skills/spur-cli/references/agent.md +179 -0
- package/plugins/sp/skills/spur-cli/references/features/acceptance-criteria.md +82 -0
- package/plugins/sp/skills/spur-cli/references/features/hierarchy-mece.md +177 -0
- package/plugins/sp/skills/spur-cli/references/features/roadmap-priority.md +84 -0
- package/plugins/sp/skills/spur-cli/references/features/verbs.md +122 -0
- package/plugins/sp/skills/spur-cli/references/features.md +234 -0
- package/plugins/sp/skills/spur-cli/references/init.md +119 -0
- package/plugins/sp/skills/spur-cli/references/message.md +98 -0
- package/plugins/sp/skills/spur-cli/references/rules/authoring-rules.md +212 -0
- package/plugins/sp/skills/spur-cli/references/rules/fine-tuning.md +148 -0
- package/plugins/sp/skills/spur-cli/references/rules/operations.md +228 -0
- package/plugins/sp/skills/spur-cli/references/rules/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/rules.md +209 -0
- package/plugins/sp/skills/spur-cli/references/serve.md +58 -0
- package/plugins/sp/skills/spur-cli/references/tasks/l3-guard-cheatsheet.md +98 -0
- package/plugins/sp/skills/spur-cli/references/tasks/section-editing.md +95 -0
- package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +361 -0
- package/plugins/sp/skills/spur-cli/references/tasks.md +278 -0
- package/plugins/sp/skills/spur-cli/references/team.md +133 -0
- package/plugins/sp/skills/spur-cli/references/workflows/authoring-workflows.md +226 -0
- package/plugins/sp/skills/spur-cli/references/workflows/operations.md +211 -0
- package/plugins/sp/skills/spur-cli/references/workflows/validation-and-extension.md +129 -0
- package/plugins/sp/skills/spur-cli/references/workflows.md +355 -0
- package/plugins/sp/skills/spur-dev/SKILL.md +224 -0
- package/plugins/sp/skills/spur-dev/references/ac-style-guide.md +196 -0
- package/plugins/sp/skills/spur-dev/references/cross-cutting.md +664 -0
- package/plugins/sp/skills/spur-dev/references/decision-brief.md +80 -0
- package/plugins/sp/skills/spur-dev/references/dev-operations.md +546 -0
- package/plugins/sp/skills/spur-dev/references/done-housekeeping.md +164 -0
- package/plugins/sp/skills/spur-dev/references/execution-batch.md +727 -0
- package/plugins/sp/skills/spur-dev/references/execution-workflow.md +350 -0
- package/plugins/sp/skills/spur-dev/references/feature-link-helper.md +191 -0
- package/plugins/sp/skills/spur-dev/references/flag-glossary.md +417 -0
- package/plugins/sp/skills/spur-dev/references/gate-checklists.md +171 -0
- package/plugins/sp/skills/spur-dev/references/glossary.md +95 -0
- package/plugins/sp/skills/spur-dev/references/idea-evaluation.md +80 -0
- package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +88 -0
- package/plugins/sp/skills/spur-dev/references/planning-workflow.md +302 -0
- package/plugins/sp/skills/spur-dev/references/product-planning.md +206 -0
- package/plugins/sp/skills/spur-dev/references/section-batching.md +24 -0
- package/plugins/sp/skills/sys-architecture/SKILL.md +155 -0
- package/plugins/sp/skills/sys-architecture/references/decision-method.md +137 -0
- package/plugins/sp/skills/sys-architecture/references/upkeep-survey.md +75 -0
- package/plugins/sp/skills/sys-debugging/SKILL.md +228 -0
- package/plugins/sp/skills/sys-debugging/references/debugging-protocol.md +62 -0
- package/plugins/sp/skills/test-driven-development/SKILL.md +248 -0
- package/plugins/sp/skills/wayfinder/SKILL.md +292 -0
- package/spur.js +6093 -5180
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verdict-schema
|
|
3
|
+
description: "The VerifyVerdict artifact shape and per-requirement aggregation rule"
|
|
4
|
+
see_also:
|
|
5
|
+
- sp:code-verification
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Verdict Schema
|
|
9
|
+
|
|
10
|
+
The verify mode emits `.spur/run/<wbs>-verdict.json` — the machine contract between
|
|
11
|
+
`sp:code-verification` and the `task-pipeline.yaml` completion gate.
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
interface VerifyVerdict {
|
|
15
|
+
/** The task this verdict certifies. */
|
|
16
|
+
wbs: string;
|
|
17
|
+
/** Aggregate verdict. Only PASS clears the pipeline gate. */
|
|
18
|
+
verdict: 'PASS' | 'PARTIAL' | 'FAIL';
|
|
19
|
+
/** Per-requirement traceability result. */
|
|
20
|
+
requirements: Array<{
|
|
21
|
+
id: string; // e.g. "R1"
|
|
22
|
+
status: 'MET' | 'PARTIAL' | 'UNMET';
|
|
23
|
+
evidence: string; // file:line, test name, or "no evidence found"
|
|
24
|
+
}>;
|
|
25
|
+
/** Per-Acceptance Criteria result. Present when the task has non-empty AC. */
|
|
26
|
+
acceptanceCriteria?: Array<{
|
|
27
|
+
id: string; // checklist label or "Scenario: <title>"
|
|
28
|
+
status: 'MET' | 'PARTIAL' | 'UNMET' | 'N/A';
|
|
29
|
+
evidenceType: 'test' | 'command' | 'static-ref' | 'manual-review' | 'llm-judge' | 'n/a';
|
|
30
|
+
evidence: string; // evidence or explicit N/A justification
|
|
31
|
+
}>;
|
|
32
|
+
/** Discrete gate checks (sections populated, tests pass, lint clean, …). */
|
|
33
|
+
checks: Array<{
|
|
34
|
+
name: string; // e.g. "tests-pass", "lint-clean"
|
|
35
|
+
status: 'pass' | 'fail' | 'warn';
|
|
36
|
+
evidence: string;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Compatibility alias: `scenario` row key
|
|
42
|
+
|
|
43
|
+
Task 0410 hardened the verdict reader. Producers SHOULD use the canonical `id` field for every
|
|
44
|
+
requirement and AC row. Consumers (the feature-check L4 traceability layer) ALSO accept `scenario`
|
|
45
|
+
as a compatibility alias for the row identifier, with these rules:
|
|
46
|
+
|
|
47
|
+
- Row with `id` only → canonical; accepted as-is.
|
|
48
|
+
- Row with `scenario` only → accepted; normalized to `{ id: scenario, … }`.
|
|
49
|
+
- Row with both `id` and `scenario` where they are EQUAL → `id` is authoritative; accepted.
|
|
50
|
+
- Row with both `id` and `scenario` where they DIFFER or either value is not a string → **rejected**
|
|
51
|
+
(conflict); the rejected row
|
|
52
|
+
count and invalid fields surface as a bounded `L4.malformed-verdict-artifact` warning naming the
|
|
53
|
+
task WBS and artifact path.
|
|
54
|
+
- Row missing both `id` and `scenario`, or missing `status`, or not an object → rejected and warned.
|
|
55
|
+
|
|
56
|
+
Empty `requirements` / `acceptanceCriteria` arrays are valid and produce no warning. The required
|
|
57
|
+
`requirements` array being absent, either coverage field being a non-array value, a missing artifact,
|
|
58
|
+
malformed JSON, and a non-object JSON root are distinct diagnostic outcomes. Each emits one bounded
|
|
59
|
+
`L4.malformed-verdict-artifact` warning per task/artifact whose message names the failure mode;
|
|
60
|
+
optional `acceptanceCriteria` may remain absent.
|
|
61
|
+
|
|
62
|
+
Canonical producers and docs continue to use `id`. The `scenario` alias exists so older or
|
|
63
|
+
third-party verdict emitters keyed on scenario titles are not silently dropped.
|
|
64
|
+
|
|
65
|
+
## Aggregation rule
|
|
66
|
+
|
|
67
|
+
The aggregate `verdict` is derived from the per-requirement, per-AC, and blocking review statuses:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
any core requirement UNMET → FAIL
|
|
71
|
+
any core Acceptance Criteria UNMET → FAIL
|
|
72
|
+
any blocker correctness/security check → FAIL
|
|
73
|
+
any core requirement or AC PARTIAL (no FAIL) → PARTIAL
|
|
74
|
+
any unresolved major quality check (no FAIL) → PARTIAL
|
|
75
|
+
all core requirements and AC MET or justified N/A → PASS
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
There is no "good enough" — `PARTIAL` blocks the gate exactly like `FAIL`. The distinction exists
|
|
79
|
+
only to tell the operator *how far off* delivery is (UNMET = nothing there; PARTIAL = half there).
|
|
80
|
+
|
|
81
|
+
## Acceptance Criteria evidence
|
|
82
|
+
|
|
83
|
+
When a task has non-empty Acceptance Criteria, `acceptanceCriteria` must be populated. Evidence type
|
|
84
|
+
is part of the contract so weak proof is visible to the pipeline and to reviewers:
|
|
85
|
+
|
|
86
|
+
- `test` / `command`: deterministic evidence.
|
|
87
|
+
- `static-ref`: source, configuration, or documentation reference evidence.
|
|
88
|
+
- `manual-review`: reviewer reasoning with cited files.
|
|
89
|
+
- `llm-judge`: qualitative judgment only; it cannot alone certify objective AC.
|
|
90
|
+
- `n/a`: explicitly justified non-applicability.
|
|
91
|
+
|
|
92
|
+
Every CORE behavior-bearing AC requires executable evidence: at least one `test` or `command` row.
|
|
93
|
+
`spur task verdict` treats AC rows as core and behavior-bearing by default; add `[advisory]`,
|
|
94
|
+
`[non-core]`, `[non-behavior]`, or `[docs-only]` in the AC id only when that weaker rule is
|
|
95
|
+
intentional. A MET behavior AC with only `static-ref`, `manual-review`, or `llm-judge` evidence is
|
|
96
|
+
downgraded to `PARTIAL` and emits an `evidence-rule-failed` check. CLI-surface changes should also
|
|
97
|
+
emit a `cli-golden-path-present` check backed by a golden-path `--json` command invocation.
|
|
98
|
+
|
|
99
|
+
For answer files, emit a matching parseable table:
|
|
100
|
+
|
|
101
|
+
```markdown
|
|
102
|
+
### Acceptance Criteria Verification
|
|
103
|
+
|
|
104
|
+
| AC | Status | Evidence Type | Evidence |
|
|
105
|
+
|----|--------|---------------|----------|
|
|
106
|
+
| Scenario: CLI emits JSON | MET | test | `apps/cli/tests/foo.test.ts:42` |
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Checks evidence
|
|
110
|
+
|
|
111
|
+
Wave C verification can emit the following additive `checks[]` rows:
|
|
112
|
+
|
|
113
|
+
| Check | Meaning |
|
|
114
|
+
| ----- | ------- |
|
|
115
|
+
| `design-conformance` | Task `### Design` claims were classified DONE / PARTIAL / NOT DONE / CHANGED against the diff. |
|
|
116
|
+
| `scope-creep` | Diff hunks did not map to Requirements / AC / Design / Plan items. Informational unless SECUA raises it. |
|
|
117
|
+
| `evidence-rule-pass` | All behavior-bearing AC rows had executable evidence or were explicitly non-behavioral. |
|
|
118
|
+
| `evidence-rule-failed` | One or more MET behavior-bearing AC rows lacked `test` / `command` evidence and were downgraded to PARTIAL. |
|
|
119
|
+
| `cli-golden-path-present` | CLI-surface tasks supplied, or failed to supply, one golden-path command evidence row. |
|
|
120
|
+
|
|
121
|
+
## How the gate reads it
|
|
122
|
+
|
|
123
|
+
`.spur/workflows/task-pipeline.yaml`, transition `verify → record`:
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
guard:
|
|
127
|
+
kind: shell
|
|
128
|
+
options:
|
|
129
|
+
command: 'test "$(jq -r .verdict .spur/run/${vars.wbs}-verdict.json)" = PASS'
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
with a sibling `verify → failed` guarded on the negation. So a missing file, malformed JSON, or any
|
|
133
|
+
non-`PASS` verdict routes the run to `failed` rather than `done` — the pipeline cannot certify
|
|
134
|
+
completion without an explicit PASS artifact.
|
|
135
|
+
|
|
136
|
+
## Lifecycle
|
|
137
|
+
|
|
138
|
+
- **Written:** Step 9 of verify mode, *after* the verdict is final (never partially).
|
|
139
|
+
- **Read:** by the workflow gate on the `verify → record` transition.
|
|
140
|
+
- **Location:** `.spur/run/` (the run-scratch dir the pipeline's `record` step also uses).
|
|
141
|
+
- **Lifetime:** per execution attempt; overwritten on the next verify of the same WBS.
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: conflict-finding
|
|
3
|
+
description: "Authority-aware semantic audit across source, task files, feature files, and project authority files — detect conflicts, resolve claim-specific authority, collect reproducible evidence, and route confirmed repairs through owner surfaces. Triggers: find conflict, conflict audit, semantic conflict, authority mismatch, stale projection."
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
metadata:
|
|
7
|
+
author: spur
|
|
8
|
+
platforms: "claude-code,codex,openclaw,opencode,antigravity,pi"
|
|
9
|
+
category: analysis-core
|
|
10
|
+
interactions:
|
|
11
|
+
- audit
|
|
12
|
+
- remediation
|
|
13
|
+
pipeline_steps:
|
|
14
|
+
- discover
|
|
15
|
+
- compare
|
|
16
|
+
- resolve
|
|
17
|
+
- report
|
|
18
|
+
- remediate
|
|
19
|
+
openclaw:
|
|
20
|
+
emoji: "🧭"
|
|
21
|
+
see_also:
|
|
22
|
+
- sp:doc-evolve
|
|
23
|
+
- sp:spur-cli
|
|
24
|
+
- sp:code-verification
|
|
25
|
+
- sp:spur-dev
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# sp:conflict-finding — Authority-Aware Indexed Conflict Audit
|
|
29
|
+
|
|
30
|
+
A prompt-first, authority-aware audit across the four pillars — **source code**, **task files**,
|
|
31
|
+
**feature files**, and **project authority files** — that discovers conflicts, resolves claim-specific
|
|
32
|
+
authority, collects reproducible evidence, and routes confirmed repairs through each artifact owner's
|
|
33
|
+
existing harness surface.
|
|
34
|
+
|
|
35
|
+
**Honesty contract:** v1 is prompt-first. The model performs subject clustering, claim-specific
|
|
36
|
+
authority reasoning, and semantic comparison; existing deterministic tools (`git`, `rg`,
|
|
37
|
+
`spur task/feature --json`, `spur … check`, `sp:doc-evolve` audit surfaces) gather facts. V1 adds no
|
|
38
|
+
TypeScript analyzer, database, vector index, embedding pipeline, persistent cache, new runtime
|
|
39
|
+
dependency, or dedicated subagent.
|
|
40
|
+
|
|
41
|
+
## When to Use
|
|
42
|
+
|
|
43
|
+
**Trigger phrases:** "find conflict", "conflict audit", "semantic conflict", "authority mismatch",
|
|
44
|
+
"stale projection", "do the docs and code agree", "audit the corpus"
|
|
45
|
+
|
|
46
|
+
**Use PROACTIVELY when:**
|
|
47
|
+
|
|
48
|
+
- A claim in one pillar appears to contradict another pillar (source↔task, source↔feature,
|
|
49
|
+
source↔authority, task↔feature, task↔authority, feature↔authority).
|
|
50
|
+
- A task or feature's status, AC, or requirements may have drifted from the implemented surface.
|
|
51
|
+
- A derived projection (architecture/design/docs) may have diverged from its authority (ADR/PRD).
|
|
52
|
+
- The operator wants a reproducible evidence envelope before authorizing any repair.
|
|
53
|
+
|
|
54
|
+
**Do NOT use for:**
|
|
55
|
+
|
|
56
|
+
- Debugging a specific runtime failure — use `sp:sys-debugging`.
|
|
57
|
+
- Code review — use `sp:code-review` / `sp:code-verification`.
|
|
58
|
+
- General documentation drift maintenance — use `sp:doc-evolve`.
|
|
59
|
+
- Performing repairs automatically — this skill only audits and (with `--resolve`) proposes
|
|
60
|
+
confirmed, owner-routed repairs; it never mutates without explicit confirmation.
|
|
61
|
+
|
|
62
|
+
## Arguments
|
|
63
|
+
|
|
64
|
+
| Argument | Description | Default |
|
|
65
|
+
| ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |
|
|
66
|
+
| `[scope]` | Optional path, WBS, feature ID, symbol, command, config key, or free-form subject to scope the audit. | current project |
|
|
67
|
+
| `--pillar <source\|tasks\|features\|authority\|all>` | Limit the internal audit to one pillar; the minimum authorities needed to judge it still load. | `all` |
|
|
68
|
+
| `--mode <adaptive\|full>` | Scan protocol — `adaptive` reuses fresh, provenance-verifiable indexed context and discloses skipped areas; `full` forces a cold comprehensive scan. | `adaptive` |
|
|
69
|
+
| `--resolve` | Enable the proposal, confirmation, and owner-routed remediation workflow. Its absence guarantees no source/corpus/numbered-doc mutation. | off |
|
|
70
|
+
| `--agent <inline\|auto\|name>` | Who runs the model-bearing analysis. `inline` is the default; `--agent auto`/a named executor isolates the analysis. Not a dedicated subagent. | `inline` |
|
|
71
|
+
| `--json` | Emit the same result envelope as Markdown as JSON. Never implies deterministic semantic reasoning. | off |
|
|
72
|
+
|
|
73
|
+
## The 10-Step Audit Protocol
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
scope + flags
|
|
77
|
+
→ PARSE & GUARD resolve scope/flags; confirm repository root; set audit-only vs resolve mode
|
|
78
|
+
→ DISCOVER AUTHORITY read entry/process rules; build the claim-specific authority matrix
|
|
79
|
+
→ PREFLIGHT git, rg, spur task/feature --json, relevant spur … check, doc-evolve audit
|
|
80
|
+
→ INVENTORY four-pillar inventory: pillar, identity, path, anchor, freshness, scan status
|
|
81
|
+
→ CANDIDATE GRAPH join claims via explicit links, WBS/feature IDs, AC titles, symbols, commands,
|
|
82
|
+
flags, schemas, config keys, normalized domain terms
|
|
83
|
+
→ WITHIN-PILLAR contradictions, stale projections, duplicates, omissions, orphans, ambiguity
|
|
84
|
+
→ CROSS-PILLAR all six applicable boundaries
|
|
85
|
+
→ CLASSIFY lifecycle, supersession, abstraction-level, intentional-deprecation challenges
|
|
86
|
+
→ REPORT order by severity then confidence; coverage, unresolved authority, scan cost
|
|
87
|
+
→ REMEDIATE only with --resolve and explicit confirmation + freshness recheck
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Step 1 — Parse and guard
|
|
91
|
+
|
|
92
|
+
Resolve `<scope>` and `--pillar`; confirm the repository root; establish **audit-only** versus
|
|
93
|
+
`--resolve` mode. Without `--resolve`, the run is strictly read-only: no source, corpus, or
|
|
94
|
+
numbered-document mutation of any kind. With `--resolve`, no write happens until a repair set is
|
|
95
|
+
presented, explicitly confirmed, and freshness-revalidated.
|
|
96
|
+
|
|
97
|
+
### Step 2 — Discover local authority
|
|
98
|
+
|
|
99
|
+
Read entry/process rules (`AGENTS.md`, `docs/99_PROJECT_CONSTITUTION.md`) before interpreting any
|
|
100
|
+
difference. Build the claim-specific authority matrix — authority is resolved for a **subject +
|
|
101
|
+
claim type**, never for a whole file. The default authority set is `AGENTS.md`, `docs/00_ADR.md`,
|
|
102
|
+
`docs/01_PRD.md`, `docs/03_ARCHITECTURE.md`, `docs/04_DESIGN.md`, `docs/05_FEATURES.md`,
|
|
103
|
+
`docs/99_PROJECT_CONSTITUTION.md` when present; absent optional files are reported without blocking
|
|
104
|
+
the audit. Full matrix and fallback rules: [references/authority-resolution.md](references/authority-resolution.md).
|
|
105
|
+
|
|
106
|
+
### Step 3 — Run deterministic preflight
|
|
107
|
+
|
|
108
|
+
Use `git`, `rg`, `spur task/feature … --json`, relevant `spur … check`, and `sp:doc-evolve` audit
|
|
109
|
+
surfaces when available. Tool failures become **coverage evidence**, never silent omission; record
|
|
110
|
+
them in `errors` and degrade `coverage.complete` accordingly.
|
|
111
|
+
|
|
112
|
+
### Step 4 — Build inventories
|
|
113
|
+
|
|
114
|
+
For each pillar record: identity, path, anchor, provenance/freshness, and scan status. Optional
|
|
115
|
+
files may be absent; a selected pillar may **not** be silently omitted. Unavailable line numbers
|
|
116
|
+
must be replaced with a stable structural anchor (heading, symbol, WBS, feature ID, command), never
|
|
117
|
+
fabricated.
|
|
118
|
+
|
|
119
|
+
### Step 5 — Build the candidate graph
|
|
120
|
+
|
|
121
|
+
Join claims using explicit links, WBS/feature IDs, dependencies, AC titles, paths, symbols,
|
|
122
|
+
command/flag names, DTO/schema/config keys, and normalized domain terms. **Do not compare every
|
|
123
|
+
artifact with every other artifact** — an unbounded all-pairs comparison is prohibited. See
|
|
124
|
+
[references/comparison-protocol.md](references/comparison-protocol.md).
|
|
125
|
+
|
|
126
|
+
### Step 6 — Audit within each pillar
|
|
127
|
+
|
|
128
|
+
- **Source**: contracts/implementations/tests/config/registrations.
|
|
129
|
+
- **Tasks**: requirements/AC/dependencies/status/solution.
|
|
130
|
+
- **Features**: hierarchy/AC/status/index projections.
|
|
131
|
+
- **Authority**: ownership/decision/scope/process projections.
|
|
132
|
+
|
|
133
|
+
### Step 7 — Audit all applicable cross-pillar boundaries
|
|
134
|
+
|
|
135
|
+
source↔task, source↔feature, source↔authority, task↔feature, task↔authority, feature↔authority —
|
|
136
|
+
every boundary applicable to the selected scope.
|
|
137
|
+
|
|
138
|
+
### Step 8 — Classify and challenge
|
|
139
|
+
|
|
140
|
+
Before asserting a conflict, test each candidate against lifecycle, supersession,
|
|
141
|
+
abstraction-level, and intentional-deprecation explanations. Mere wording or abstraction-level
|
|
142
|
+
difference is **not** a conflict. Low confidence never disappears — it is reported as a candidate or
|
|
143
|
+
unresolved item, not promoted to a definitive conflict.
|
|
144
|
+
|
|
145
|
+
### Step 9 — Report
|
|
146
|
+
|
|
147
|
+
Order findings by severity then confidence. Show clean boundaries, unresolved authority, coverage
|
|
148
|
+
gaps, reused context, scan cost, and the recommended owner. Markdown and `--json` carry the same
|
|
149
|
+
findings, evidence, authority provenance, coverage, unresolved decisions, and remediation state. See
|
|
150
|
+
[references/finding-contract.md](references/finding-contract.md).
|
|
151
|
+
|
|
152
|
+
### Step 10 — Remediate only when requested
|
|
153
|
+
|
|
154
|
+
With `--resolve`: present the proposed repair set, obtain explicit confirmation, revalidate evidence
|
|
155
|
+
freshness, then route each approved repair through its verified owner surface. Report the completed,
|
|
156
|
+
failed, and untouched sets; never silently roll forward past a partial failure. See
|
|
157
|
+
[references/remediation-routing.md](references/remediation-routing.md).
|
|
158
|
+
|
|
159
|
+
## Output
|
|
160
|
+
|
|
161
|
+
**Default:** a Markdown audit report with ordered findings, coverage accounting, and unresolved
|
|
162
|
+
items; no mutation.
|
|
163
|
+
|
|
164
|
+
**With `--json`:** the same envelope as machine-readable JSON.
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"schema_version": 1,
|
|
169
|
+
"command": "dev-find-conflict",
|
|
170
|
+
"scope": "docs/00_ADR.md",
|
|
171
|
+
"mode": "adaptive",
|
|
172
|
+
"pillars": ["authority"],
|
|
173
|
+
"authority_map": {},
|
|
174
|
+
"inventory": [],
|
|
175
|
+
"findings": [],
|
|
176
|
+
"unresolved": [],
|
|
177
|
+
"coverage": { "complete": true },
|
|
178
|
+
"cost": {},
|
|
179
|
+
"remediation": {},
|
|
180
|
+
"errors": []
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Top-level JSON keys: `schema_version, command, scope, mode, pillars, authority_map, inventory,
|
|
185
|
+
findings, unresolved, coverage, cost, remediation, errors`.
|
|
186
|
+
|
|
187
|
+
## Integration
|
|
188
|
+
|
|
189
|
+
- **Authority matrix + fallback** — [references/authority-resolution.md](references/authority-resolution.md)
|
|
190
|
+
- **Comparison protocol + token controls** — [references/comparison-protocol.md](references/comparison-protocol.md)
|
|
191
|
+
- **Finding/result contracts + false-positive rules** — [references/finding-contract.md](references/finding-contract.md)
|
|
192
|
+
- **Confirmed remediation routing** — [references/remediation-routing.md](references/remediation-routing.md)
|
|
193
|
+
|
|
194
|
+
## Required Permissions
|
|
195
|
+
|
|
196
|
+
| Capability | Purpose |
|
|
197
|
+
| --------------- | ---------------------------------------------------------------------------------------- |
|
|
198
|
+
| `Read` | Authority files, task/feature files, source, numbered docs |
|
|
199
|
+
| `Grep` / `Glob` | Pattern search and scope discovery |
|
|
200
|
+
| `Bash` | `git`, `rg`, `spur task/feature ... --json`, `spur ... check`, `sp:doc-evolve` audit |
|
|
201
|
+
| `Write` | Only for temp files / owner-routed repair payloads after confirmation (with `--resolve`) |
|
|
202
|
+
|
|
203
|
+
## Platform Notes
|
|
204
|
+
|
|
205
|
+
### Claude Code
|
|
206
|
+
|
|
207
|
+
- Invoke via `/sp:dev-find-conflict …` or `Skill(skill="sp:conflict-finding", args="…")`.
|
|
208
|
+
- Prefer structured tools for discovery; read full artifacts only for candidate subjects.
|
|
209
|
+
|
|
210
|
+
### Codex / OpenClaw / OpenCode / Antigravity / Pi
|
|
211
|
+
|
|
212
|
+
- Read this skill and follow the 10-step protocol (slash commands adapted at install time).
|
|
213
|
+
- Prefer `rg` for scanning; expand globs carefully; treat `.spur/context/` as optional, freshness-gated evidence.
|
|
214
|
+
|
|
215
|
+
## Shipped command
|
|
216
|
+
|
|
217
|
+
### `/sp:dev-find-conflict`
|
|
218
|
+
|
|
219
|
+
Thin wrapper: `Skill(skill="sp:conflict-finding", args="$ARGUMENTS")`.
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
/sp:dev-find-conflict
|
|
223
|
+
/sp:dev-find-conflict docs/00_ADR.md
|
|
224
|
+
/sp:dev-find-conflict --pillar tasks --mode full
|
|
225
|
+
/sp:dev-find-conflict 0486 --resolve
|
|
226
|
+
/sp:dev-find-conflict "command surface" --json
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Common rationalizations
|
|
230
|
+
|
|
231
|
+
| Rationalization | Reality |
|
|
232
|
+
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
233
|
+
| "A textual difference is a conflict." | Only contradiction, stale, duplicate, omission, orphan, or ambiguous-authority supported by evidence counts; wording/abstraction differences are not conflicts. |
|
|
234
|
+
| "Lower-numbered docs always win." | Authority is claim-specific; the constitution's precedence applies only within its stated boundary. |
|
|
235
|
+
| "Code is always right." | Code is authoritative for what currently happens, not automatically for what should happen. |
|
|
236
|
+
| "`--resolve` authorizes automatic repair." | It opens the proposal/confirmation workflow; every repair still needs explicit confirmation and a freshness check, then the owner surface. |
|
|
237
|
+
| "Adaptive can reuse any context." | Reuse requires freshness + verifiable provenance; absent/stale/unverifiable context degrades to a cold scan or an explicit incomplete-coverage result. |
|
|
238
|
+
|
|
239
|
+
## Red flags
|
|
240
|
+
|
|
241
|
+
- Asserting a conflict from wording alone or an unbounded all-pairs comparison.
|
|
242
|
+
- Forcing an ambiguous/missing authority through a global ranking instead of an unresolved HITL item.
|
|
243
|
+
- Silently omitting a selected pillar or a tool failure (no coverage accounting).
|
|
244
|
+
- Claiming "comprehensive" when `coverage.complete` is false.
|
|
245
|
+
- Any mutation in audit mode, or automatic mutation merely because `--resolve` is present.
|
|
246
|
+
- Editing a derived projection before its authority.
|
|
247
|
+
- Adding a production analyzer, index/cache/database, dependency, or dedicated subagent in v1.
|
|
248
|
+
|
|
249
|
+
## Reference files
|
|
250
|
+
|
|
251
|
+
- **[references/authority-resolution.md](references/authority-resolution.md)** — authority discovery, claim taxonomy, fallback matrix, ambiguity protocol
|
|
252
|
+
- **[references/comparison-protocol.md](references/comparison-protocol.md)** — inventories, subject clustering, internal/cross-pillar comparisons, token controls
|
|
253
|
+
- **[references/finding-contract.md](references/finding-contract.md)** — classifications, evidence rules, Markdown/JSON schemas, severity/confidence/coverage
|
|
254
|
+
- **[references/remediation-routing.md](references/remediation-routing.md)** — HITL, freshness recheck, owner routing, partial-failure/idempotency behavior
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: authority-resolution
|
|
3
|
+
description: "Authority discovery, claim taxonomy, fallback authority matrix, precedence rules, and the ambiguity protocol for sp:conflict-finding."
|
|
4
|
+
see_also:
|
|
5
|
+
- conflict-finding
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Authority resolution — subject + claim type, never a whole file
|
|
9
|
+
|
|
10
|
+
The hard problem of conflict finding is not text matching; it is deciding **which artifact is
|
|
11
|
+
authoritative for a given claim**. Authority is resolved for a **subject + claim type**, never for
|
|
12
|
+
a whole file. Two files can disagree without any conflict if they claim different kinds of things
|
|
13
|
+
about different subjects, and a single file can be authoritative for one claim type and merely a
|
|
14
|
+
projection for another.
|
|
15
|
+
|
|
16
|
+
This file is the SSOT for **Step 2 — Discover local authority** of the audit protocol. It defines
|
|
17
|
+
(a) how authority is discovered, (b) the claim taxonomy and fallback matrix, (c) the precedence
|
|
18
|
+
rules that resolve edges, and (d) the ambiguity protocol that stops rather than fabricates a
|
|
19
|
+
winner. It pairs with:
|
|
20
|
+
|
|
21
|
+
- [comparison-protocol.md](./comparison-protocol.md) — how subjects and claims are clustered and
|
|
22
|
+
compared once authority is known.
|
|
23
|
+
- [finding-contract.md](./finding-contract.md) — the `status`/`conflict_type` fields a finding
|
|
24
|
+
carries, including `needs-authority-decision`.
|
|
25
|
+
- [remediation-routing.md](./remediation-routing.md) — how a resolved authority routes a confirmed
|
|
26
|
+
repair through its owner, and how ambiguous authority halts mutation.
|
|
27
|
+
|
|
28
|
+
## 1. Authority discovery
|
|
29
|
+
|
|
30
|
+
Authority is discovered in two passes, and the second pass can only override the first when the
|
|
31
|
+
project is **explicit** about it.
|
|
32
|
+
|
|
33
|
+
### 1.1 Entry / process pass (always first)
|
|
34
|
+
|
|
35
|
+
Read in order, before interpreting any difference:
|
|
36
|
+
|
|
37
|
+
1. `AGENTS.md` (project root or nearest ancestor) — project entry, routing, and any project-local
|
|
38
|
+
override rules.
|
|
39
|
+
2. `docs/99_PROJECT_CONSTITUTION.md` (when present) — the process SSOT. Per the Spur documentation
|
|
40
|
+
map, **lower-numbered numbered docs win on content; `99` owns process**. It may declare
|
|
41
|
+
precedence boundaries, ownership, and change authority that the fallback matrix must respect.
|
|
42
|
+
|
|
43
|
+
`AGENTS.md` and the constitution declare **project-local rules**. When those rules are explicit
|
|
44
|
+
about a claim type, they win over the fallback matrix in §2. When they are silent or merely restate
|
|
45
|
+
defaults, apply the documented fallback matrix.
|
|
46
|
+
|
|
47
|
+
### 1.2 Default authority set
|
|
48
|
+
|
|
49
|
+
The default authority set is the union of these files **when present**:
|
|
50
|
+
|
|
51
|
+
| Path | Role in the model |
|
|
52
|
+
|------|-------------------|
|
|
53
|
+
| `AGENTS.md` | project entry, routing, project-local overrides |
|
|
54
|
+
| `docs/00_ADR.md` | structural decisions and rationale |
|
|
55
|
+
| `docs/01_PRD.md` | product scope and non-goals |
|
|
56
|
+
| `docs/03_ARCHITECTURE.md` | current architecture contract |
|
|
57
|
+
| `docs/04_DESIGN.md` | command/API/schema surface |
|
|
58
|
+
| `docs/05_FEATURES.md` | feature status projections |
|
|
59
|
+
| `docs/99_PROJECT_CONSTITUTION.md` | process and contribution rules |
|
|
60
|
+
|
|
61
|
+
Absent optional files are **reported without blocking the audit**. Their absence is itself an
|
|
62
|
+
omission candidate for the `authority` pillar, but it does not halt discovery or comparison of the
|
|
63
|
+
present authorities.
|
|
64
|
+
|
|
65
|
+
### 1.3 Authority is resolved for a subject + claim type
|
|
66
|
+
|
|
67
|
+
Never ask "which file wins?" in the abstract. Always ask:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
For this SUBJECT, and this CLAIM TYPE, which artifact is normative?
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
A subject is a concrete named thing under audit — a WBS id, a feature id, a symbol, a command, a
|
|
74
|
+
config key, a path, a domain term, or a free-form concept the operator scoped. A claim type is one
|
|
75
|
+
of the eight rows of §2. The same pair of files may be ordered differently for different claim
|
|
76
|
+
types: `docs/01_PRD.md` is normative for product scope but only a projection for implementation
|
|
77
|
+
behavior.
|
|
78
|
+
|
|
79
|
+
## 2. Claim taxonomy and fallback authority matrix
|
|
80
|
+
|
|
81
|
+
The fallback matrix applies when the project declares no explicit rule. Each row names the
|
|
82
|
+
**normative authority** (what the claim *should* be), the **constraint / projection** artifacts
|
|
83
|
+
(what derives from or must not contradict it), and the **observed reality** (what currently *is*,
|
|
84
|
+
recorded separately).
|
|
85
|
+
|
|
86
|
+
| Claim type | Normative authority | Constraint / projection | Observed reality |
|
|
87
|
+
| --- | --- | --- | --- |
|
|
88
|
+
| Process and contribution rules | `docs/99_PROJECT_CONSTITUTION.md` | `AGENTS.md`, templates, workflows | actual harness behavior and gate output |
|
|
89
|
+
| Structural decision / rationale | accepted `docs/00_ADR.md` entry | architecture/design docs | source/module topology |
|
|
90
|
+
| Product scope and non-goals | `docs/01_PRD.md` | feature tree and roadmap | shipped surface |
|
|
91
|
+
| Feature goal and AC | feature file, within PRD/ADR bounds | tasks and `docs/05_FEATURES.md` | implementation and verification evidence |
|
|
92
|
+
| Task obligation/status | task Requirements/AC plus lifecycle verdict | feature AC and task Solution/Testing | code, tests, gate output |
|
|
93
|
+
| Architecture mechanism | ADR when it decides the seam; otherwise current architecture contract | `docs/03_ARCHITECTURE.md` | code dependency/topology |
|
|
94
|
+
| Command/API/schema surface | owning command/contract/schema source under existing ADRs | `docs/04_DESIGN.md` | registered runtime behavior and tests |
|
|
95
|
+
| Implementation behavior | applicable task/feature/doc obligation defines "should" | tests as executable projection | source and runtime behavior define "is" |
|
|
96
|
+
|
|
97
|
+
### 2.1 Reading the matrix
|
|
98
|
+
|
|
99
|
+
- **Normative authority** is the source of truth for what *should* be true about the claim. A
|
|
100
|
+
difference between a projection and its authority is a **stale projection**; a difference between
|
|
101
|
+
two normative authorities for the same subject+claim type is a candidate **contradiction**.
|
|
102
|
+
- **Constraint / projection** artifacts derive from, or must stay within, the authority. They are
|
|
103
|
+
judged *against* their authority, not as independent truth.
|
|
104
|
+
- **Observed reality** is never merged into the normative column. Code/tests/runtime output are
|
|
105
|
+
recorded as what *is*, and the gap between "should" (normative) and "is" (observed) is the
|
|
106
|
+
conflict surface — but the two are always reported separately (see §5).
|
|
107
|
+
|
|
108
|
+
## 3. Precedence rules
|
|
109
|
+
|
|
110
|
+
These five rules resolve an authority edge once the claim type is known. Every precedence
|
|
111
|
+
decision in a finding must cite the project rule or documented fallback that justifies it
|
|
112
|
+
(requirement R3).
|
|
113
|
+
|
|
114
|
+
### Rule 1 — Lower-numbered docs do not globally beat everything
|
|
115
|
+
|
|
116
|
+
A lower-numbered numbered document (e.g. `docs/00_ADR.md` vs `docs/04_DESIGN.md`) does **not**
|
|
117
|
+
automatically win every argument. The constitution's documented precedence applies **only within
|
|
118
|
+
its stated boundary** (typically "lower number wins on content; `99` owns process"). Outside that
|
|
119
|
+
boundary the fallback matrix (§2) decides by claim type. Do not map "lower number ⇒ more
|
|
120
|
+
authoritative" as a global ranking.
|
|
121
|
+
|
|
122
|
+
### Rule 2 — Code is authoritative for what happens, not what should happen
|
|
123
|
+
|
|
124
|
+
Source and runtime behavior define the **observed reality** ("is"). They are authoritative for
|
|
125
|
+
*what currently happens*. They are **not** automatically authoritative for *what should happen*:
|
|
126
|
+
that is defined by the applicable obligation (task/feature/doc), per the `Implementation behavior`
|
|
127
|
+
row. A gap where code diverges from its obligation is a conflict candidate; it is not resolved by
|
|
128
|
+
"code wins."
|
|
129
|
+
|
|
130
|
+
### Rule 3 — A todo feature/task differing from code is planned work, not stale code
|
|
131
|
+
|
|
132
|
+
When a feature/task is still `todo` (or its lifecycle/supersession metadata does not say otherwise)
|
|
133
|
+
and the code does not yet reflect it, the difference is **planned work**, not stale code or a
|
|
134
|
+
contradiction. The project intends to ship it later. Treat it as stale only when the lifecycle or
|
|
135
|
+
supersession metadata indicates the obligation was abandoned, superseded, or already-resolved.
|
|
136
|
+
This is the classic false-positive guard: distinguishing "not yet implemented" from "implemented
|
|
137
|
+
differently."
|
|
138
|
+
|
|
139
|
+
### Rule 4 — Accepted ADRs beat derived projections; superseded ADRs are historical
|
|
140
|
+
|
|
141
|
+
An **accepted** `docs/00_ADR.md` entry is normative for the structural decision and architecture
|
|
142
|
+
mechanism it decides, and beats derived architecture/design projections that contradict it. A
|
|
143
|
+
**superseded** ADR is historical evidence, not current authority: it documents what was decided
|
|
144
|
+
and later replaced, and must not be treated as governing. When auditing, check supersession
|
|
145
|
+
metadata before asserting that an older ADR contradicts current code or docs.
|
|
146
|
+
|
|
147
|
+
### Rule 5 — Incomparable authorities ⇒ needs-authority-decision
|
|
148
|
+
|
|
149
|
+
If two authorities for the same subject+claim type are **incomparable** (no project rule and no
|
|
150
|
+
fallback row orders them; neither supersedes the other within a stated boundary), the finding
|
|
151
|
+
status is `needs-authority-decision`. **No repair is proposed as settled fact.** See §4. This rule
|
|
152
|
+
is the anti-pattern boundary: never force a winner through a global ranking detached from claim
|
|
153
|
+
type and local process rules.
|
|
154
|
+
|
|
155
|
+
## 4. Ambiguity protocol
|
|
156
|
+
|
|
157
|
+
### 4.1 What counts as ambiguous
|
|
158
|
+
|
|
159
|
+
Authority is ambiguous — and must stop rather than fabricate — in three cases:
|
|
160
|
+
|
|
161
|
+
| Case | Meaning |
|
|
162
|
+
|------|---------|
|
|
163
|
+
| **Missing** | No normative authority exists for the subject+claim type (e.g. no ADR decides a seam, no PRD line covers a scope question), and no fallback row supplies one |
|
|
164
|
+
| **Incomparable** | Two authorities exist but no rule or fallback row orders them (Rule 5) |
|
|
165
|
+
| **Genuinely ambiguous** | An authority is self-contradictory, underspecified, or its boundary cannot be determined from the artifacts |
|
|
166
|
+
|
|
167
|
+
### 4.2 What ambiguity means for a finding
|
|
168
|
+
|
|
169
|
+
- The finding's `status` is `needs-authority-decision` (per [finding-contract.md](./finding-contract.md)).
|
|
170
|
+
- It is an **unresolved HITL item**: it surfaces for the operator to decide, and is never silently
|
|
171
|
+
resolved by a heuristic or global ranking.
|
|
172
|
+
- `proposed_repair` is left as **none / pending decision** — the skill must not propose a repair as
|
|
173
|
+
settled fact when authority is unresolved.
|
|
174
|
+
- The finding still records the candidate authorities, the claim paraphrase, and the evidence for
|
|
175
|
+
both sides, so the operator has everything needed to decide. Uncertainty is preserved, not erased.
|
|
176
|
+
- Low confidence never disappears: ambiguous/missing authority is reported as an unresolved item,
|
|
177
|
+
not promoted to a definitive conflict and not dropped.
|
|
178
|
+
|
|
179
|
+
### 4.3 Remediation consequence
|
|
180
|
+
|
|
181
|
+
Per [remediation-routing.md](./remediation-routing.md), ambiguous authority means **stop for an
|
|
182
|
+
operator decision; do not mutate either side**. The operator decides which authority governs (or
|
|
183
|
+
that an authority needs to be created/updated through its owner surface), and only then can a
|
|
184
|
+
confirmed repair proceed. See §6 for owner surfaces.
|
|
185
|
+
|
|
186
|
+
## 5. Normative authority vs observed reality
|
|
187
|
+
|
|
188
|
+
Every finding records **normative authority** and **observed reality** as separate fields, never
|
|
189
|
+
merged:
|
|
190
|
+
|
|
191
|
+
| Field | What it holds | Example |
|
|
192
|
+
|-------|---------------|---------|
|
|
193
|
+
| `normative_authority` | The claim as the governing artifact states it ("should") | PRD §3: "no background sync" |
|
|
194
|
+
| `observed_reality` | The claim as source/runtime/tests currently show it ("is") | `src/sync.ts` implements background sync |
|
|
195
|
+
|
|
196
|
+
Keeping them separate is what makes a stale-projection finding legible: the projection says one
|
|
197
|
+
thing, the authority another, the code a third — and collapsing them hides the direction of drift.
|
|
198
|
+
The conflict surface is the **gap** between normative and observed, not either value alone.
|
|
199
|
+
|
|
200
|
+
## 6. Owner routing for a resolved authority
|
|
201
|
+
|
|
202
|
+
Once authority is resolved (not ambiguous), a confirmed repair routes through the owning surface.
|
|
203
|
+
This table mirrors [remediation-routing.md](./remediation-routing.md) and ties each owner to the
|
|
204
|
+
authority it governs:
|
|
205
|
+
|
|
206
|
+
| Owner | Repair route | Governs (claim types) |
|
|
207
|
+
|-------|--------------|----------------------|
|
|
208
|
+
| Task/feature corpus | `sp:spur-cli` / `spur task` / `spur feature`; never direct file writes | Task obligation/status, feature goal and AC |
|
|
209
|
+
| Numbered docs and AGENTS projections | `sp:doc-evolve`; authority first, derived projections second | Process rules, structural decision, product scope, architecture, command surface |
|
|
210
|
+
| Source/tests | create/use a Spur task and route through `sp:spur-dev` / build competencies | Implementation behavior, architecture mechanism |
|
|
211
|
+
| Command/skill capability source | Superskill command/skill lifecycle in the owning plugin source | Command/API/schema surface |
|
|
212
|
+
| Ambiguous authority | **stop** for an operator decision; do not mutate either side | (all, when unresolved) |
|
|
213
|
+
|
|
214
|
+
Never edit a derived projection before its authority. The authority column of §2 is always the
|
|
215
|
+
owner surface's source of truth; a projection is brought into line with it, not the reverse.
|
|
216
|
+
|
|
217
|
+
## 7. Worked examples
|
|
218
|
+
|
|
219
|
+
### Example A — task AC vs code (planned work vs contradiction)
|
|
220
|
+
|
|
221
|
+
- Subject: `0486` · Claim type: `Task obligation/status`
|
|
222
|
+
- Task `status: todo`, AC not yet implemented in code.
|
|
223
|
+
- Rule 3 applies: the difference is **planned work**, not a contradiction.
|
|
224
|
+
- Normative: task AC states the obligation. Observed: code lacks the feature.
|
|
225
|
+
- Verdict: no conflict (or an informational note), not a `stale`/`contradiction` finding.
|
|
226
|
+
|
|
227
|
+
### Example B — PRD non-goal vs shipped surface
|
|
228
|
+
|
|
229
|
+
- Subject: "background sync" · Claim type: `Product scope and non-goals`
|
|
230
|
+
- PRD §3: "no background sync" (normative). `src/sync.ts` implements it (observed).
|
|
231
|
+
- Rule 2 applies: code is authoritative for *what happens*, PRD for *what should happen*.
|
|
232
|
+
- Normative ≠ observed ⇒ gap is a conflict candidate; PRD is the authority, so this is a
|
|
233
|
+
**contradiction** (shipped surface outside scope) unless a later ADR superseded the non-goal.
|
|
234
|
+
|
|
235
|
+
### Example C — two ADRs, one superseded
|
|
236
|
+
|
|
237
|
+
- Subject: "sync seam" · Claim type: `Architecture mechanism`
|
|
238
|
+
- `docs/00_ADR.md`: ADR-014 decides X; ADR-021 supersedes ADR-014 and decides Y.
|
|
239
|
+
- Rule 4 applies: ADR-021 is current authority; ADR-014 is historical evidence.
|
|
240
|
+
- Code implementing X is **stale** against the current authority (ADR-021 → Y), not a contradiction
|
|
241
|
+
with ADR-014.
|
|
242
|
+
|
|
243
|
+
### Example D — incomparable authorities
|
|
244
|
+
|
|
245
|
+
- Subject: "command surface" · Claim type: `Command/API/schema surface`
|
|
246
|
+
- Owning command source and `docs/04_DESIGN.md` disagree, and no ADR/rule orders them, and they are
|
|
247
|
+
not related as authority↔projection.
|
|
248
|
+
- Rule 5 applies: **incomparable** ⇒ `needs-authority-decision`, unresolved HITL item, no proposed
|
|
249
|
+
repair, no fabricated winner.
|
|
250
|
+
|
|
251
|
+
## 8. Related
|
|
252
|
+
|
|
253
|
+
- Skill entry: [../SKILL.md](../SKILL.md)
|
|
254
|
+
- Comparison and clustering: [comparison-protocol.md](./comparison-protocol.md)
|
|
255
|
+
- Finding/status schema: [finding-contract.md](./finding-contract.md)
|
|
256
|
+
- Owner routing and HITL: [remediation-routing.md](./remediation-routing.md)
|
|
257
|
+
- Process authority: `sp:doc-evolve` · Corpus ownership: `sp:spur-cli` · Lifecycle: `sp:spur-dev` ·
|
|
258
|
+
Verification: `sp:code-verification`
|