@kontourai/flow-agents 3.2.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/add-to-project.yml +15 -0
- package/.github/workflows/ci.yml +173 -0
- package/CHANGELOG.md +54 -0
- package/CONTEXT.md +5 -1
- package/README.md +19 -8
- package/build/src/builder-flow-run-adapter.d.ts +80 -0
- package/build/src/builder-flow-run-adapter.js +241 -0
- package/build/src/builder-flow-runtime.d.ts +16 -0
- package/build/src/builder-flow-runtime.js +290 -0
- package/build/src/cli/assignment-provider.js +10 -1
- package/build/src/cli/builder-run.d.ts +1 -0
- package/build/src/cli/builder-run.js +27 -0
- package/build/src/cli/effective-backlog-settings.js +70 -2
- package/build/src/cli/init.d.ts +34 -0
- package/build/src/cli/init.js +341 -61
- package/build/src/cli/kit.js +55 -12
- package/build/src/cli/pull-work-provider.js +346 -5
- package/build/src/cli/skill-drift-check.d.ts +1 -0
- package/build/src/cli/skill-drift-check.js +165 -0
- package/build/src/cli/telemetry-doctor.d.ts +37 -0
- package/build/src/cli/telemetry-doctor.js +53 -6
- package/build/src/cli/validate-hook-influence.js +37 -7
- package/build/src/cli/workflow-artifact-cleanup-audit.js +418 -11
- package/build/src/cli/workflow-sidecar.d.ts +310 -1
- package/build/src/cli/workflow-sidecar.js +1914 -126
- package/build/src/cli.js +5 -0
- package/build/src/flow-kit/validate.d.ts +54 -34
- package/build/src/flow-kit/validate.js +237 -26
- package/build/src/index.d.ts +2 -0
- package/build/src/index.js +1 -0
- package/build/src/lib/console-connect-options.d.ts +97 -0
- package/build/src/lib/console-connect-options.js +199 -0
- package/build/src/lib/console-telemetry-validate.d.ts +49 -0
- package/build/src/lib/console-telemetry-validate.js +91 -0
- package/build/src/lib/flow-resolver.d.ts +54 -1
- package/build/src/lib/flow-resolver.js +112 -5
- package/build/src/lib/fs.d.ts +17 -0
- package/build/src/lib/fs.js +172 -0
- package/build/src/lib/local-artifact-root.d.ts +44 -1
- package/build/src/lib/local-artifact-root.js +131 -3
- package/build/src/runtime-adapters.d.ts +39 -3
- package/build/src/runtime-adapters.js +77 -31
- package/build/src/tools/build-universal-bundles.js +40 -2
- package/build/src/tools/codex-agent-routing.d.ts +2 -0
- package/build/src/tools/codex-agent-routing.js +49 -0
- package/build/src/tools/generate-context-map.js +1 -0
- package/build/src/tools/validate-source-tree.js +30 -3
- package/context/contracts/artifact-contract.md +16 -2
- package/context/scripts/hooks/lib/kit-catalog.js +235 -0
- package/context/scripts/hooks/lib/runnable-command.js +177 -0
- package/context/scripts/hooks/stop-goal-fit.js +278 -48
- package/context/scripts/hooks/workflow-steering.js +194 -22
- package/context/scripts/package.json +3 -0
- package/context/scripts/telemetry/install-console-config.sh +25 -4
- package/context/scripts/telemetry/lib/config.sh +102 -12
- package/context/scripts/telemetry/lib/pricing.sh +50 -0
- package/context/scripts/telemetry/lib/session.sh +3 -0
- package/context/scripts/telemetry/lib/transport.sh +87 -0
- package/context/scripts/telemetry/lib/usage.sh +205 -4
- package/context/scripts/telemetry/telemetry.conf +6 -0
- package/context/scripts/telemetry/telemetry.sh +48 -0
- package/context/settings/workspace-backlog-provider-settings.example.json +48 -0
- package/docs/agent-usage-feedback-loop.md +35 -0
- package/docs/architecture-engine-and-kits.md +110 -0
- package/docs/context-map.md +2 -0
- package/docs/coordination-guide.md +370 -0
- package/docs/decisions/agent-coordination.md +26 -9
- package/docs/decisions/embeddable-engine.md +152 -0
- package/docs/decisions/index.md +5 -3
- package/docs/decisions/trust-ledger-retention.md +88 -0
- package/docs/decisions/trust-reconcile.md +42 -9
- package/docs/decisions/workflow-enforcement.md +31 -9
- package/docs/fixture-ownership.md +6 -2
- package/docs/implementing-trust-reconciliation.md +129 -0
- package/docs/index.md +23 -9
- package/docs/integrations/flow-agents-console.md +275 -0
- package/docs/integrations/index.md +4 -0
- package/docs/kit-authoring-guide.md +52 -21
- package/docs/spec/builder-flow-runtime.md +80 -0
- package/docs/spec/runtime-hook-surface.md +45 -1
- package/docs/specs/economics-record-contract.md +270 -0
- package/docs/specs/harness-capability-matrix.md +74 -0
- package/docs/specs/learning-review-proposals-contract.md +340 -0
- package/docs/specs/routing-efficiency-review.md +59 -0
- package/docs/verifiable-trust.md +74 -25
- package/docs/workflow-artifact-lifecycle.md +38 -1
- package/docs/workflow-usage-guide.md +10 -0
- package/evals/acceptance/prove-capture-teeth.sh +132 -0
- package/evals/ci/antigaming-suite.sh +2 -0
- package/evals/ci/run-baseline.sh +78 -4
- package/evals/fixtures/economics/acceptance.json +12 -0
- package/evals/fixtures/economics/agents/tool-worker-1/events.jsonl +2 -0
- package/evals/fixtures/economics/agents/tool-worker-2/events.jsonl +2 -0
- package/evals/fixtures/economics/agents/tool-worker-3/events.jsonl +2 -0
- package/evals/fixtures/economics/agents/tool-worker-4/events.jsonl +1 -0
- package/evals/fixtures/economics/agents/tool-worker-5/events.jsonl +2 -0
- package/evals/fixtures/economics/critique.json +22 -0
- package/evals/fixtures/economics/expected-record.json +71 -0
- package/evals/fixtures/economics/session-usage-event.json +1 -0
- package/evals/fixtures/economics/state.json +11 -0
- package/evals/fixtures/economics/transcript.jsonl +3 -0
- package/evals/fixtures/hook-influence/cases.json +7 -7
- package/evals/fixtures/learning-review-proposals/balanced/economics.jsonl +6 -0
- package/evals/fixtures/learning-review-proposals/effect-follow-up/economics.jsonl +5 -0
- package/evals/fixtures/learning-review-proposals/effect-follow-up/sessions/task-lr-ef-1/trust.bundle +21 -0
- package/evals/fixtures/learning-review-proposals/effect-follow-up/sessions/task-lr-ef-2/trust.bundle +21 -0
- package/evals/fixtures/learning-review-proposals/effect-follow-up/sessions/task-lr-ef-3/trust.bundle +21 -0
- package/evals/fixtures/learning-review-proposals/effect-follow-up/sessions/task-lr-ef-4/trust.bundle +21 -0
- package/evals/fixtures/learning-review-proposals/effect-follow-up/sessions/task-lr-ef-5/trust.bundle +21 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/economics.jsonl +6 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/expected-aggregates.json +30 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/expected-aggregates.md +66 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/sessions/task-lr-pp-1/gate-review.inquiries.json +26 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/sessions/task-lr-pp-1/trust.bundle +21 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/sessions/task-lr-pp-2/gate-review.inquiries.json +26 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/sessions/task-lr-pp-2/trust.bundle +21 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/sessions/task-lr-pp-3/gate-review.inquiries.json +26 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/sessions/task-lr-pp-3/trust.bundle +21 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/sessions/task-lr-pp-4/gate-review.inquiries.json +26 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/sessions/task-lr-pp-4/trust.bundle +21 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/sessions/task-lr-pp-5/trust.bundle +21 -0
- package/evals/fixtures/learning-review-proposals/pattern-present/sessions/task-lr-pp-6/trust.bundle +21 -0
- package/evals/fixtures/learning-review-proposals/repeat-window/economics.jsonl +6 -0
- package/evals/fixtures/learning-review-proposals/under-threshold/economics.jsonl +3 -0
- package/evals/fixtures/reconcile-preflight/disputed-critique-unsuperseded.json +48 -0
- package/evals/fixtures/reconcile-preflight/standalone-disputed-session-local.json +59 -0
- package/evals/fixtures/telemetry/usage-transcript-sample.jsonl +4 -0
- package/evals/fixtures/trust-reconcile-exploits/mcp-degrade.json +42 -0
- package/evals/integration/test_builder_entry_enforcement.sh +241 -0
- package/evals/integration/test_builder_step_producers.sh +18 -10
- package/evals/integration/test_bundle_install.sh +172 -0
- package/evals/integration/test_checkpoint_signing.sh +10 -2
- package/evals/integration/test_ci_actor_identity.sh +221 -0
- package/evals/integration/test_console_tenant_isolation.sh +167 -0
- package/evals/integration/test_critique_supersession_roundtrip.sh +4 -1
- package/evals/integration/test_dual_emit_flow_step.sh +10 -4
- package/evals/integration/test_economics_record.sh +674 -0
- package/evals/integration/test_effective_backlog_settings.sh +1 -1
- package/evals/integration/test_evidence_capture_hook.sh +17 -2
- package/evals/integration/test_exemption_usage_review.sh +198 -0
- package/evals/integration/test_fixture_retirement_audit.sh +2 -2
- package/evals/integration/test_flow_kit_install_git.sh +83 -0
- package/evals/integration/test_flowdef_session_activation.sh +0 -1
- package/evals/integration/test_flowdef_session_history_preservation.sh +13 -3
- package/evals/integration/test_gate_lockdown.sh +7 -0
- package/evals/integration/test_gate_review_inquiry_records.sh +9 -1
- package/evals/integration/test_goal_fit_hook.sh +2031 -0
- package/evals/integration/test_hook_category_behaviors.sh +8 -1
- package/evals/integration/test_hook_influence_cases.sh +25 -1
- package/evals/integration/test_install_merge.sh +227 -2
- package/evals/integration/test_kit_conformance_levels.sh +6 -6
- package/evals/integration/test_learning_review_proposals.sh +329 -0
- package/evals/integration/test_liveness_conflict_injection.sh +26 -22
- package/evals/integration/test_liveness_console_relay.sh +166 -0
- package/evals/integration/test_liveness_heartbeat.sh +17 -17
- package/evals/integration/test_liveness_worktree_root.sh +575 -0
- package/evals/integration/test_phase_map_and_gate_claim.sh +6 -1
- package/evals/integration/test_publish_delivery.sh +389 -2
- package/evals/integration/test_pull_work_board.sh +200 -0
- package/evals/integration/test_pull_work_provider.sh +1 -1
- package/evals/integration/test_reconcile_preflight.sh +304 -0
- package/evals/integration/test_record_check.sh +378 -0
- package/evals/integration/test_routing_efficiency.sh +71 -0
- package/evals/integration/test_runtime_adapter_activation.sh +28 -0
- package/evals/integration/test_session_resume_roundtrip.sh +16 -19
- package/evals/integration/test_skill_drift_check.sh +870 -0
- package/evals/integration/test_takeover_protocol.sh +340 -0
- package/evals/integration/test_telemetry.sh +445 -0
- package/evals/integration/test_telemetry_doctor.sh +66 -0
- package/evals/integration/test_telemetry_usage_pipeline.sh +228 -0
- package/evals/integration/test_trust_reconcile_negatives.sh +121 -13
- package/evals/integration/test_trust_reconcile_trailer_diagnostic.sh +247 -0
- package/evals/integration/test_usage_cost.sh +61 -0
- package/evals/integration/test_verify_hold.sh +910 -0
- package/evals/integration/test_veritas_governance_kit.sh +257 -0
- package/evals/integration/test_workflow_artifact_cleanup_audit.sh +575 -3
- package/evals/integration/test_workflow_sidecar_writer.sh +1395 -0
- package/evals/integration/test_workflow_steering_hook.sh +157 -16
- package/evals/integration/test_workspace_settings.sh +176 -0
- package/evals/lib/env.sh +26 -0
- package/evals/lib/node.sh +8 -0
- package/evals/run.sh +37 -0
- package/evals/static/test_ci_integration_coverage.sh +115 -0
- package/evals/static/test_declared_scope_forms_documented.sh +114 -0
- package/evals/static/test_universal_bundles.sh +34 -0
- package/evals/static/test_validate_source_kit_asset_scope.sh +259 -0
- package/evals/static/test_workflow_skills.sh +1 -1
- package/kits/builder/flows/build.flow.json +9 -18
- package/kits/builder/flows/publish-learn.flow.json +5 -1
- package/kits/builder/kit.json +120 -0
- package/kits/builder/skills/continue-work/SKILL.md +2 -0
- package/kits/builder/skills/deliver/SKILL.md +115 -0
- package/kits/builder/skills/evidence-gate/SKILL.md +12 -0
- package/kits/builder/skills/execute-plan/SKILL.md +9 -0
- package/kits/builder/skills/learning-review/SKILL.md +51 -0
- package/kits/builder/skills/plan-work/SKILL.md +17 -20
- package/kits/builder/skills/pull-work/SKILL.md +33 -2
- package/kits/builder/skills/release-readiness/SKILL.md +12 -0
- package/kits/knowledge/kit.json +9 -0
- package/kits/veritas-governance/docs/README.md +113 -7
- package/kits/veritas-governance/fixtures/exemption/approved.trust-bundle.json +74 -0
- package/kits/veritas-governance/fixtures/exemption/not-approved.trust-bundle.json +74 -0
- package/kits/veritas-governance/fixtures/exemption-review/mixed-fresh-stale.DECLARED.json +14 -0
- package/kits/veritas-governance/flows/exemption-issuance.flow.json +35 -0
- package/kits/veritas-governance/kit.json +19 -0
- package/kits/veritas-governance/skills/exemption-usage-review/SKILL.md +128 -0
- package/kits/veritas-governance/skills/exemption-usage-review/review-exemptions.mjs +231 -0
- package/package.json +2 -2
- package/packaging/manifest.json +29 -0
- package/schemas/backlog-provider-settings.schema.json +13 -0
- package/schemas/workflow-state.schema.json +44 -0
- package/scripts/README.md +4 -0
- package/scripts/check-content-boundary.cjs +8 -1
- package/scripts/ci/trust-reconcile.js +214 -253
- package/scripts/hooks/codex-hook-adapter.js +77 -2
- package/scripts/hooks/evidence-capture.js +38 -5
- package/scripts/hooks/lib/actor-identity.js +82 -0
- package/scripts/hooks/lib/codex-exit-code.js +316 -0
- package/scripts/hooks/lib/kit-catalog.js +235 -0
- package/scripts/hooks/lib/liveness-write.js +28 -1
- package/scripts/hooks/lib/local-artifact-paths.js +97 -1
- package/scripts/hooks/lib/runnable-command.js +177 -0
- package/scripts/hooks/lib/skill-drift.js +350 -0
- package/scripts/hooks/stop-goal-fit.js +278 -48
- package/scripts/hooks/workflow-steering.js +194 -22
- package/scripts/install-codex-home.sh +97 -47
- package/scripts/install-merge.js +72 -14
- package/scripts/install-owned-files.js +178 -0
- package/scripts/lib/reconcile-shape.js +381 -0
- package/scripts/liveness/relay.sh +84 -0
- package/scripts/telemetry/economics-record.schema.json +145 -0
- package/scripts/telemetry/economics-record.sh +331 -0
- package/scripts/telemetry/install-console-config.sh +25 -4
- package/scripts/telemetry/learning-review-decide.sh +124 -0
- package/scripts/telemetry/learning-review-proposals.schema.json +161 -0
- package/scripts/telemetry/learning-review-proposals.sh +484 -0
- package/scripts/telemetry/lib/config.sh +102 -12
- package/scripts/telemetry/lib/pricing.sh +14 -6
- package/scripts/telemetry/lib/session.sh +3 -0
- package/scripts/telemetry/lib/transport.sh +133 -15
- package/scripts/telemetry/lib/usage.sh +121 -28
- package/scripts/telemetry/routing-efficiency.sh +0 -0
- package/scripts/telemetry/telemetry.conf +6 -0
- package/scripts/telemetry/telemetry.sh +48 -0
- package/src/builder-flow-run-adapter.ts +357 -0
- package/src/builder-flow-runtime.ts +348 -0
- package/src/cli/assignment-provider.ts +12 -1
- package/src/cli/builder-flow-run-adapter.test.mjs +495 -0
- package/src/cli/builder-flow-runtime.test.mjs +213 -0
- package/src/cli/builder-run.ts +28 -0
- package/src/cli/codex-agent-routing.test.mjs +44 -0
- package/src/cli/codex-exit-code.test.mjs +207 -0
- package/src/cli/console-connect-options.test.mjs +329 -0
- package/src/cli/console-telemetry-validate.test.mjs +157 -0
- package/src/cli/effective-backlog-settings.ts +68 -2
- package/src/cli/flow-resolver-composition.test.mjs +72 -0
- package/src/cli/init.test.mjs +161 -0
- package/src/cli/init.ts +407 -62
- package/src/cli/kit-metadata-security.test.mjs +443 -0
- package/src/cli/kit.ts +50 -12
- package/src/cli/pull-work-provider.ts +377 -3
- package/src/cli/sidecar-pure-helpers.test.mjs +64 -0
- package/src/cli/skill-drift-check.ts +196 -0
- package/src/cli/telemetry-doctor.test.mjs +53 -0
- package/src/cli/telemetry-doctor.ts +50 -7
- package/src/cli/validate-hook-influence.ts +37 -6
- package/src/cli/workflow-artifact-cleanup-audit.ts +483 -10
- package/src/cli/workflow-sidecar.ts +1980 -119
- package/src/cli.ts +5 -0
- package/src/flow-kit/validate.ts +277 -38
- package/src/index.ts +19 -0
- package/src/lib/console-connect-options.ts +261 -0
- package/src/lib/console-telemetry-validate.ts +88 -0
- package/src/lib/flow-resolver.ts +117 -4
- package/src/lib/fs.ts +160 -0
- package/src/lib/local-artifact-root.ts +129 -3
- package/src/runtime-adapters.ts +113 -33
- package/src/tools/build-universal-bundles.ts +36 -2
- package/src/tools/codex-agent-routing.ts +48 -0
- package/src/tools/generate-context-map.ts +1 -0
- package/src/tools/validate-source-tree.ts +29 -3
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Veritas Governance Kit
|
|
2
2
|
|
|
3
3
|
Turns a repo's **Veritas-governed Repo Standards** into deterministic, agentless **gate
|
|
4
|
-
evidence
|
|
5
|
-
|
|
4
|
+
evidence**, and gives operators a documented, gated path to **issue** the human-approval
|
|
5
|
+
exemptions ADR 0022 §2/§3 lets `delivery/DECLARED` carry. Slice 1 shipped the thinnest useful
|
|
6
|
+
surface: one flow, one gate, that gates a real `veritas readiness` verdict. This slice adds a
|
|
7
|
+
second, agentless flow for exemption issuance.
|
|
6
8
|
|
|
7
9
|
This kit **wraps** [`@kontourai/veritas`](https://www.npmjs.com/package/@kontourai/veritas) via
|
|
8
10
|
CLI invocation plus a small kit-local trust.bundle adapter. It does **not** fork, vendor, or
|
|
@@ -16,6 +18,8 @@ only projects Veritas's own recorded verdict into the Flow trust.bundle vocabula
|
|
|
16
18
|
| Flow | `flows/readiness-check.flow.json` | Single-gate agentless flow `readiness -> gate-check`. The gate requires a **verified** `software-readiness-verdict` trust.bundle claim. |
|
|
17
19
|
| Adapter | `adapter/readiness-to-trust-bundle.mjs` | Projects a `veritas readiness --check evidence --working-tree` evidence report into a Hachure `trust.bundle` (via `@kontourai/surface`), deriving the claim status from Veritas's own blocking-failure signal. |
|
|
18
20
|
| Fixtures | `fixtures/readiness/*.readiness-report.json` | Captured **real** Veritas readiness reports (a ready clean tree, and a not-ready tree with a required CLI artifact deleted) used by the eval. |
|
|
21
|
+
| Flow | `flows/exemption-issuance.flow.json` | Single-gate agentless flow `request -> human-approval-gate -> issue`. The gate requires a **verified** `no-agent-delivery-exemption-approval` trust.bundle claim (`subjectType: "delivery-scope"`) before the `issue` step's write is flow-sanctioned. Issues a `delivery/DECLARED` exemption entry per ADR 0022 §2/§3. |
|
|
22
|
+
| Skill | `skills/exemption-usage-review/SKILL.md` | Periodic audit skill (ADR 0022 §3): walks `delivery/DECLARED` + its `git log --follow` history and reports every standing exemption (scope, reason, approver, age since `declared_at`), flagging entries overdue for owner re-confirmation against a configurable staleness threshold. Process visibility, not enforcement — read-only, never mutates `delivery/DECLARED` or the reconciler. |
|
|
19
23
|
|
|
20
24
|
The gate uses provider-neutral Flow vocabulary (`kind: "trust.bundle"`, `bundle_claim`) — the
|
|
21
25
|
same vocabulary `kits/builder/flows/build.flow.json` uses. Veritas is simply the producer that
|
|
@@ -42,6 +46,104 @@ flow evaluate readiness --gate gate-check-gate --exit-code
|
|
|
42
46
|
# exit 0 when readiness is ready (claim verified); exit 1 (block) otherwise.
|
|
43
47
|
```
|
|
44
48
|
|
|
49
|
+
## How to issue a no-agent-delivery exemption
|
|
50
|
+
|
|
51
|
+
`flows/exemption-issuance.flow.json` (ADR 0022 §3, "the kit issues, the anchor enforces") gives
|
|
52
|
+
an operator who needs to declare a `no-agent-delivery` exemption — e.g. dependabot,
|
|
53
|
+
release-please, or another non-agent actor class — a documented, gated path instead of
|
|
54
|
+
hand-writing `delivery/DECLARED` JSON blind. See `delivery/README.md` for how `delivery/`
|
|
55
|
+
itself is used by CI, and ADR 0022 §3 for why issuance/audit live in this kit while enforcement
|
|
56
|
+
stays anchor-side (`scripts/ci/trust-reconcile.js`, unmodified and unaware of this kit).
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# 1. A human approver authors a Hachure trust.bundle asserting the exemption approval.
|
|
60
|
+
# (No adapter script exists for this slice -- the bundle is hand-authored or produced
|
|
61
|
+
# by whatever approval tooling records the decision; see "Human-approval evidence: what
|
|
62
|
+
# is and is not enforced" below for why this is convention, not a structural human-only
|
|
63
|
+
# guarantee.)
|
|
64
|
+
# Minimal bundle shape: {schemaVersion, source, claims:[{claimType:
|
|
65
|
+
# "no-agent-delivery-exemption-approval", subjectType: "delivery-scope",
|
|
66
|
+
# status: "verified", ...}], evidence:[...], policies:[...], events:[...]}
|
|
67
|
+
|
|
68
|
+
# 2. Gate it (agentless, CI-callable).
|
|
69
|
+
flow init
|
|
70
|
+
flow start kits/veritas-governance/flows/exemption-issuance.flow.json --run-id exemption
|
|
71
|
+
flow attach-evidence exemption --gate human-approval-gate --file approval.bundle --bundle
|
|
72
|
+
flow evaluate exemption --gate human-approval-gate --exit-code
|
|
73
|
+
# exit 0 once the approval claim is verified; exit 1 (block) otherwise.
|
|
74
|
+
|
|
75
|
+
# 3. Once the gate passes, append the approved entry to delivery/DECLARED (append, do NOT
|
|
76
|
+
# overwrite an existing array -- see delivery/DECLARED's current 2-entry file on main).
|
|
77
|
+
# All four fields are required: scope, reason, approved_by, declared_at. Compound scope
|
|
78
|
+
# forms (space-separated, ANDed -- e.g. "author:github-actions[bot]
|
|
79
|
+
# branch-prefix:release-please--") are supported by the reconciler's scope matcher; see
|
|
80
|
+
# ADR 0022's compound-scope addendum.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Example appended entry (third element of the existing `delivery/DECLARED` array — never a
|
|
84
|
+
replacement of it):
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"scope": "author:some-bot[bot]",
|
|
89
|
+
"reason": "why this actor class needs the exemption",
|
|
90
|
+
"approved_by": "<human approver identity/decision reference>",
|
|
91
|
+
"declared_at": "<ISO 8601 timestamp>"
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## How to run the review
|
|
96
|
+
|
|
97
|
+
`skills/exemption-usage-review/SKILL.md` (ADR 0022 §3, "the kit issues, the anchor
|
|
98
|
+
enforces... and the kit audits") gives an operator a periodic, read-only way to see every
|
|
99
|
+
`delivery/DECLARED` exemption currently standing, how old each one is, and which are overdue
|
|
100
|
+
for owner re-confirmation. This is **process visibility, not enforcement** — it never
|
|
101
|
+
modifies `delivery/DECLARED` and never changes `scripts/ci/trust-reconcile.js`'s
|
|
102
|
+
reconciliation decision or exit code.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Human-readable report against this repo's real delivery/DECLARED, default 90-day threshold.
|
|
106
|
+
node kits/veritas-governance/skills/exemption-usage-review/review-exemptions.mjs
|
|
107
|
+
|
|
108
|
+
# Machine-readable, with a deterministic "now" and a tighter threshold.
|
|
109
|
+
node kits/veritas-governance/skills/exemption-usage-review/review-exemptions.mjs \
|
|
110
|
+
--as-of 2026-07-05T00:00:00Z --stale-days 30 --json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Each standing exemption is reported as `{scope, reason, approved_by, declared_at, age_days,
|
|
114
|
+
stale}`; a `git log --follow -- delivery/DECLARED` history walk is reported alongside it as a
|
|
115
|
+
supplementary commit-level trail. See the skill's own SKILL.md for the full "what this review
|
|
116
|
+
does and does not verify" statement (it does not authenticate `approved_by`, does not
|
|
117
|
+
re-evaluate whether any scope currently matches a given change — that remains
|
|
118
|
+
`trust-reconcile.js`'s job — and does not schedule itself; an operator runs it periodically).
|
|
119
|
+
|
|
120
|
+
## Human-approval evidence: what is and is not enforced
|
|
121
|
+
|
|
122
|
+
The `human-approval-gate`'s `expects[]` entry only requires a **verified** trust.bundle claim
|
|
123
|
+
of the right `claimType` (`no-agent-delivery-exemption-approval`) and `subjectType`
|
|
124
|
+
(`delivery-scope`). **Flow's schema and CLI do not distinguish a human-authored bundle from an
|
|
125
|
+
agent-authored one** — `trust-bundle.schema.json`'s `source` and `producerId` fields are
|
|
126
|
+
free-text, with no enum, no cryptographic binding, and no CLI-side identity check.
|
|
127
|
+
"Human-attached" is an **operating convention** this flow's `description`/`explore_hint` text
|
|
128
|
+
encode (the gate's own copy tells an operator this evidence is meant to be authored by a human
|
|
129
|
+
approver out-of-band), not a mechanism the gate itself enforces. Anyone who can run `flow
|
|
130
|
+
attach-evidence --bundle` with a conforming bundle can satisfy this gate, exactly as anyone with
|
|
131
|
+
commit access could already hand-author `delivery/DECLARED` directly.
|
|
132
|
+
|
|
133
|
+
This is the same class of residual ADR 0022 already carries honestly for the marker file
|
|
134
|
+
itself: `approved_by` on `delivery/DECLARED` is free text, not bound to an authenticated
|
|
135
|
+
identity, mitigated by the loud, un-suppressible DECLARED line plus CODEOWNERS review on
|
|
136
|
+
`/delivery/DECLARED` — not by identity attestation. This flow adds **guidance and an audit
|
|
137
|
+
trail** (a named gate, a named claim type, a documented sequence) on top of that same
|
|
138
|
+
mitigation, not a new authentication boundary. Structural producer authentication — binding
|
|
139
|
+
gate satisfaction to an authenticated producer identity, rather than to a schema-valid claim
|
|
140
|
+
attached by anyone with CLI access — is upstream **Flow trusted-producer** work
|
|
141
|
+
(`docs/operating-layers.md`, `docs/flow-kit-repository-contract.md` in this repo describe the
|
|
142
|
+
config surface; the config itself is Flow-core, tracked at #225/#293-family), not something
|
|
143
|
+
this kit's `.flow.json` can itself express. Do not read a passing `human-approval-gate` as a
|
|
144
|
+
structural guarantee that a human attached the evidence — read it as "a verified claim of the
|
|
145
|
+
right shape was attached," full stop.
|
|
146
|
+
|
|
45
147
|
## Semantics
|
|
46
148
|
|
|
47
149
|
**Settled** (owner-ratified + investigation-confirmed; see
|
|
@@ -64,12 +166,16 @@ derivation is correct today and will agree with Veritas's own exported functions
|
|
|
64
166
|
|
|
65
167
|
## Trust status
|
|
66
168
|
|
|
67
|
-
Slice 1 ships **unverified** (like
|
|
68
|
-
|
|
69
|
-
|
|
169
|
+
Slice 1 ships **unverified** (like all current kits). Official catalog placement is marketplace
|
|
170
|
+
metadata only and grants no runtime privilege. Verified promotion is an owner decision deferred
|
|
171
|
+
to a later slice (see the WS5 shaping's open decisions).
|
|
70
172
|
|
|
71
173
|
## Not in slice 1
|
|
72
174
|
|
|
73
|
-
Skills
|
|
175
|
+
Skills `consult-standards` and `governance-evidence`, the fuller `merge-readiness` flow, the
|
|
74
176
|
`standards-authoring` flow, and the `knowledge` dependency are later slices — see the WS5
|
|
75
|
-
backlog.
|
|
177
|
+
backlog. `exemption-usage-review` (ADR 0022 §3's periodic audit skill, walking
|
|
178
|
+
`delivery/DECLARED` history and surfacing standing exemptions for owner re-confirmation —
|
|
179
|
+
process visibility, not enforcement) **has now shipped** — see "What it contains" above and
|
|
180
|
+
"How to run the review". Nothing schedules it automatically; an operator runs it periodically
|
|
181
|
+
(see the skill's own "Accepted gap" note) — that scheduling surface remains out of scope.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 5,
|
|
3
|
+
"source": "veritas-governance-kit/exemption-fixture",
|
|
4
|
+
"claims": [
|
|
5
|
+
{
|
|
6
|
+
"id": "exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot",
|
|
7
|
+
"subjectType": "delivery-scope",
|
|
8
|
+
"subjectId": "author:test-bot[bot]",
|
|
9
|
+
"facet": "veritas-governance.exemption",
|
|
10
|
+
"claimType": "no-agent-delivery-exemption-approval",
|
|
11
|
+
"fieldOrBehavior": "exemptionApproval",
|
|
12
|
+
"value": {
|
|
13
|
+
"scope": "author:test-bot[bot]",
|
|
14
|
+
"reason": "test-bot automation PR; no agent delivery involved",
|
|
15
|
+
"approved_by": "eval-fixture-approver"
|
|
16
|
+
},
|
|
17
|
+
"createdAt": "2026-07-01T00:00:00Z",
|
|
18
|
+
"updatedAt": "2026-07-01T00:00:00Z",
|
|
19
|
+
"impactLevel": "high",
|
|
20
|
+
"verificationPolicyId": "policy:no-agent-delivery-exemption-approval",
|
|
21
|
+
"metadata": {
|
|
22
|
+
"producer": "human-approver",
|
|
23
|
+
"source": "exemption-issuance-fixture"
|
|
24
|
+
},
|
|
25
|
+
"status": "verified"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"evidence": [
|
|
29
|
+
{
|
|
30
|
+
"id": "ev:exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot",
|
|
31
|
+
"claimId": "exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot",
|
|
32
|
+
"evidenceType": "policy_rule",
|
|
33
|
+
"method": "auditability",
|
|
34
|
+
"sourceRef": "human-approver:exemption-issuance-fixture",
|
|
35
|
+
"excerptOrSummary": "A human maintainer approved a no-agent-delivery exemption for scope author:test-bot[bot].",
|
|
36
|
+
"observedAt": "2026-07-01T00:00:00Z",
|
|
37
|
+
"collectedBy": "veritas-governance-kit/exemption-fixture",
|
|
38
|
+
"passing": true
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"events": [
|
|
42
|
+
{
|
|
43
|
+
"id": "evt:exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot",
|
|
44
|
+
"claimId": "exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot",
|
|
45
|
+
"status": "verified",
|
|
46
|
+
"actor": "veritas-governance-kit/exemption-fixture",
|
|
47
|
+
"method": "auditability",
|
|
48
|
+
"evidenceIds": [
|
|
49
|
+
"ev:exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot"
|
|
50
|
+
],
|
|
51
|
+
"createdAt": "2026-07-01T00:00:00Z",
|
|
52
|
+
"verifiedAt": "2026-07-01T00:00:00Z"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"policies": [
|
|
56
|
+
{
|
|
57
|
+
"id": "policy:no-agent-delivery-exemption-approval",
|
|
58
|
+
"claimType": "no-agent-delivery-exemption-approval",
|
|
59
|
+
"requiredEvidence": [
|
|
60
|
+
"policy_rule"
|
|
61
|
+
],
|
|
62
|
+
"acceptanceCriteria": [
|
|
63
|
+
"A human maintainer has approved this delivery-scope exemption from Trust Reconcile's bundle-required enforcement."
|
|
64
|
+
],
|
|
65
|
+
"reviewAuthority": "human",
|
|
66
|
+
"validityRule": {
|
|
67
|
+
"kind": "manual"
|
|
68
|
+
},
|
|
69
|
+
"stalenessTriggers": [],
|
|
70
|
+
"conflictRules": [],
|
|
71
|
+
"impactLevel": "high"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 5,
|
|
3
|
+
"source": "veritas-governance-kit/exemption-fixture",
|
|
4
|
+
"claims": [
|
|
5
|
+
{
|
|
6
|
+
"id": "exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot",
|
|
7
|
+
"subjectType": "delivery-scope",
|
|
8
|
+
"subjectId": "author:test-bot[bot]",
|
|
9
|
+
"facet": "veritas-governance.exemption",
|
|
10
|
+
"claimType": "no-agent-delivery-exemption-approval",
|
|
11
|
+
"fieldOrBehavior": "exemptionApproval",
|
|
12
|
+
"value": {
|
|
13
|
+
"scope": "author:test-bot[bot]",
|
|
14
|
+
"reason": "test-bot automation PR; no agent delivery involved",
|
|
15
|
+
"approved_by": "eval-fixture-approver"
|
|
16
|
+
},
|
|
17
|
+
"createdAt": "2026-07-01T00:00:00Z",
|
|
18
|
+
"updatedAt": "2026-07-01T00:00:00Z",
|
|
19
|
+
"impactLevel": "high",
|
|
20
|
+
"verificationPolicyId": "policy:no-agent-delivery-exemption-approval",
|
|
21
|
+
"metadata": {
|
|
22
|
+
"producer": "human-approver",
|
|
23
|
+
"source": "exemption-issuance-fixture"
|
|
24
|
+
},
|
|
25
|
+
"status": "disputed"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"evidence": [
|
|
29
|
+
{
|
|
30
|
+
"id": "ev:exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot",
|
|
31
|
+
"claimId": "exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot",
|
|
32
|
+
"evidenceType": "policy_rule",
|
|
33
|
+
"method": "auditability",
|
|
34
|
+
"sourceRef": "human-approver:exemption-issuance-fixture",
|
|
35
|
+
"excerptOrSummary": "A no-agent-delivery exemption approval claim was attached but is not (yet) verified for scope author:test-bot[bot].",
|
|
36
|
+
"observedAt": "2026-07-01T00:00:00Z",
|
|
37
|
+
"collectedBy": "veritas-governance-kit/exemption-fixture",
|
|
38
|
+
"passing": false
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"events": [
|
|
42
|
+
{
|
|
43
|
+
"id": "evt:exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot",
|
|
44
|
+
"claimId": "exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot",
|
|
45
|
+
"status": "disputed",
|
|
46
|
+
"actor": "veritas-governance-kit/exemption-fixture",
|
|
47
|
+
"method": "auditability",
|
|
48
|
+
"evidenceIds": [
|
|
49
|
+
"ev:exemption-fixture.no-agent-delivery-exemption-approval.author-test-bot"
|
|
50
|
+
],
|
|
51
|
+
"createdAt": "2026-07-01T00:00:00Z",
|
|
52
|
+
"verifiedAt": "2026-07-01T00:00:00Z"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"policies": [
|
|
56
|
+
{
|
|
57
|
+
"id": "policy:no-agent-delivery-exemption-approval",
|
|
58
|
+
"claimType": "no-agent-delivery-exemption-approval",
|
|
59
|
+
"requiredEvidence": [
|
|
60
|
+
"policy_rule"
|
|
61
|
+
],
|
|
62
|
+
"acceptanceCriteria": [
|
|
63
|
+
"A human maintainer has approved this delivery-scope exemption from Trust Reconcile's bundle-required enforcement."
|
|
64
|
+
],
|
|
65
|
+
"reviewAuthority": "human",
|
|
66
|
+
"validityRule": {
|
|
67
|
+
"kind": "manual"
|
|
68
|
+
},
|
|
69
|
+
"stalenessTriggers": [],
|
|
70
|
+
"conflictRules": [],
|
|
71
|
+
"impactLevel": "high"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"scope": "author:dependabot[bot]",
|
|
4
|
+
"reason": "dependabot dependency-update PRs; no agent delivery involved",
|
|
5
|
+
"approved_by": "example-approver (fixture-only)",
|
|
6
|
+
"declared_at": "2026-06-20T00:00:00Z"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"scope": "author:example-legacy-bot[bot]",
|
|
10
|
+
"reason": "example fixture: a legacy exemption overdue for owner re-confirmation",
|
|
11
|
+
"approved_by": "example-approver (fixture-only)",
|
|
12
|
+
"declared_at": "2026-01-01T00:00:00Z"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "veritas-governance.exemption-issuance",
|
|
3
|
+
"version": "1.0",
|
|
4
|
+
"steps": [
|
|
5
|
+
{ "id": "request", "next": "issue" },
|
|
6
|
+
{ "id": "issue", "next": null }
|
|
7
|
+
],
|
|
8
|
+
"gates": {
|
|
9
|
+
"human-approval-gate": {
|
|
10
|
+
"step": "issue",
|
|
11
|
+
"expects": [
|
|
12
|
+
{
|
|
13
|
+
"id": "exemption-approval",
|
|
14
|
+
"kind": "trust.bundle",
|
|
15
|
+
"required": true,
|
|
16
|
+
"description": "A human maintainer has approved this delivery-scope exemption from Trust Reconcile's bundle-required enforcement (ADR 0022 §1/§2), recorded as a verified no-agent-delivery-exemption-approval trust.bundle claim.",
|
|
17
|
+
"explore_hint": "A human approver authors a Hachure trust.bundle carrying a no-agent-delivery-exemption-approval / delivery-scope claim with status verified, then `flow attach-evidence <run> --gate human-approval-gate --file <bundle> --bundle`.",
|
|
18
|
+
"bundle_claim": {
|
|
19
|
+
"claimType": "no-agent-delivery-exemption-approval",
|
|
20
|
+
"subjectType": "delivery-scope",
|
|
21
|
+
"accepted_statuses": ["verified"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"on_route_back": {
|
|
26
|
+
"missing_evidence": "issue",
|
|
27
|
+
"default": "issue"
|
|
28
|
+
},
|
|
29
|
+
"route_back_policy": {
|
|
30
|
+
"max_attempts": 3,
|
|
31
|
+
"on_exceeded": "block"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -8,6 +8,25 @@
|
|
|
8
8
|
"id": "veritas-governance.readiness-check",
|
|
9
9
|
"path": "flows/readiness-check.flow.json",
|
|
10
10
|
"description": "Single-gate agentless flow: requires a verified software-readiness-verdict trust.bundle claim (projected from `veritas readiness --check evidence --working-tree`) before the gate-check step can pass. CI-callable, K0."
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "veritas-governance.exemption-issuance",
|
|
14
|
+
"path": "flows/exemption-issuance.flow.json",
|
|
15
|
+
"description": "Agentless K0 flow issuing a delivery/DECLARED no-agent-delivery exemption (ADR 0022 §2/§3): step request -> gate human-approval-gate (requires a verified no-agent-delivery-exemption-approval trust.bundle claim, satisfiable only by a human-authored approval bundle by convention -- see docs/README.md) -> step issue, which appends the approved entry to delivery/DECLARED. CI-callable."
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"skills": [
|
|
19
|
+
{
|
|
20
|
+
"id": "veritas-governance.exemption-usage-review",
|
|
21
|
+
"path": "skills/exemption-usage-review/SKILL.md",
|
|
22
|
+
"description": "Periodic audit skill (ADR 0022 §3): walks delivery/DECLARED + its git log --follow history and reports every standing no-agent-delivery exemption (scope, reason, approver, age since declared_at), flagging entries overdue for owner re-confirmation against a configurable staleness threshold. Process visibility, not enforcement -- read-only, never mutates delivery/DECLARED or scripts/ci/trust-reconcile.js's behavior."
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"assets": [
|
|
26
|
+
{
|
|
27
|
+
"id": "veritas-governance.exemption-usage-review-helper",
|
|
28
|
+
"path": "skills/exemption-usage-review/review-exemptions.mjs",
|
|
29
|
+
"description": "Dependency-free ESM helper script the exemption-usage-review skill documents/invokes: reads delivery/DECLARED, computes age/staleness per entry, walks git log --follow -- delivery/DECLARED for a supplementary history trail. Read-only; never mutates delivery/DECLARED or scripts/ci/trust-reconcile.js's behavior."
|
|
11
30
|
}
|
|
12
31
|
],
|
|
13
32
|
"docs": [
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "exemption-usage-review"
|
|
3
|
+
description: "Periodic audit of standing delivery/DECLARED no-agent-delivery exemptions (ADR 0022 §3): lists every current exemption's scope, reason, approver, and age since declared_at, flags entries overdue for owner re-confirmation against a configurable staleness threshold, and walks the file's git history for a supplementary commit-level trail. Use when periodically reviewing which no-agent-delivery exemptions are still standing and whether any need re-confirmation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Exemption Usage Review
|
|
7
|
+
|
|
8
|
+
Read `delivery/DECLARED`, list every standing exemption with its age, and flag which ones
|
|
9
|
+
are overdue for owner re-confirmation — **process visibility, not enforcement** (ADR 0022
|
|
10
|
+
§3). This skill never changes `delivery/DECLARED` and never changes
|
|
11
|
+
`scripts/ci/trust-reconcile.js`'s reconciliation/exit-code behavior.
|
|
12
|
+
|
|
13
|
+
## Contract
|
|
14
|
+
|
|
15
|
+
- Read-only against `delivery/DECLARED` and its git history — no write, no mutation, no
|
|
16
|
+
append, no delete, anywhere in this repo.
|
|
17
|
+
- Never gates anything: this is a **skill**, not a flow. It has no `expects[]` claim to
|
|
18
|
+
evaluate and attaches no evidence. There is no pass/fail verdict — only a report.
|
|
19
|
+
- Never influences `scripts/ci/trust-reconcile.js`'s reconciliation decision or exit code.
|
|
20
|
+
The reconciler is unaware this skill exists, exactly as it is unaware of the rest of this
|
|
21
|
+
kit (ADR 0022 §3, "uninstalling `veritas-governance` must never weaken enforcement").
|
|
22
|
+
- Does not reimplement `scripts/ci/trust-reconcile.js`'s `matchesScope` /
|
|
23
|
+
`matchesScopeCondition` / `parseDeclaredMarker` functions. The review lists **every**
|
|
24
|
+
standing entry unconditionally — it has no "does this scope match the current change"
|
|
25
|
+
question to answer (that is the reconciler's job, evaluated per-change at CI time). This
|
|
26
|
+
skill answers a different question — "what exemptions exist at all, and how old are they" —
|
|
27
|
+
so it needs only a much simpler parse-and-age routine, not the reconciler's scope-matching
|
|
28
|
+
engine. See `review-exemptions.mjs`'s header comment for the same note in code.
|
|
29
|
+
- No `.kontourai/flow-agents/<slug>/` session artifact contract applies here: this skill
|
|
30
|
+
produces a standalone report (stdout, human-readable or `--json`), not a workflow sidecar
|
|
31
|
+
artifact. State this plainly rather than inventing an artifact contract this tool does not
|
|
32
|
+
need.
|
|
33
|
+
|
|
34
|
+
## What this review does and does not verify
|
|
35
|
+
|
|
36
|
+
**Does verify:**
|
|
37
|
+
- Every entry currently present in the live `delivery/DECLARED` file is listed with its
|
|
38
|
+
`scope`, `reason`, `approved_by`, `declared_at`, a computed `age_days` (now, or `--as-of`,
|
|
39
|
+
minus `declared_at`), and a `stale` boolean (`age_days > --stale-days`, default 90).
|
|
40
|
+
- The `git log --follow -- delivery/DECLARED` commit history for the file — optionally
|
|
41
|
+
bounded to a `--window-days` review window — is walked and reported as a supplementary
|
|
42
|
+
commit-level trail (sha, author, date, subject).
|
|
43
|
+
|
|
44
|
+
**Does not verify:**
|
|
45
|
+
- Whether any `approved_by` value names a real, authenticated human approver.
|
|
46
|
+
`approved_by` is free text on `delivery/DECLARED` itself (see this kit's own
|
|
47
|
+
`docs/README.md`, "Human-approval evidence: what is and is not enforced") — this tool
|
|
48
|
+
reports what the field says, it does not authenticate it.
|
|
49
|
+
- Whether any entry's `scope` (`ref:`/`commit:`/`author:`/`branch-prefix:`, or a
|
|
50
|
+
compound-AND combination) currently matches any particular change. That is
|
|
51
|
+
`scripts/ci/trust-reconcile.js`'s job at reconciliation time — a "does this exemption
|
|
52
|
+
apply to THIS change" question this review never asks. This review lists every entry
|
|
53
|
+
regardless of whether it currently matches anything.
|
|
54
|
+
- A full point-in-time reconstruction and diff of every historical version of
|
|
55
|
+
`delivery/DECLARED` (e.g. "entry X was removed then silently re-added with a different
|
|
56
|
+
reason"). `history_commits` gives the commit-level trail a human reviewer can inspect
|
|
57
|
+
further with `git show <sha>:delivery/DECLARED`; this tool does not do that per-commit
|
|
58
|
+
content diffing itself.
|
|
59
|
+
- Anything about whether the exemption is still *needed* — that is an owner judgment call
|
|
60
|
+
this review surfaces evidence for, not a decision it makes.
|
|
61
|
+
|
|
62
|
+
## Inputs
|
|
63
|
+
|
|
64
|
+
- `delivery/DECLARED` (default; override via `--declared-path <path>` for a fixture or a
|
|
65
|
+
different repo layout).
|
|
66
|
+
- `--repo-root <path>` (default: current working directory) — the git repository whose
|
|
67
|
+
history is walked.
|
|
68
|
+
- `--stale-days <n>` (default: `90`) — the configurable age threshold. Entries with
|
|
69
|
+
`age_days > stale-days` are flagged `stale: true`.
|
|
70
|
+
- `--window-days <n>` (optional; default: full history) — bounds the `git log --follow`
|
|
71
|
+
history walk to commits within the last `<n>` days of `--as-of`. Does not affect which
|
|
72
|
+
*current* entries are listed — the live file's entries are always listed in full; this
|
|
73
|
+
only bounds the supplementary history trail.
|
|
74
|
+
- `--as-of <ISO8601>` (default: `new Date().toISOString()`, i.e. wall-clock now) —
|
|
75
|
+
deterministic override for "now", so a scheduled/periodic invocation or an eval is not
|
|
76
|
+
wall-clock-flaky. Mirrors this repo's `TRUST_RECONCILE_SHA`/`_REF`/`_ACTOR` override
|
|
77
|
+
convention in `scripts/ci/trust-reconcile.js`.
|
|
78
|
+
- `--json` (optional) — emit a machine-readable JSON report instead of the human-readable
|
|
79
|
+
table.
|
|
80
|
+
|
|
81
|
+
## How to run the review
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Human-readable report against this repo's real delivery/DECLARED, default 90-day threshold.
|
|
85
|
+
node kits/veritas-governance/skills/exemption-usage-review/review-exemptions.mjs
|
|
86
|
+
|
|
87
|
+
# Machine-readable, with an explicit deterministic "now" and a tighter threshold.
|
|
88
|
+
node kits/veritas-governance/skills/exemption-usage-review/review-exemptions.mjs \
|
|
89
|
+
--as-of 2026-07-05T00:00:00Z --stale-days 30 --json
|
|
90
|
+
|
|
91
|
+
# Bound the supplementary history walk to the last 180 days.
|
|
92
|
+
node kits/veritas-governance/skills/exemption-usage-review/review-exemptions.mjs \
|
|
93
|
+
--window-days 180
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Exit code: `0` on a clean run — even when one or more entries are flagged `stale`. Staleness
|
|
97
|
+
is informational output for a human owner to act on, never a script failure condition. Exit
|
|
98
|
+
`2` on bad arguments; exit `3` when `delivery/DECLARED` is missing or not valid JSON (nothing
|
|
99
|
+
to review — a tool-usage failure, not a staleness finding).
|
|
100
|
+
|
|
101
|
+
## Output shape
|
|
102
|
+
|
|
103
|
+
Each standing-exemption row: `{scope, reason, approved_by, declared_at, age_days, stale}`.
|
|
104
|
+
`age_days`/`stale` are `null` (never silently coerced to `true`/`false`) when `declared_at`
|
|
105
|
+
is missing or unparsable — an honest "unknown", not a guessed verdict.
|
|
106
|
+
|
|
107
|
+
The history section separately reports `{sha, author, date, subject}` per commit found by
|
|
108
|
+
`git log --follow -- delivery/DECLARED` in the (optionally windowed) range. A git failure
|
|
109
|
+
(no repository, no history, shallow clone) degrades to an empty history list plus a
|
|
110
|
+
diagnostic note — never a crash and never a fabricated commit.
|
|
111
|
+
|
|
112
|
+
## What happens with a stale entry
|
|
113
|
+
|
|
114
|
+
A `stale: true` entry means: this exemption has been standing longer than the configured
|
|
115
|
+
threshold without a recorded re-confirmation. This review does not renew, revoke, or modify
|
|
116
|
+
the entry itself — it surfaces the finding for an owner to act on: re-confirm the exemption
|
|
117
|
+
is still needed (e.g. re-run the kit's exemption-issuance flow to record a fresh
|
|
118
|
+
`declared_at` with the same or updated `reason`/`approved_by`), or remove it from
|
|
119
|
+
`delivery/DECLARED` by direct, CODEOWNERS-reviewed edit. Both of those actions are outside
|
|
120
|
+
this skill's scope by design — this skill only reports.
|
|
121
|
+
|
|
122
|
+
## Accepted gap: nothing schedules this review
|
|
123
|
+
|
|
124
|
+
ADR 0022 §3 asks for the review tool to exist, not for automated scheduling. This skill has
|
|
125
|
+
no CI job, cron trigger, or scheduled invocation wired to it — an operator must run it
|
|
126
|
+
periodically themselves (see "How to run the review" above). This is an accepted,
|
|
127
|
+
explicitly-named scope boundary, not a silent gap: building a scheduling/CI-trigger surface
|
|
128
|
+
was not requested and is not part of this slice.
|