dic-workflow-kit 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/.codex-plugin/plugin.json +14 -10
  2. package/CHANGELOG.md +124 -1
  3. package/INSTRUCTION.md +232 -10
  4. package/README.md +376 -113
  5. package/README.zh-CN.md +342 -130
  6. package/adapters/bdd/README.md +21 -0
  7. package/adapters/bitfun/README.md +12 -2
  8. package/agents/adversarial-challenger.md +23 -0
  9. package/agents/code-repairer.md +8 -1
  10. package/agents/contract-oracle.md +4 -1
  11. package/agents/evidence-auditor.md +23 -0
  12. package/agents/final-reviewer.md +26 -2
  13. package/agents/flow-auditor.md +1 -1
  14. package/agents/impact-analyst.md +21 -0
  15. package/agents/impl-inspector.md +7 -1
  16. package/agents/profile-builder.md +7 -3
  17. package/agents/repair-planner.md +10 -1
  18. package/agents/semantic-conflict-auditor.md +21 -0
  19. package/agents/spec-reader.md +4 -1
  20. package/agents/validation-runner.md +11 -1
  21. package/dist/dic-workflow-kit.mjs +18 -7
  22. package/package.json +5 -2
  23. package/schemas/final-result.schema.json +35 -2
  24. package/schemas/harness-plan.schema.json +143 -0
  25. package/schemas/harness-run.schema.json +75 -0
  26. package/schemas/ontology-action-record.schema.json +62 -0
  27. package/schemas/ontology-action.schema.json +118 -0
  28. package/schemas/ontology-attestation.schema.json +187 -0
  29. package/schemas/ontology-patch.schema.json +48 -0
  30. package/schemas/ontology-snapshot.schema.json +326 -0
  31. package/schemas/project-profile.schema.json +44 -0
  32. package/skills/knowledge-bdd/SKILL.md +14 -2
  33. package/skills/knowledge-change-impact/SKILL.md +43 -0
  34. package/skills/knowledge-change-impact/agents/openai.yaml +4 -0
  35. package/skills/knowledge-openspec/SKILL.md +2 -1
  36. package/skills/knowledge-repair-distill/SKILL.md +2 -1
  37. package/skills/quality-adversarial-challenge/SKILL.md +42 -0
  38. package/skills/quality-adversarial-challenge/agents/openai.yaml +4 -0
  39. package/skills/quality-ci-gate/SKILL.md +45 -0
  40. package/skills/quality-ci-gate/agents/openai.yaml +4 -0
  41. package/skills/quality-ci-gate/references/ci-gate.md +22 -0
  42. package/skills/quality-code-review/SKILL.md +32 -0
  43. package/skills/quality-code-review/agents/openai.yaml +4 -0
  44. package/skills/quality-code-review/references/code-review.md +13 -0
  45. package/skills/quality-cross-spec-consistency/SKILL.md +45 -0
  46. package/skills/quality-cross-spec-consistency/agents/openai.yaml +4 -0
  47. package/skills/quality-dt-review/SKILL.md +32 -0
  48. package/skills/quality-dt-review/agents/openai.yaml +4 -0
  49. package/skills/quality-dt-review/references/dt-review.md +14 -0
  50. package/skills/quality-evidence-audit/SKILL.md +41 -0
  51. package/skills/quality-evidence-audit/agents/openai.yaml +4 -0
  52. package/skills/quality-repository-gate/SKILL.md +38 -0
  53. package/skills/quality-repository-gate/agents/openai.yaml +4 -0
  54. package/skills/quality-repository-gate/references/repository-gate.md +13 -0
  55. package/skills/quality-review-orchestrator/SKILL.md +100 -0
  56. package/skills/quality-review-orchestrator/agents/openai.yaml +4 -0
  57. package/skills/quality-review-orchestrator/references/quality-model.md +73 -0
  58. package/skills/quality-spec-review/SKILL.md +40 -0
  59. package/skills/quality-spec-review/agents/openai.yaml +4 -0
  60. package/skills/quality-spec-review/references/spec-review.md +14 -0
  61. package/skills/quality-sr-ar-review/SKILL.md +32 -0
  62. package/skills/quality-sr-ar-review/agents/openai.yaml +4 -0
  63. package/skills/quality-sr-ar-review/references/sr-ar-review.md +14 -0
  64. package/skills/workflow-core/SKILL.md +109 -1
  65. package/skills/workflow-harness/SKILL.md +73 -0
  66. package/skills/workflow-harness/agents/openai.yaml +4 -0
  67. package/skills/workflow-intake/SKILL.md +9 -2
  68. package/skills/workflow-profile/SKILL.md +17 -1
  69. package/skills/workflow-repair/SKILL.md +8 -4
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: quality-cross-spec-consistency
3
+ description: Detect semantic conflicts, incompatible obligations, stale baseline rules, and authority ambiguity across related specifications, schemas, configuration contracts, and design sources. Use during Spec intake, design review, archived-Change audits, or whenever project-profile consistencyScope requires repository-wide cross-Spec analysis.
4
+ metadata:
5
+ version: 1.1.4
6
+ ---
7
+
8
+ # Cross-Spec Consistency
9
+
10
+ Audit authoritative sources; do not rewrite them unless explicitly asked.
11
+
12
+ ## Workflow
13
+
14
+ 1. Read `reports/project-profile.json`.
15
+ 2. Start with `baselineSpecs` and `relatedBaselineSpecs`.
16
+ 3. Inspect ranked `semanticConsistencyCandidates`; treat them as search hints,
17
+ not proven conflicts.
18
+ 4. Search every `consistencyScope.authorityRoots` entry for the exact normative
19
+ symbols, states, fields, interfaces, and ownership terms in scope.
20
+ 5. Compare authority, lifecycle, modality, allowed inputs, defaults, ownership,
21
+ state transitions, and failure behavior.
22
+ 6. Classify each candidate as `CONSISTENT`, `REFINEMENT`, `CONFLICT`, or
23
+ `UNKNOWN`.
24
+ 7. Bind findings to exact source locations and hashes. A strict syntax
25
+ validation does not close a semantic finding.
26
+
27
+ ## Conflict rules
28
+
29
+ - Report a conflict when two current authoritative sources require
30
+ incompatible outcomes for the same condition.
31
+ - Report a refinement only when the narrower rule preserves the broader
32
+ contract and its authority is established.
33
+ - Report stale baseline when a later promoted rule changed behavior without
34
+ reconciling another current source.
35
+ - Do not infer precedence from file modification time, implementation behavior,
36
+ or passing tests.
37
+ - Block when authority is ambiguous and the difference changes implementation
38
+ or acceptance.
39
+
40
+ ## Output
41
+
42
+ Produce findings first with ID, severity, symbol, source A, source B, conflicting
43
+ clauses, authority analysis, implementation impact, and required resolution.
44
+ Finish with scope coverage, unknowns, and `PASS`, `PASS WITH FOLLOW-UP`, or
45
+ `BLOCKED`.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Cross-Spec Consistency"
3
+ short_description: "Find semantic conflicts across authoritative specifications"
4
+ default_prompt: "Use $quality-cross-spec-consistency to inspect the project-profile consistency scope and report source-backed cross-Spec conflicts."
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: quality-dt-review
3
+ description: Evaluate candidate-bound developer-test effectiveness through requirement and risk coverage, negative paths, assertion strength, isolation, determinism, mutation sensitivity, and production relevance. Use when implementation or test risk changes during development, DIC repair, or pre-admission; re-run when affected code, tests, fixtures, or requirements change.
4
+ metadata:
5
+ version: 1.1.4
6
+ ---
7
+
8
+ # Quality DT Review
9
+
10
+ Judge whether tests can detect important defects, not whether test counts or line coverage look high.
11
+
12
+ ## Workflow
13
+
14
+ 1. Read `references/dt-review.md`.
15
+ 2. Map requirements and risks to executable tests and negative cases.
16
+ 3. Inspect assertions, fixtures, mocks, data variation, concurrency, failure injection, and environment assumptions.
17
+ 4. Run relevant tests and, where proportionate, targeted mutation or fault seeding.
18
+ 5. Detect tests that merely mirror implementation, pass without product behavior, or hide flaky outcomes.
19
+ 6. Bind the decision to requirement, implementation, test, and fixture hashes.
20
+ Mark it stale when any consumed input changes.
21
+ 7. Report effective coverage, gaps, and stale or non-reproducible evidence.
22
+
23
+ ## Profile-driven rules
24
+
25
+ Use project-profile module and test roots plus repository instructions to select
26
+ the exact affected commands. Require characterization, contract, architecture,
27
+ negative-path, or frontend evidence only when the detected change surface and
28
+ risk make them applicable.
29
+
30
+ ## Output
31
+
32
+ Use `PASS`, `PASS WITH FOLLOW-UP`, or `BLOCKED`. Include a risk-to-test matrix, ineffective-test findings, executed commands, reproducibility, flake status, mutation/fault evidence when used, and residual untested risks.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Quality DT Review"
3
+ short_description: "Assess developer-test effectiveness against delivery risks"
4
+ default_prompt: "Use $quality-dt-review to evaluate whether current candidate-bound developer tests provide effective risk-based evidence."
@@ -0,0 +1,14 @@
1
+ # Developer-test effectiveness
2
+
3
+ Assess:
4
+
5
+ - requirement and risk coverage, not only files or lines;
6
+ - normal, boundary, negative, invalid-state, authorization, concurrency, timeout, cancellation, dependency-failure, degradation, recovery, and compatibility paths;
7
+ - assertions on observable contract outcomes and side effects;
8
+ - ability to fail after a plausible fault is seeded;
9
+ - deterministic setup, isolated ownership, realistic schemas/data, controlled time/randomness, and cleanup;
10
+ - mock fidelity and whether excessive mocking bypasses integration risk;
11
+ - reproducible commands, environment, seed, candidate ref, duration, and artifacts;
12
+ - flakes, retries, quarantine duration, owner, and restoration criteria.
13
+
14
+ Classify tests as effective, partial, ineffective, missing, or not applicable. Coverage percentage alone never proves effectiveness.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: quality-evidence-audit
3
+ description: Audit whether quality and consistency claims are supported by current, content-addressed, candidate-bound evidence with reproducible provenance. Use before final DIC review or repository admission, after candidate changes, when gates reuse prior results, or whenever evidence completeness, freshness, causality, or scope is uncertain.
4
+ metadata:
5
+ version: 1.1.4
6
+ ---
7
+
8
+ # Evidence Audit
9
+
10
+ Audit the proof chain independently. Remain read-only.
11
+
12
+ ## Workflow
13
+
14
+ 1. Freeze and verify the `Candidate` identity before evaluating evidence.
15
+ 2. Enumerate every active `Claim`, its supporting `Evidence`, producing
16
+ `Validation` or `GateRun`, consumed inputs, and applicable `Policy`.
17
+ 3. Verify paths, SHA-256 hashes, timestamps, commands, target IDs, environment,
18
+ and candidate identity.
19
+ 4. Check that evidence covers the exact claim scope and negative paths; a
20
+ nearby passing test does not support a broader assertion.
21
+ 5. Run `ontology-evidence-check`, `ontology-validation-check`,
22
+ `ontology-implementation-check`, and `ontology-drift`.
23
+ 6. Run `qiheng harness-check --root . --json`; audit Harness evidence hashes,
24
+ dependency closure, candidate identity, and project-profile identity.
25
+ 7. Classify each claim as `SUPPORTED`, `PARTIAL`, `STALE`, `CONTRADICTED`, or
26
+ `UNSUPPORTED`.
27
+ 8. Record supported assertions as `Claim` objects linked to durable Evidence
28
+ with `SUPPORTED_BY`. Open a blocking finding for every terminal claim that
29
+ lacks a current proof chain.
30
+
31
+ ## Freshness rule
32
+
33
+ Any mutation to a consumed source, implementation unit, configuration,
34
+ generated artifact, test fixture, or policy invalidates dependent claims until
35
+ the relevant gate reruns against the new candidate.
36
+
37
+ ## Output
38
+
39
+ Produce a claim-to-evidence matrix with candidate hash, gate run, claim,
40
+ evidence IDs, coverage boundary, freshness, reproducibility, status, and
41
+ required action. Do not infer `PASS` from agent confidence or prose summaries.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Evidence Audit"
3
+ short_description: "Audit whether gate claims are current and evidence-backed"
4
+ default_prompt: "Audit gate claims against current content-addressed evidence and report unsupported assertions."
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: quality-repository-gate
3
+ description: Decide pre-commit repository admission from a frozen candidate, current required reviews, reproducible validation, unresolved findings, waivers, provenance, and policy. Use only after DIC consistency review and all applicable gate reruns, before commit, push, merge, check-in, or release admission.
4
+ metadata:
5
+ version: 1.1.4
6
+ ---
7
+
8
+ # Quality Repository Gate
9
+
10
+ Aggregate existing evidence; do not manufacture a green result by rerating missing evidence.
11
+
12
+ Require `qiheng harness-check --root .` to return `deliveryStatus: READY`.
13
+ Generate `reports/harness-report.md` and consume its candidate passport and
14
+ blocker list together with the ontology Attestation. A green CI job cannot
15
+ override an incomplete, stale, or evidence-broken Harness Run.
16
+
17
+ ## Workflow
18
+
19
+ 1. Freeze candidate ref, target ref, diff, and governing policy.
20
+ 2. Read `references/repository-gate.md`.
21
+ 3. Consume the orchestrator's applicability plan; reject omitted mandatory
22
+ reviews instead of independently redefining the plan.
23
+ 4. Verify that DIC consistency and every required Spec, SR/AR, code, DT,
24
+ security, performance, and CI decision are current for the frozen candidate.
25
+ 5. Verify every claimed command result belongs to the candidate bytes and is reproducible.
26
+ 6. Validate waiver authority, scope, expiry, owner, and compensating control.
27
+ 7. Issue one admission decision and a machine-readable evidence summary when the workflow supports it.
28
+
29
+ ## Profile-driven rules
30
+
31
+ Treat repository-required semantic reviews and module-specific gates discovered
32
+ from the project profile as mandatory. Record omissions. Do not approve changed
33
+ contracts, security boundaries, persistence ownership, or scope rules without
34
+ accepted authority evidence.
35
+
36
+ ## Output
37
+
38
+ Use `ADMIT`, `ADMIT WITH FOLLOW-UP`, or `REJECT`; map these to the suite decisions `PASS`, `PASS WITH FOLLOW-UP`, and `BLOCKED`. Record candidate identity, reviews, validations, findings, waivers, residual risk, approver/owner where known, and evidence hashes or stable paths.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Quality Repository Gate"
3
+ short_description: "Decide pre-commit admission for a frozen candidate"
4
+ default_prompt: "Use $quality-repository-gate after DIC review and affected-gate reruns to decide pre-commit admission for this frozen candidate."
@@ -0,0 +1,13 @@
1
+ # Repository admission record
2
+
3
+ Freeze and record:
4
+
5
+ - target and candidate identifiers plus diff scope;
6
+ - applicable policy and artifact inventory;
7
+ - required specialist reviews and their current decisions;
8
+ - validation command, environment, time, result, evidence location/hash, and candidate binding;
9
+ - unresolved findings and cumulative residual risk;
10
+ - waiver authority, scope, expiry, owner, compensating control, and follow-up verification;
11
+ - final decision and reason.
12
+
13
+ Reject when candidate identity is ambiguous, evidence is stale/non-reproducible, mandatory review is absent, a P0/P1 remains, or a material unknown could alter the decision. Never let a successful unrelated check compensate for a failed mandatory one.
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: quality-review-orchestrator
3
+ description: Orchestrate a candidate-bound, evidence-based quality gate graph from imported specification through implementation, design-implementation consistency repair, and pre-commit admission. Use when a delivery may require multiple conditional or repeated Spec, SR/AR, code, developer-test, CI, or repository gates.
4
+ metadata:
5
+ version: 1.1.4
6
+ ---
7
+
8
+ # Quality Review Orchestrator
9
+
10
+ Produce one auditable decision without replacing specialist review with a summary.
11
+
12
+ ## Workflow
13
+
14
+ 1. Establish the review baseline: repository, imported Spec/change, target and candidate identity, intended delivery, changed artifacts, governing sources, and commands actually available. Run `qiheng harness-init --root .` after the project profile exists and use its Plan as the only gate topology.
15
+ 2. Read `references/quality-model.md`. Classify every material statement as fact, inference, assumption, or unknown.
16
+ 3. Build an applicability plan from the current change surface and risk. Select only justified specialist Skills:
17
+ - `$quality-spec-review`
18
+ - `$quality-sr-ar-review`
19
+ - `$quality-code-review`
20
+ - `$quality-dt-review`
21
+ - `$quality-adversarial-challenge`
22
+ - `$quality-evidence-audit`
23
+ - `$quality-cross-spec-consistency`
24
+ - `$knowledge-change-impact`
25
+ - `$quality-repository-gate`
26
+ - `$quality-ci-gate`
27
+ 4. For DIC-enabled projects, reuse the current ontology snapshot and evidence chain. Do not create a parallel source of truth.
28
+ 5. Track every gate by phase, candidate identity, inputs, dependencies, status, and evidence. A gate may run more than once.
29
+ 6. When design, code, tests, pipeline policy, or candidate bytes change, mark affected decisions `STALE` and reschedule from the earliest affected boundary.
30
+ 7. Reconcile current specialist findings by evidence and scope. Never average away a blocker.
31
+ 8. Publish the unified report using the required output below.
32
+ 9. Record every terminal specialist result with `qiheng harness-record`, then
33
+ run `qiheng harness-check` and generate `qiheng harness-report`.
34
+
35
+ ## DIC gate lifecycle
36
+
37
+ Use the following lifecycle. It is a dependency graph with feedback loops, not a
38
+ one-pass linear chain:
39
+
40
+ 1. **Import and check the Spec.** Intake resolves the imported Spec/change and
41
+ governing baseline. Run `$quality-spec-review`; add `$quality-sr-ar-review`
42
+ when architecture or realization is affected. Do not authorize
43
+ implementation while a required design gate is blocked.
44
+ 2. **Plan delivery gates.** Run `$quality-ci-gate` in `PLAN` phase to declare
45
+ the checks, evidence, budgets, and failure policy required for the expected
46
+ change surface.
47
+ 3. **Implement.** Let the implementation workflow proceed within approved
48
+ obligations and paths. Apply code and developer-test reviews whenever their
49
+ risk domains become applicable; do not assume they run only once.
50
+ 4. **Repair design-implementation inconsistency.** After implementation,
51
+ inspect the current candidate against the confirmed design. Repair only
52
+ source-backed gaps, validate each repair, and repeat until DIC invariants
53
+ converge or a blocker is recorded.
54
+ 5. **Re-enter affected gates.** A repair that changes Spec, architecture, code,
55
+ tests, or pipeline policy invalidates the dependent gate decisions. Re-run
56
+ only the affected gates against the new candidate.
57
+ 6. **Apply the pre-commit gate.** Run `$quality-ci-gate` in `VERIFY` phase.
58
+ Select `$quality-adversarial-challenge` only for material, distinct failure
59
+ hypotheses; do not create a fixed-size review team. Run
60
+ `$quality-evidence-audit` before terminal review. Compute DIC consistency
61
+ and Attestation, then run
62
+ `$quality-repository-gate`. Admission consumes only current decisions bound
63
+ to the frozen candidate.
64
+ 7. **Close.** Publish consistency, quality, and admission as distinct outcomes,
65
+ plus one derived delivery decision.
66
+
67
+ Skip a specialist only with an applicability reason and evidence. Do not run
68
+ Repository Gate early, and do not let it replace a missing specialist decision.
69
+ Persist the applicability record and specialist decisions under
70
+ `reports/quality/`, referencing ontology IDs and Evidence paths instead of
71
+ copying facts into an independent model.
72
+
73
+ ## Profile-driven specialization
74
+
75
+ Use the project profile and repository instructions to load local policies,
76
+ Skills, adapters, validation commands, and authority rules. Run cross-Spec
77
+ consistency when semantic search is required. Run change-impact analysis after
78
+ drift or repair before rescheduling gates. Never branch on a hardcoded
79
+ repository name.
80
+
81
+ ## Decision
82
+
83
+ Use `PASS`, `PASS WITH FOLLOW-UP`, or `BLOCKED`.
84
+
85
+ - Any unresolved P0/P1, stale evidence, unknown governing source, or missing mandatory review makes the result `BLOCKED`.
86
+ - P2 may yield `PASS WITH FOLLOW-UP` only with an owner, due condition, and verification route.
87
+ - P3 cannot compensate for a missing mandatory gate.
88
+ - `STALE` and `SKIPPED` are gate lifecycle states, not terminal quality
89
+ decisions. `SKIPPED` requires a recorded non-applicability reason.
90
+ - A non-skipped `GateRun` needs an explicit `Decision`; an active `Claim` needs
91
+ current `SUPPORTED_BY` Evidence; an unresolved `Challenge` blocks PASS.
92
+
93
+ ## Output
94
+
95
+ Report scope and baseline; candidate identity; applicability plan; gate
96
+ dependencies and run history; current specialist results; stale decisions;
97
+ findings; requirement-to-evidence gaps; commands and exact outcomes; waivers;
98
+ residual risks; consistency status; quality status; admission status; and the
99
+ derived delivery decision. Include evidence paths or command output references
100
+ for every gate claim.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Quality Review Orchestrator"
3
+ short_description: "Orchestrate repeatable, candidate-bound delivery gates"
4
+ default_prompt: "Use $quality-review-orchestrator to plan applicable gates, re-run invalidated gates after repair, and decide pre-commit readiness from current evidence."
@@ -0,0 +1,73 @@
1
+ # Quality evidence and decision model
2
+
3
+ ## Evidence classes
4
+
5
+ - `FACT`: directly supported by an authoritative artifact or reproduced command.
6
+ - `INFERENCE`: reasoned from stated facts; show the reasoning.
7
+ - `ASSUMPTION`: temporarily accepted premise; name its owner and validation route.
8
+ - `UNKNOWN`: missing or conflicting information. Block when it affects safety, contract, acceptance, or gate outcome.
9
+
10
+ Evidence strength, from weakest to strongest:
11
+
12
+ 1. `E0` unverified assertion.
13
+ 2. `E1` inspected artifact with stable location.
14
+ 3. `E2` reproducible executable evidence tied to candidate bytes.
15
+ 4. `E3` independent or production-representative evidence with provenance.
16
+
17
+ E0 never closes a finding. Evidence is stale when its consumed source or implementation bytes changed.
18
+
19
+ ## Gate lifecycle
20
+
21
+ A delivery uses a dependency graph, not a one-pass checklist. Record each gate
22
+ run with a stable ID, phase, applicability reason, candidate identity, consumed
23
+ artifact hashes, dependencies, decision, and evidence.
24
+
25
+ Gate lifecycle states:
26
+
27
+ - `PLANNED`: applicable but not executed.
28
+ - `RUNNING`: execution has started for the current candidate.
29
+ - `PASS`, `PASS WITH FOLLOW-UP`, `BLOCKED`: current specialist decisions.
30
+ - `STALE`: a consumed artifact, dependency, policy, or candidate changed.
31
+ - `SKIPPED`: not applicable, with a recorded reason and evidence.
32
+
33
+ `STALE` and `SKIPPED` are not successful decisions. A pre-commit admission gate
34
+ may consume only current decisions for the frozen candidate.
35
+
36
+ Invalidate from the earliest affected boundary:
37
+
38
+ | Changed surface | Decisions to invalidate |
39
+ | --- | --- |
40
+ | Spec or acceptance rule | Spec, SR/AR when affected, DIC mapping, code/DT evidence, CI verification, admission |
41
+ | Architecture, interface, data, or ownership | SR/AR, affected implementation and DT reviews, DIC evidence, CI verification, admission |
42
+ | Implementation | affected code/DT reviews, DIC evidence, CI verification, admission |
43
+ | Tests or fixtures | DT review, related validation, CI verification, admission |
44
+ | Pipeline or gate policy | CI plan/verification and admission |
45
+ | Candidate bytes or ref | every candidate-bound result whose recorded hash no longer matches |
46
+
47
+ ## Severity
48
+
49
+ - `P0`: active catastrophic security, data, safety, or service risk.
50
+ - `P1`: likely contract, isolation, availability, or delivery failure; blocks admission.
51
+ - `P2`: material quality debt with a bounded workaround or follow-up.
52
+ - `P3`: local maintainability or clarity improvement.
53
+
54
+ ## Finding record
55
+
56
+ Record: ID, domain, severity, claim, exact location, evidence class and reference, failure/impact, required action, owner if known, and status.
57
+
58
+ ## Gate rules
59
+
60
+ - `PASS`: all mandatory evidence is current; no unresolved P0/P1; no material unknown.
61
+ - `PASS WITH FOLLOW-UP`: only bounded P2/P3 remains, with owner, due condition, and verification.
62
+ - `BLOCKED`: mandatory evidence missing/stale, material unknown, or unresolved P0/P1.
63
+
64
+ Waivers are explicit records, never erased findings. A waiver needs authority, scope, rationale, expiry, owner, compensating control, and verification.
65
+
66
+ Keep three outcomes distinct:
67
+
68
+ - `consistencyStatus`: whether implementation matches confirmed design.
69
+ - `qualityStatus`: whether all applicable specialist quality gates are current.
70
+ - `admissionStatus`: whether the frozen candidate may be submitted.
71
+
72
+ Derive the delivery decision from these outcomes; never rewrite one outcome to
73
+ make another appear green.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: quality-spec-review
3
+ description: Review an imported product or software specification for completeness, consistency, testability, traceability, and hallucination resistance. Use before implementation for OpenSpec changes, requirement specifications, proposals, acceptance criteria, or model-authored specs, and re-run when their governing content changes.
4
+ metadata:
5
+ version: 1.1.4
6
+ ---
7
+
8
+ # Quality Spec Review
9
+
10
+ Review specification quality; do not silently rewrite the target unless asked.
11
+
12
+ ## Workflow
13
+
14
+ 1. Identify authoritative sources and precedence. Record missing or conflicting governance instead of guessing.
15
+ 2. Read `references/spec-review.md`.
16
+ 3. Build a trace map from goal to requirement, scenario, task, implementation owner, and validation.
17
+ 4. Check completeness, consistency, feasibility against current code, and unsupported claims.
18
+ 5. Run available syntax/strict validation, but do not substitute it for semantic review.
19
+ 6. Bind the result to the reviewed source hashes. Mark an older result stale
20
+ when the Spec, acceptance rules, or governing baseline changes.
21
+ 7. Report findings first, then coverage and decision.
22
+
23
+ ## Anti-hallucination rules
24
+
25
+ - Cite the exact artifact and location for every factual claim.
26
+ - Label inference, assumption, and unknown explicitly.
27
+ - Never invent files, APIs, owners, commands, test outcomes, architecture, or approved decisions.
28
+ - Verify model-authored names and paths against the repository.
29
+ - A material unknown that changes design or acceptance is blocking.
30
+
31
+ ## Profile-driven rules
32
+
33
+ Use project-profile design entries, authority roots, adapters, related
34
+ baselines, semantic candidates, protected paths, and repository instructions.
35
+ Apply repository-local review Skills only when discovered and applicable; never
36
+ hardcode a repository name, layout, or governance model.
37
+
38
+ ## Output
39
+
40
+ Use `PASS`, `PASS WITH FOLLOW-UP`, or `BLOCKED`. List each finding with ID, severity, location, violated requirement, evidence, impact, and required correction. Include a traceability matrix and unknowns register.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Quality Spec Review"
3
+ short_description: "Review specifications for evidence, coverage, and consistency"
4
+ default_prompt: "Use $quality-spec-review to review this specification for completeness, consistency, traceability, and unsupported claims."
@@ -0,0 +1,14 @@
1
+ # Specification review coverage
2
+
3
+ Check:
4
+
5
+ - goal, scope, non-goals, actors, trigger, preconditions, inputs, outputs, state, side effects, and ownership;
6
+ - ordered decision rules, lifecycle, concurrency, idempotency, timeout, cancellation, failure, degradation, recovery, compatibility, migration, and rollback where applicable;
7
+ - security, privacy, capacity, performance, reliability, observability, audit, diagnostics, maintainability, and testability;
8
+ - normal, boundary, negative, authorization, dependency-failure, and recovery scenarios;
9
+ - consistent terms, identifiers, defaults, units, enums, states, versions, and error semantics across proposal/design/spec/tasks/API/schema;
10
+ - requirements that are atomic, testable, uniquely owned, and traceable to tasks and validation;
11
+ - current-code feasibility and minimal delta for implementation specifications;
12
+ - unsupported statements, invented repository facts, circular citations, missing source precedence, and unlabelled assumptions.
13
+
14
+ A checklist row is not evidence. Cite the artifact and explain why it proves or fails the criterion.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: quality-sr-ar-review
3
+ description: Review Software Requirements, Architecture Review, or realization design for completeness, consistency, implementability, and architectural fitness. Use before architecture-affecting implementation and re-run when requirements, interfaces, data/state ownership, deployment, or architectural decisions change.
4
+ metadata:
5
+ version: 1.1.4
6
+ ---
7
+
8
+ # Quality SR/AR Review
9
+
10
+ Assess whether the design is sufficient to implement, operate, test, and evolve safely.
11
+
12
+ ## Workflow
13
+
14
+ 1. Confirm what SR and AR mean in the target process and record the governing template.
15
+ 2. Read `references/sr-ar-review.md`.
16
+ 3. Trace requirements to components, owners, interfaces, data, quality attributes, failure behavior, and verification.
17
+ 4. Test architectural choices against current repository boundaries and actual integration paths.
18
+ 5. Identify contradictory views, missing decisions, hidden shared state, and speculative abstractions.
19
+ 6. Bind the decision to the reviewed design and candidate context; invalidate it
20
+ when a consumed requirement or architectural surface changes.
21
+ 7. Report evidence-backed findings and the smallest required correction.
22
+
23
+ ## Profile-driven rules
24
+
25
+ Derive composition roots, module boundaries, public contracts, data/state
26
+ ownership, deployment surfaces, and mandatory review rules from the project
27
+ profile and repository evidence. Do not impose a package model or architecture
28
+ that the target repository does not declare.
29
+
30
+ ## Output
31
+
32
+ Use `PASS`, `PASS WITH FOLLOW-UP`, or `BLOCKED`. Include requirement-to-design coverage, architectural decisions and alternatives, quality-attribute scenarios, interface/data/state ownership, deployment/operations, validation, risks, and unresolved decisions.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Quality SR/AR Review"
3
+ short_description: "Review SR and AR documents for architecture fitness"
4
+ default_prompt: "Use $quality-sr-ar-review to assess these SR and AR design documents with evidence."
@@ -0,0 +1,14 @@
1
+ # SR and AR review coverage
2
+
3
+ Require, where applicable:
4
+
5
+ - business/system context, stakeholders, scope, constraints, assumptions, and terminology;
6
+ - functional requirements and measurable quality-attribute scenarios;
7
+ - current state, target state, minimal delta, component ownership, and dependency direction;
8
+ - runtime, data, interface, state, sequence, deployment, trust-boundary, and failure/recovery views;
9
+ - API/schema compatibility, persistence ownership, transactions, idempotency, migration, and rollback;
10
+ - capacity model, latency/throughput budgets, availability, resilience, observability, audit, security, privacy, and operations;
11
+ - architectural decisions with considered alternatives, trade-offs, and rejection reasons;
12
+ - implementation slices, test strategy, acceptance evidence, risks, and unresolved decisions.
13
+
14
+ Cross-check all views. The same fact must retain one owner, vocabulary, lifecycle, and failure policy. Diagrams without corresponding contracts and verification are explanatory, not sufficient design evidence.
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: workflow-core
3
- version: 1.1.2
4
3
  description: Core Design-Implementation Consistency workflow contract, evidence model, handoff rules, and final output expectations.
4
+ metadata:
5
+ version: 1.1.4
5
6
  ---
6
7
 
7
8
  # Workflow Core
@@ -15,11 +16,118 @@ Principles:
15
16
  - Every repair must trace to a source-backed obligation.
16
17
  - Subagents are useful only when they produce consumed evidence.
17
18
  - Final success requires validation evidence, residual-risk classification, and final artifacts.
19
+ - `reports/ontology-snapshot.json` is the semantic source of truth for objects, links, lifecycle, and provenance.
20
+ - Reports summarize the ontology; prose must not silently create or override semantic facts.
21
+
22
+ Ontology operating model:
23
+
24
+ - `profile-builder` discovers repository structure, authority roots, direct
25
+ related baselines, and ranked semantic candidates.
26
+ - `spec-reader`, `semantic-conflict-auditor`, and `contract-oracle` establish
27
+ source-backed, conflict-aware requirements and scenarios.
28
+ - `impact-analyst` identifies invalidated decisions and the minimal safe rerun
29
+ plan before implementation and after drift or repair.
30
+ - `impl-inspector` records existing code with `ObserveImplementation` or opens gaps.
31
+ - `repair-planner` proposes typed `RepairAction` objects.
32
+ - `code-repairer` executes only approved, path-bounded actions.
33
+ - `validation-runner` attaches `Validation` and `Evidence`.
34
+ - `adversarial-challenger` records falsifiable `Challenge` and reproducible
35
+ `Counterexample` objects against high-risk claims.
36
+ - `evidence-auditor` verifies that `Claim` objects are current and connected to
37
+ durable Evidence for the frozen `Candidate`.
38
+ - `final-reviewer` computes PASS from invariants instead of agent confidence.
39
+
40
+ Quality review envelope:
41
+
42
+ - `workflow-harness` freezes the candidate and owns the executable gate graph,
43
+ dependency state, evidence hashes, and final completeness check.
44
+ - `quality-review-orchestrator` owns a candidate-bound gate graph from imported
45
+ Spec through pre-commit admission.
46
+ - Spec and applicable SR/AR gates clear the design baseline before implementation.
47
+ - `quality-ci-gate` plans required checks before implementation and verifies
48
+ their evidence at the pre-commit boundary.
49
+ - Code and DT gates are triggered by changed risk and may repeat as the
50
+ implementation or tests change.
51
+ - After implementation, the DIC loop checks and repairs design-implementation
52
+ inconsistency until it converges or blocks.
53
+ - Any repair invalidates dependent decisions; only affected gates are re-run.
54
+ - `quality-repository-gate` runs only after current DIC Attestation and all
55
+ mandatory quality evidence are bound to the same frozen candidate.
56
+
57
+ Quality Skills are conditional gates, not decorative stages. Record why each
58
+ specialist is applicable or skipped. Reuse ontology objects, hashes, commands,
59
+ and Evidence; do not create a parallel source of truth.
60
+ Preserve applicable review decisions under `reports/quality/` with candidate
61
+ identity and evidence references so later gates consume the actual findings.
62
+
63
+ DIC consistency, specialist quality, and repository admission are distinct.
64
+ DIC `PASS` proves the current implementation is consistent with its design
65
+ evidence. It neither proves every quality domain passed nor grants admission.
66
+ The Orchestrator preserves all three outcomes and derives the delivery decision.
67
+
68
+ Use `schemas/ontology-action.schema.json` for auditable mutations. Every action
69
+ records actor, targets, preconditions, postconditions, allowed paths, and evidence.
70
+ Set `expectedSnapshotRevision` when authoring an action.
71
+ When the bundled CLI is available, run `action-check` before execution and
72
+ `action-record` after the action reaches its recorded state. Never reuse an
73
+ action ID with different content.
74
+
75
+ Every completed action includes `parameters.ontologyPatch`. Use only the object,
76
+ link, and lifecycle effects permitted for that action type. After recording,
77
+ run `ontology-reconcile`; do not mutate the snapshot directly. Reconciliation is
78
+ idempotent and must preserve all structural invariants.
79
+ Reconcile each new record before recording the next action. New ledger entries
80
+ form a sequence-numbered hash chain and bind the Snapshot revision used during
81
+ recording; run `ontology-ledger-check` before final review.
82
+
83
+ Treat validation as successful only when its lifecycle is current and
84
+ `properties.status` is `PASS`. Every Validation records `executedAt` and an
85
+ `inputs` entry containing the object ID and current SHA-256 for every consumed
86
+ DesignSource and ImplementationUnit. Run `ontology-validation-check`; an old
87
+ test result must never approve newer design or implementation bytes.
88
+ Attach each required Evidence object to a real
89
+ project-relative artifact with `provenance.contentHash` and the
90
+ `ContentAddressed` interface. Run `ontology-evidence-check` before attestation.
91
+
92
+ Treat implementation as current only when its `ImplementationUnit` has a current
93
+ lifecycle and a real project-relative file whose SHA-256 matches provenance.
94
+ Use `ObserveImplementation` for existing code and `ApplyRepair` only for code
95
+ created or changed by an approved repair. Run `ontology-implementation-check`
96
+ before attestation.
97
+
98
+ Treat `snapshotRevision` as an integrity boundary. Before final review, run
99
+ `ontology-drift`; tracked source changes block PASS. Use `ontology-plan` to
100
+ convert design, implementation, and Evidence integrity issues into the smallest
101
+ recommended Agent-stage rerun.
102
+
103
+ Final prose is a view, not an authority. Generate `reports/ontology-report.md`
104
+ with `ontology-report`, create `reports/ontology-attestation.json` with
105
+ `ontology-attest`, and run `ontology-attestation-check` immediately before
106
+ publishing the result. The attestation binds the terminal status to the exact
107
+ snapshot revision, action-ledger hash, design-source hashes, Evidence artifact
108
+ hashes, ImplementationUnit hashes, and evaluated invariants.
109
+ It also binds the Validation-to-input causality inventory.
110
+ Persist its `contentHash` outside the evidence directory, then verify it with
111
+ `--expected-hash`.
112
+
113
+ Model each delivery decision around a content-addressed `Candidate`. Record
114
+ specialist executions as `GateRun` objects linked by `EVALUATES`; bind terminal
115
+ `Decision` objects with `DECIDES`. Active claims require `SUPPORTED_BY`
116
+ Evidence. Unresolved `Challenge` objects block PASS. Use `Policy`, `Waiver`,
117
+ and `Risk` objects to make governance exceptions explicit instead of hiding
118
+ them in prose.
18
119
 
19
120
  Required durable outputs:
20
121
 
21
122
  ```text
22
123
  reports/project-profile.json
124
+ reports/harness-plan.json
125
+ reports/harness-run.json
126
+ reports/harness-report.md
127
+ reports/ontology-snapshot.json
128
+ reports/ontology-actions.jsonl
129
+ reports/ontology-report.md
130
+ reports/ontology-attestation.json
23
131
  reports/final-consistency-report.md
24
132
  reports/FINAL_RESULT.json
25
133
  result/output.md