agentic-proofkit 0.1.91
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/ADOPTION.md +464 -0
- package/LICENSE +21 -0
- package/NON_CLAIMS.md +197 -0
- package/README.md +265 -0
- package/dist/agentic-proofkit +35 -0
- package/dist/platform/darwin-arm64/agentic-proofkit +0 -0
- package/dist/platform/darwin-x64/agentic-proofkit +0 -0
- package/dist/platform/linux-arm64/agentic-proofkit +0 -0
- package/dist/platform/linux-x64/agentic-proofkit +0 -0
- package/docs/adoption-checklist-report-design.md +138 -0
- package/docs/adoption-workflow-agent-envelope-design.md +67 -0
- package/docs/adoption-workflow-authority-routes-design.md +76 -0
- package/docs/adoption-workflow-contract-envelope-design.md +87 -0
- package/docs/adoption-workflow-plan-design.md +97 -0
- package/docs/agent-guidance-envelope-design.md +550 -0
- package/docs/binding-partition-admission-design.md +127 -0
- package/docs/bootstrap-agent-envelope-design.md +97 -0
- package/docs/bootstrap-materialization-manifest-design.md +100 -0
- package/docs/branch-authority-report-design.md +121 -0
- package/docs/changed-path-set-agent-envelope-design.md +70 -0
- package/docs/completion-criteria-report-design.md +132 -0
- package/docs/custom-rule-boundary-design.md +56 -0
- package/docs/deployment-evidence-admission-design.md +80 -0
- package/docs/document-lifecycle-boundary-design.md +62 -0
- package/docs/json-report-cli-adapter-design.md +83 -0
- package/docs/migration-parity-admission-design.md +90 -0
- package/docs/migration-plan-design.md +73 -0
- package/docs/obligation-decision-agent-envelope-design.md +105 -0
- package/docs/obligation-decision-state-design.md +100 -0
- package/docs/package-runtime-dependency-admission-design.md +80 -0
- package/docs/producer-policy-self-proof-design.md +142 -0
- package/docs/project-structure-agent-envelope-design.md +121 -0
- package/docs/project-structure-scaffold-design.md +89 -0
- package/docs/proof-obligation-algebra-design.md +108 -0
- package/docs/proof-receipt-admission-design.md +108 -0
- package/docs/proofkit-contract-map.md +55 -0
- package/docs/receipt-currentness-scope-admission-design.md +103 -0
- package/docs/receipt-producer-admission-design.md +106 -0
- package/docs/receipt-trust-class-admission-design.md +113 -0
- package/docs/rendered-artifact-freshness-design.md +55 -0
- package/docs/requirement-browser-view-design.md +229 -0
- package/docs/requirement-proof-resolver-projection-design.md +97 -0
- package/docs/requirement-proof-source-set-design.md +72 -0
- package/docs/requirement-proof-view-design.md +138 -0
- package/docs/requirement-source-admission-design.md +66 -0
- package/docs/requirement-source-transition-design.md +66 -0
- package/docs/requirement-source-view-design.md +51 -0
- package/docs/scaffold-profile-plan-design.md +72 -0
- package/docs/secret-shaped-json-scan-design.md +60 -0
- package/docs/selective-evidence-obligation-decision-design.md +139 -0
- package/docs/selective-evidence-producer-admission-design.md +106 -0
- package/docs/selective-evidence-receipt-trust-class-design.md +100 -0
- package/docs/selective-gate-evidence-agent-envelope-design.md +100 -0
- package/docs/selective-gate-plan-agent-envelope-design.md +95 -0
- package/docs/selective-planner-edge-coverage-design.md +89 -0
- package/docs/spec-overview-claim-boundary-design.md +50 -0
- package/docs/spec-proof-bundle-admission-design.md +105 -0
- package/docs/specs/proofkit-consumer-infra-retirement/overview.md +44 -0
- package/docs/specs/proofkit-consumer-infra-retirement/requirements.v1.json +175 -0
- package/docs/specs/proofkit-package-boundary/overview.md +32 -0
- package/docs/specs/proofkit-package-boundary/requirements.v1.json +121 -0
- package/docs/specs/proofkit-receipt-authority/overview.md +35 -0
- package/docs/specs/proofkit-receipt-authority/requirements.v1.json +121 -0
- package/docs/specs/proofkit-spec-proof-core/overview.md +36 -0
- package/docs/specs/proofkit-spec-proof-core/requirements.v1.json +148 -0
- package/docs/witness-scheduler-plan-design.md +57 -0
- package/docs/workspace-planning-agent-envelope-design.md +101 -0
- package/docs/workspace-registry-admission-design.md +57 -0
- package/package.json +54 -0
- package/proofkit/cli-contract.v1.json +808 -0
- package/proofkit/receipt-producer-policy.json +48 -0
- package/proofkit/requirement-bindings.json +520 -0
- package/proofkit/witness-plan.json +649 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Selective Evidence Obligation Decision Design
|
|
2
|
+
|
|
3
|
+
## Decision
|
|
4
|
+
|
|
5
|
+
Proofkit provides an API and CLI projection from selective gate evidence into
|
|
6
|
+
the generic obligation-decision input model.
|
|
7
|
+
|
|
8
|
+
The projection requires caller-owned command routes. It does not infer
|
|
9
|
+
requirement identity, proof route identity, obligation class, producer trust,
|
|
10
|
+
receipt freshness, changed scope, live availability, or merge approval.
|
|
11
|
+
When supplied, it can compose caller-provided receipt currentness/scope and
|
|
12
|
+
trust-class admission diagnostics into candidate states.
|
|
13
|
+
|
|
14
|
+
## Problem
|
|
15
|
+
|
|
16
|
+
Selective gate evidence already classifies planned command receipts as missing,
|
|
17
|
+
failed, blocked, not-run, duplicate, unexpected, or passed. The generic
|
|
18
|
+
obligation-decision primitive owns the closed decision lattice used by agents
|
|
19
|
+
and gates.
|
|
20
|
+
|
|
21
|
+
Those two layers need a narrow bridge:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
selective evidence command facts
|
|
25
|
+
+ optional caller currentness/scope diagnostics
|
|
26
|
+
+ optional caller trust-class diagnostics
|
|
27
|
+
+ caller route map
|
|
28
|
+
-> obligation decision input
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Without a bridge, each consuming repository must translate selective receipt
|
|
32
|
+
diagnostics into obligation states by hand. With a bridge that infers too much,
|
|
33
|
+
Proofkit would accidentally own repository-specific proof routes and producer
|
|
34
|
+
trust. Therefore the bridge must be explicit-input and fail-closed.
|
|
35
|
+
|
|
36
|
+
## Boundary
|
|
37
|
+
|
|
38
|
+
Proofkit owns:
|
|
39
|
+
|
|
40
|
+
- exact command-route admission;
|
|
41
|
+
- command-scoped mapping from selective receipt facts to candidate obligation
|
|
42
|
+
states;
|
|
43
|
+
- fail-closed anchoring of optional currentness/scope and trust-class
|
|
44
|
+
diagnostics to exactly one planned receipt and one caller route;
|
|
45
|
+
- deterministic obligation-decision input output.
|
|
46
|
+
|
|
47
|
+
The consuming repository owns:
|
|
48
|
+
|
|
49
|
+
- which requirement a planned command proves;
|
|
50
|
+
- the proof route reference and obligation class;
|
|
51
|
+
- producer admission and authentication;
|
|
52
|
+
- receipt freshness and scope classification;
|
|
53
|
+
- proof-class risk policy and trust-class policy;
|
|
54
|
+
- handling of unscoped selective evidence failures;
|
|
55
|
+
- merge, release, rollout, and production readiness decisions.
|
|
56
|
+
|
|
57
|
+
## Mapping
|
|
58
|
+
|
|
59
|
+
The projection maps only command-scoped facts:
|
|
60
|
+
|
|
61
|
+
| Selective evidence fact | Candidate obligation state |
|
|
62
|
+
|---|---|
|
|
63
|
+
| No receipt for planned command | `missing_receipt` |
|
|
64
|
+
| More than one receipt for planned command | `invalid_receipt` |
|
|
65
|
+
| One failed receipt | `failed` |
|
|
66
|
+
| One blocked receipt | `blocked_missing_precondition` |
|
|
67
|
+
| One not-run receipt | `missing_receipt` |
|
|
68
|
+
| One passed receipt | `satisfied` |
|
|
69
|
+
|
|
70
|
+
Optional typed diagnostics add stronger candidate states:
|
|
71
|
+
|
|
72
|
+
| Optional diagnostic fact | Candidate obligation state |
|
|
73
|
+
|---|---|
|
|
74
|
+
| Currentness digest drift | `stale_receipt` |
|
|
75
|
+
| Unknown or unadmitted current scope | `unknown_scope` |
|
|
76
|
+
| Not applicable current scope | `not_applicable` |
|
|
77
|
+
| Trust-class producer/rank failure | `invalid_producer` |
|
|
78
|
+
| Trust-class receipt shape failure | `invalid_receipt` |
|
|
79
|
+
|
|
80
|
+
The final selected state is still owned by `obligation-decision`; this
|
|
81
|
+
projection only supplies candidate states.
|
|
82
|
+
|
|
83
|
+
The projection refuses to map unscoped facts:
|
|
84
|
+
|
|
85
|
+
- selective plan `fail_closed`;
|
|
86
|
+
- preexisting evidence failures;
|
|
87
|
+
- unexpected receipts;
|
|
88
|
+
- producer admission failures.
|
|
89
|
+
|
|
90
|
+
Those facts need an explicit caller-authored obligation-decision input or a
|
|
91
|
+
future typed route that can bind them to one obligation without string parsing.
|
|
92
|
+
|
|
93
|
+
## CLI Composition
|
|
94
|
+
|
|
95
|
+
The CLI command is intentionally a projection step:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
agentic-proofkit selective-gate-obligation-decision-input --input proofkit/selective-gate-obligation-decision.json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
It emits deterministic `ProofkitObligationDecisionInput` and exits `0` when the
|
|
102
|
+
projection is valid, even if the projected candidate states include unsatisfied
|
|
103
|
+
proof states. The obligation-decision owner remains the only CLI route that
|
|
104
|
+
turns those candidates into a decision report or agent envelope:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
agentic-proofkit selective-gate-obligation-decision-input --input proofkit/selective-gate-obligation-decision.json \
|
|
108
|
+
| proofkit obligation-decision --input -
|
|
109
|
+
|
|
110
|
+
agentic-proofkit selective-gate-obligation-decision-input --input proofkit/selective-gate-obligation-decision.json \
|
|
111
|
+
| proofkit obligation-decision --input - --agent-envelope
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Rejected Alternatives
|
|
115
|
+
|
|
116
|
+
| Alternative | Rejection |
|
|
117
|
+
|---|---|
|
|
118
|
+
| Change `selective-gate-evidence` output to include decisions | That would alter existing report semantics and exit-code expectations. |
|
|
119
|
+
| Infer routes from command ids | Command ids alone are not globally enough when command/source-path keys differ. |
|
|
120
|
+
| Map producer-admission failures from strings | String diagnostics are not a stable typed authority boundary. |
|
|
121
|
+
| Treat passed receipts as full merge satisfaction | The projection only satisfies the selective-evidence obligation scope; freshness and producer trust remain caller-owned. |
|
|
122
|
+
| Compute currentness or scope inside this projection | Current facts and changed-scope analysis are caller-owned and must be supplied through typed diagnostics. |
|
|
123
|
+
| Emit an obligation-decision report directly from the projection command | That would make the projection command a second report/envelope owner and would blur the exit-code boundary between valid translation and proof satisfaction. |
|
|
124
|
+
|
|
125
|
+
## Proof Obligations
|
|
126
|
+
|
|
127
|
+
- Unit tests prove passed, missing, failed, blocked, not-run, and duplicate
|
|
128
|
+
receipt mappings.
|
|
129
|
+
- Unit tests prove route map omissions and extras fail closed.
|
|
130
|
+
- Unit tests prove unscoped failures fail closed instead of being guessed.
|
|
131
|
+
- Unit tests prove optional receipt currentness/scope diagnostics can add
|
|
132
|
+
`stale_receipt`, `unknown_scope`, and fail-closed anchoring.
|
|
133
|
+
- Unit tests prove optional trust-class diagnostics can add
|
|
134
|
+
`invalid_producer` and `invalid_receipt` and fail-closed anchoring.
|
|
135
|
+
- CLI tests prove the projection command emits only obligation-decision input,
|
|
136
|
+
preserves stdin/file parity, and rejects `--agent-envelope`.
|
|
137
|
+
- Package artifact tests prove the public API remains root-exported and packed.
|
|
138
|
+
- Full package checks prove the additive projection does not regress existing
|
|
139
|
+
report behavior.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Selective Evidence Producer Admission Design
|
|
2
|
+
|
|
3
|
+
Status: accepted; implemented as an optional selective-evidence strengthening
|
|
4
|
+
layer.
|
|
5
|
+
|
|
6
|
+
Owner: `proofkit`.
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Selective gate evidence already verifies that every planned command has one
|
|
11
|
+
caller-provided receipt. That proves coverage of the plan, but it does not
|
|
12
|
+
prove that a passed receipt is compatible with an admitted producer. This design
|
|
13
|
+
adds an optional bridge from selective command receipts to producer-admission
|
|
14
|
+
receipts without making proofkit read CI, authenticate runners, execute
|
|
15
|
+
commands, or decide merge approval.
|
|
16
|
+
|
|
17
|
+
Formal goal:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
selective gate plan + command receipts + optional producer-admission input
|
|
21
|
+
-> proofkit selective evidence report
|
|
22
|
+
-> caller-owned merge/proof decision
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Authority Boundary
|
|
26
|
+
|
|
27
|
+
Proofkit owns:
|
|
28
|
+
|
|
29
|
+
- exact schema admission for the optional producer-admission field;
|
|
30
|
+
- deterministic rebuilding of the producer-admission report from caller input;
|
|
31
|
+
- cross-checks from passed command receipts to producer-admission receipt ids;
|
|
32
|
+
- evidence-ref, status, subject, and merge-satisfaction consistency checks;
|
|
33
|
+
- deterministic report diagnostics and non-claims.
|
|
34
|
+
|
|
35
|
+
The consuming repository owns:
|
|
36
|
+
|
|
37
|
+
- producer trust roots;
|
|
38
|
+
- CI runner identity and authentication;
|
|
39
|
+
- receipt freshness;
|
|
40
|
+
- native command execution;
|
|
41
|
+
- whether selective evidence is required for merge;
|
|
42
|
+
- rollout or deployment approval.
|
|
43
|
+
|
|
44
|
+
Formal rule:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
Without producerAdmission, selective evidence keeps legacy behavior.
|
|
48
|
+
With producerAdmission, passed planned receipts must bind to merge-satisfying
|
|
49
|
+
producer-admission receipts.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Model
|
|
53
|
+
|
|
54
|
+
`ProofkitSelectiveGateCommandReceipt` may declare `producerReceiptId`. The id
|
|
55
|
+
points at a receipt inside the caller-provided `producerAdmission` input.
|
|
56
|
+
|
|
57
|
+
When `producerAdmission` is absent:
|
|
58
|
+
|
|
59
|
+
- existing selective evidence behavior is preserved;
|
|
60
|
+
- the producer-admission rule is skipped;
|
|
61
|
+
- the report still does not claim producer authenticity or freshness.
|
|
62
|
+
|
|
63
|
+
When `producerAdmission` is present:
|
|
64
|
+
|
|
65
|
+
1. Proofkit rebuilds the producer-admission report from the supplied input.
|
|
66
|
+
2. Producer-admission failures become selective-evidence failures.
|
|
67
|
+
3. Every passed receipt for a planned command must declare `producerReceiptId`.
|
|
68
|
+
4. The referenced producer-admission receipt must exist.
|
|
69
|
+
5. The referenced producer-admission receipt must match command id, status,
|
|
70
|
+
evidence ref, and merge-satisfaction intent.
|
|
71
|
+
|
|
72
|
+
The command id is the generic subject ref because it is the stable planned
|
|
73
|
+
command identity available to every consumer. Consumers that need richer subject
|
|
74
|
+
identity must encode that in their own producer policy or command ids.
|
|
75
|
+
|
|
76
|
+
## Rejected Alternatives
|
|
77
|
+
|
|
78
|
+
| Alternative | Rejection reason |
|
|
79
|
+
|---|---|
|
|
80
|
+
| Accept only a producer-admission report | The report lacks full receipt metadata, so it cannot bind a selective receipt to a producer receipt without a second hidden source. |
|
|
81
|
+
| Make producer admission mandatory | Existing consumers can have valid selective coverage before adopting producer policy. Mandatory admission would be a breaking change. |
|
|
82
|
+
| Trust any passed selective receipt | It preserves legacy behavior but cannot distinguish local advisory proof from admitted merge proof. |
|
|
83
|
+
| Let proofkit infer producer ids from CI environment | It would turn proofkit into a CI trust-root owner and require ambient state reads. |
|
|
84
|
+
|
|
85
|
+
## Proof Obligations
|
|
86
|
+
|
|
87
|
+
- existing selective-evidence tests must pass without `producerAdmission`;
|
|
88
|
+
- positive test for passed receipts bound to merge-satisfying producer receipts;
|
|
89
|
+
- negative tests for missing producer receipt ids, non-merge-satisfying producer
|
|
90
|
+
receipts, evidence-ref drift, and producer-admission failures;
|
|
91
|
+
- CLI tests must keep deterministic report behavior because the CLI passes the
|
|
92
|
+
input through the same report builder;
|
|
93
|
+
- package checks must prove the published artifact still exposes the selective
|
|
94
|
+
evidence and producer admission contracts.
|
|
95
|
+
|
|
96
|
+
## Non-Claims
|
|
97
|
+
|
|
98
|
+
Selective evidence with producer admission does not claim:
|
|
99
|
+
|
|
100
|
+
- CI runner authentication;
|
|
101
|
+
- receipt freshness;
|
|
102
|
+
- command execution;
|
|
103
|
+
- command result correctness beyond caller-provided status metadata;
|
|
104
|
+
- merge approval;
|
|
105
|
+
- rollout approval;
|
|
106
|
+
- repository policy ownership.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Selective Evidence Receipt Trust-Class Projection Design
|
|
2
|
+
|
|
3
|
+
Status: accepted; implemented as a generic projection bridge.
|
|
4
|
+
|
|
5
|
+
Owner: `proofkit`.
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Selective gate evidence already maps command-scoped receipts into obligation
|
|
10
|
+
decision records. Receipt trust-class admission separately validates whether a
|
|
11
|
+
caller-provided receipt is strong enough for a caller-provided proof class. This
|
|
12
|
+
design connects those two primitives without making selective evidence own risk
|
|
13
|
+
policy, trust policy, producer authentication, freshness, or merge approval.
|
|
14
|
+
|
|
15
|
+
Formal goal:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
selective evidence + command routes + optional receipt trust-class report input
|
|
19
|
+
-> obligation-decision input with invalid_producer/invalid_receipt candidates
|
|
20
|
+
-> caller-owned merge/proof decision
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Boundary
|
|
24
|
+
|
|
25
|
+
Proofkit owns:
|
|
26
|
+
|
|
27
|
+
- exact optional input admission;
|
|
28
|
+
- exact coverage checks between command-route obligations with one selective
|
|
29
|
+
receipt and trust-class diagnostics;
|
|
30
|
+
- route and receipt alignment checks for requirement id, proof-route ref,
|
|
31
|
+
producer receipt id, and receipt status;
|
|
32
|
+
- fail-closed rejection of unscoped or missing trust-class diagnostics;
|
|
33
|
+
- deterministic projection of `invalid_producer` and `invalid_receipt`
|
|
34
|
+
candidate states into obligation-decision inputs;
|
|
35
|
+
- deterministic evidence-ref aggregation from selective receipts and trust
|
|
36
|
+
diagnostics.
|
|
37
|
+
|
|
38
|
+
The consuming repository owns:
|
|
39
|
+
|
|
40
|
+
- proof-class meaning and risk taxonomy;
|
|
41
|
+
- trust-class values and rank policy;
|
|
42
|
+
- producer authentication;
|
|
43
|
+
- receipt freshness;
|
|
44
|
+
- attestation verification;
|
|
45
|
+
- command execution truth;
|
|
46
|
+
- merge, release, and rollout policy.
|
|
47
|
+
|
|
48
|
+
## Invariants
|
|
49
|
+
|
|
50
|
+
- If `receiptTrustClassAdmission` is omitted, existing selective evidence
|
|
51
|
+
projection semantics remain unchanged.
|
|
52
|
+
- If `receiptTrustClassAdmission` is supplied, every projected command route
|
|
53
|
+
obligation that has exactly one selective receipt must have exactly one
|
|
54
|
+
trust-class diagnostic.
|
|
55
|
+
- Trust-class diagnostics outside projected command-route obligations, or for
|
|
56
|
+
obligations without exactly one selective receipt, fail closed.
|
|
57
|
+
- Trust-class diagnostics must match the route `requirementId` and
|
|
58
|
+
`proofRouteRef`.
|
|
59
|
+
- Trust-class diagnostics must match the selective receipt `producerReceiptId`
|
|
60
|
+
and `status`.
|
|
61
|
+
- Selective receipts without `producerReceiptId` cannot be anchored to
|
|
62
|
+
trust-class diagnostics and fail closed when trust-class projection is
|
|
63
|
+
requested.
|
|
64
|
+
- Trust-class findings do not replace selective receipt findings; candidate
|
|
65
|
+
states are combined and ordered by the closed obligation-decision lattice.
|
|
66
|
+
- A passed selective receipt can still project `invalid_producer` or
|
|
67
|
+
`invalid_receipt` when the caller-provided trust-class report says it is too
|
|
68
|
+
weak for the obligation risk class.
|
|
69
|
+
|
|
70
|
+
## Rejected Alternatives
|
|
71
|
+
|
|
72
|
+
| Alternative | Rejection reason |
|
|
73
|
+
|---|---|
|
|
74
|
+
| Add trust classes to the selective gate evidence report | Trust compatibility is obligation/risk-level, not command coverage. |
|
|
75
|
+
| Duplicate trust-class validation inside selective evidence | That would create two owners for the same compatibility rule. |
|
|
76
|
+
| Treat trust-class failures as unscoped report failures | That would lose per-obligation decision states. |
|
|
77
|
+
| Make trust-class admission mandatory | Existing consumers may not have adopted receipt trust classes yet. |
|
|
78
|
+
|
|
79
|
+
## Proof Obligations
|
|
80
|
+
|
|
81
|
+
- tests prove omitted trust-class input preserves existing projection behavior;
|
|
82
|
+
- tests prove low-trust evidence projects `invalid_producer` even when the
|
|
83
|
+
command receipt passed;
|
|
84
|
+
- tests prove missing provenance/artifacts project `invalid_receipt`;
|
|
85
|
+
- tests prove missing, unscoped, route-mismatched, receipt-mismatched, and
|
|
86
|
+
unanchored trust-class diagnostics fail closed.
|
|
87
|
+
|
|
88
|
+
## Non-Claims
|
|
89
|
+
|
|
90
|
+
Selective evidence receipt trust-class projection does not claim:
|
|
91
|
+
|
|
92
|
+
- producer authentication;
|
|
93
|
+
- receipt freshness;
|
|
94
|
+
- attestation verification;
|
|
95
|
+
- risk-policy ownership;
|
|
96
|
+
- trust-policy ownership;
|
|
97
|
+
- native command execution;
|
|
98
|
+
- merge approval;
|
|
99
|
+
- release approval;
|
|
100
|
+
- rollout approval.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Selective Gate Evidence Agent Envelope Design
|
|
2
|
+
|
|
3
|
+
Status: accepted; implemented as an internal builder and opt-in CLI projection.
|
|
4
|
+
|
|
5
|
+
Owner: `proofkit`.
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Selective gate evidence reports classify whether planned commands have
|
|
10
|
+
caller-provided receipts. Agents need a bounded failure packet that answers:
|
|
11
|
+
which commands are missing evidence, which receipts failed or were blocked, and
|
|
12
|
+
which producer-admission metadata needs caller review.
|
|
13
|
+
This design adds `buildProofkitSelectiveGateEvidenceAgentEnvelope` and
|
|
14
|
+
`selective-gate-evidence --agent-envelope` as bounded projections over an
|
|
15
|
+
already-built selective evidence result.
|
|
16
|
+
|
|
17
|
+
Formal goal:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
caller-owned selective evidence report
|
|
21
|
+
-> bounded agent guidance envelope
|
|
22
|
+
-> caller-owned rerun, repair, or receipt-admission action
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Authority Boundary
|
|
26
|
+
|
|
27
|
+
Proofkit owns:
|
|
28
|
+
|
|
29
|
+
- deterministic envelope construction from the selective evidence result;
|
|
30
|
+
- a reusable internal builder owned by the selective gate evidence module;
|
|
31
|
+
- bounded command refs for missing, failed, not-run, and blocked evidence;
|
|
32
|
+
- required receipt-class refs for missing receipts;
|
|
33
|
+
- receipt-artifact refs for failed, not-run, and blocked receipts;
|
|
34
|
+
- blocked preconditions for blocked receipts and producer-admission failures;
|
|
35
|
+
- invalid-input envelope reporting for parsed agent-envelope failures.
|
|
36
|
+
|
|
37
|
+
The consuming repository owns:
|
|
38
|
+
|
|
39
|
+
- native command execution;
|
|
40
|
+
- receipt production and storage;
|
|
41
|
+
- producer admission policy;
|
|
42
|
+
- CI authenticity and freshness;
|
|
43
|
+
- proof adequacy, merge approval, and rollout decisions.
|
|
44
|
+
|
|
45
|
+
Formal rule:
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
The evidence envelope routes remediation.
|
|
49
|
+
The evidence report owns observed metadata classification.
|
|
50
|
+
Caller-owned commands and receipts own proof execution facts.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Model
|
|
54
|
+
|
|
55
|
+
The projection emits:
|
|
56
|
+
|
|
57
|
+
- one evidence-report context ref with a stable hash;
|
|
58
|
+
- one selective-plan hash context ref;
|
|
59
|
+
- command refs for actionable command gaps;
|
|
60
|
+
- required receipt-class refs for missing receipts;
|
|
61
|
+
- receipt-artifact refs for failed, not-run, and blocked receipts;
|
|
62
|
+
- route and verify actions;
|
|
63
|
+
- blocked preconditions for blocked receipts and producer-admission failures;
|
|
64
|
+
- omitted records when failure lists exceed envelope limits.
|
|
65
|
+
|
|
66
|
+
The envelope does not include passed receipts by default because passed receipts
|
|
67
|
+
are already non-actionable for remediation. Consumers that need a full receipt
|
|
68
|
+
audit should inspect the selective evidence report or producer-admission report.
|
|
69
|
+
|
|
70
|
+
## Rejected Alternatives
|
|
71
|
+
|
|
72
|
+
| Alternative | Rejection reason |
|
|
73
|
+
|---|---|
|
|
74
|
+
| Emit every receipt into the envelope | Passed receipts can dominate token budget without adding remediation value. |
|
|
75
|
+
| Treat failed receipts as required receipt classes | Failed/not-run/blocked receipts are observed artifacts, not missing classes. |
|
|
76
|
+
| Resolve producer-admission failures automatically | Producer policy and trust roots are consumer-owned. |
|
|
77
|
+
| Add merge recommendations | Proofkit does not own merge policy or proof adequacy. |
|
|
78
|
+
|
|
79
|
+
## Proof Obligations
|
|
80
|
+
|
|
81
|
+
- module test for `buildProofkitSelectiveGateEvidenceAgentEnvelope`;
|
|
82
|
+
- CLI test for `selective-gate-evidence --agent-envelope`;
|
|
83
|
+
- unsupported command test proving unrelated report families still reject
|
|
84
|
+
`--agent-envelope`;
|
|
85
|
+
- invalid-input envelope test for selective evidence parsing failures;
|
|
86
|
+
- full package check proving ordinary selective evidence output is unchanged
|
|
87
|
+
without `--agent-envelope`.
|
|
88
|
+
|
|
89
|
+
## Non-Claims
|
|
90
|
+
|
|
91
|
+
Selective gate evidence envelopes do not claim:
|
|
92
|
+
|
|
93
|
+
- native command execution;
|
|
94
|
+
- receipt freshness;
|
|
95
|
+
- producer authentication;
|
|
96
|
+
- proof adequacy;
|
|
97
|
+
- changed-path completeness;
|
|
98
|
+
- merge approval;
|
|
99
|
+
- rollout approval;
|
|
100
|
+
- repository policy ownership.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Selective Gate Plan Agent Envelope Design
|
|
2
|
+
|
|
3
|
+
Status: accepted; implemented as an internal builder and opt-in CLI projection.
|
|
4
|
+
|
|
5
|
+
Owner: `proofkit`.
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Selective gate plans can be large. Agents need the smallest actionable packet:
|
|
10
|
+
what changed, which commands are required, which receipts are expected, and
|
|
11
|
+
what was omitted. This design adds
|
|
12
|
+
`buildProofkitSelectiveGatePlanAgentEnvelope` and
|
|
13
|
+
`selective-gate-plan --agent-envelope` as bounded projections over an
|
|
14
|
+
already-built plan.
|
|
15
|
+
|
|
16
|
+
Formal goal:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
caller-owned selective gate plan
|
|
20
|
+
-> bounded agent guidance envelope
|
|
21
|
+
-> caller-owned command execution and receipts
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Authority Boundary
|
|
25
|
+
|
|
26
|
+
Proofkit owns:
|
|
27
|
+
|
|
28
|
+
- deterministic envelope construction from the caller-provided plan;
|
|
29
|
+
- a reusable internal builder owned by the selective gate plan module;
|
|
30
|
+
- bounded context, command, receipt-class, omission, and action records;
|
|
31
|
+
- source plan hash and source state projection;
|
|
32
|
+
- invalid-input envelope reporting for parsed agent-envelope failures.
|
|
33
|
+
|
|
34
|
+
The consuming repository owns:
|
|
35
|
+
|
|
36
|
+
- changed-path completeness;
|
|
37
|
+
- command registry truth;
|
|
38
|
+
- native command execution;
|
|
39
|
+
- receipt production and producer admission;
|
|
40
|
+
- proof freshness;
|
|
41
|
+
- merge or rollout decisions.
|
|
42
|
+
|
|
43
|
+
Formal rule:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
The envelope routes agent work.
|
|
47
|
+
The selective gate plan owns planned command metadata.
|
|
48
|
+
Native tools and caller receipts own observed execution.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Model
|
|
52
|
+
|
|
53
|
+
The projection emits:
|
|
54
|
+
|
|
55
|
+
- one source-plan context ref with a stable hash;
|
|
56
|
+
- bounded changed-path, generated-artifact, and touched-witness context refs;
|
|
57
|
+
- bounded command refs from `requiredCommands`;
|
|
58
|
+
- required receipt-class refs for emitted commands;
|
|
59
|
+
- route and verify action items;
|
|
60
|
+
- omitted records when context or commands exceed envelope limits;
|
|
61
|
+
- blocked preconditions for fail-closed plan failures.
|
|
62
|
+
|
|
63
|
+
The envelope is intentionally not a complete proof ledger. When omitted records
|
|
64
|
+
exist, the caller must inspect the full plan or run a wider/full gate.
|
|
65
|
+
|
|
66
|
+
## Rejected Alternatives
|
|
67
|
+
|
|
68
|
+
| Alternative | Rejection reason |
|
|
69
|
+
|---|---|
|
|
70
|
+
| Emit the full selective plan as an agent packet | It duplicates large input and defeats token efficiency. |
|
|
71
|
+
| Execute required commands from the envelope command | It would violate the CLI boundary and turn proofkit into a runner. |
|
|
72
|
+
| Treat required receipt classes as receipt artifacts | Required classes describe needed evidence; they are not observed receipts. |
|
|
73
|
+
| Add envelopes for every report family now | Each family needs a separate mapping proof to avoid generic but misleading actions. |
|
|
74
|
+
|
|
75
|
+
## Proof Obligations
|
|
76
|
+
|
|
77
|
+
- module test for `buildProofkitSelectiveGatePlanAgentEnvelope`;
|
|
78
|
+
- CLI test for `selective-gate-plan --agent-envelope`;
|
|
79
|
+
- unsupported command test proving other report families still reject
|
|
80
|
+
`--agent-envelope`;
|
|
81
|
+
- invalid-input envelope test for selective plan parsing failures;
|
|
82
|
+
- full package check proving the projection does not break existing CLI output.
|
|
83
|
+
|
|
84
|
+
## Non-Claims
|
|
85
|
+
|
|
86
|
+
Selective gate plan envelopes do not claim:
|
|
87
|
+
|
|
88
|
+
- command execution;
|
|
89
|
+
- command pass evidence;
|
|
90
|
+
- receipt freshness;
|
|
91
|
+
- producer admission;
|
|
92
|
+
- changed-path completeness;
|
|
93
|
+
- merge approval;
|
|
94
|
+
- rollout approval;
|
|
95
|
+
- repository policy ownership.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Selective Planner Edge Coverage Design
|
|
2
|
+
|
|
3
|
+
Status: maintained design note for selective planner soundness.
|
|
4
|
+
|
|
5
|
+
Owner: `proofkit`.
|
|
6
|
+
|
|
7
|
+
## Problem
|
|
8
|
+
|
|
9
|
+
Selective plans are safe only when every relevant changed edge is either covered
|
|
10
|
+
by a planned proof route or fails closed. A wide command is not a valid fallback
|
|
11
|
+
by name alone: it must declare coverage for the edge class that caused
|
|
12
|
+
escalation.
|
|
13
|
+
|
|
14
|
+
Without typed edge coverage, a consumer can provide a full-workspace command
|
|
15
|
+
while Proofkit cannot prove whether that command covers dynamic imports,
|
|
16
|
+
generated-source drift, reverse dependencies, command/environment registry
|
|
17
|
+
changes, or other unknown edge classes.
|
|
18
|
+
|
|
19
|
+
## Decision
|
|
20
|
+
|
|
21
|
+
`buildProofkitSelectiveGatePlan` accepts caller-provided `unknownEdges` and
|
|
22
|
+
caller-provided `fallbackCoverage` declarations.
|
|
23
|
+
|
|
24
|
+
Proofkit validates and reports:
|
|
25
|
+
|
|
26
|
+
- stable edge classes;
|
|
27
|
+
- each unknown edge path and reason;
|
|
28
|
+
- which declared fallback command ids cover each edge;
|
|
29
|
+
- `fail_closed` when an unknown edge has no fallback that covers its edge class.
|
|
30
|
+
|
|
31
|
+
Proofkit adds a fallback command to `requiredCommands` only when the fallback
|
|
32
|
+
declares the unknown edge class. A full workspace command without matching edge
|
|
33
|
+
coverage is not treated as proof coverage.
|
|
34
|
+
|
|
35
|
+
## Authority
|
|
36
|
+
|
|
37
|
+
Proofkit owns:
|
|
38
|
+
|
|
39
|
+
- generic edge-class vocabulary;
|
|
40
|
+
- fallback coverage declaration shape;
|
|
41
|
+
- deterministic normalization and sorting;
|
|
42
|
+
- fail-closed diagnostics for uncovered unknown edges.
|
|
43
|
+
|
|
44
|
+
The consuming repository owns:
|
|
45
|
+
|
|
46
|
+
- discovering changed edges;
|
|
47
|
+
- deciding whether an edge is unknown or relevant;
|
|
48
|
+
- mapping real repository topology and dependency closure;
|
|
49
|
+
- declaring which command covers which edge class;
|
|
50
|
+
- executing fallback commands;
|
|
51
|
+
- producer admission, receipt freshness, and merge policy.
|
|
52
|
+
|
|
53
|
+
## Non-Claims
|
|
54
|
+
|
|
55
|
+
This design does not make Proofkit a repository scanner, dependency graph
|
|
56
|
+
resolver, command executor, CI authority, receipt freshness engine, or merge
|
|
57
|
+
approval authority.
|
|
58
|
+
|
|
59
|
+
## Rejected Alternatives
|
|
60
|
+
|
|
61
|
+
| Alternative | Rejection reason |
|
|
62
|
+
|---|---|
|
|
63
|
+
| Treat `fullWorkspaceCommand` as universal fallback | Unsafe because the command does not prove coverage for the edge class that caused escalation. |
|
|
64
|
+
| Parse failure strings to infer `unknown_scope` | Brittle and not machine-stable enough for agent routing or obligation decisions. |
|
|
65
|
+
| Implement repository graph scanning in Proofkit | Violates Proofkit's generic boundary and duplicates consumer-owned topology policy. |
|
|
66
|
+
|
|
67
|
+
## Invariants
|
|
68
|
+
|
|
69
|
+
1. Unknown edge coverage is explicit by edge class.
|
|
70
|
+
2. An uncovered unknown edge makes the plan `fail_closed`.
|
|
71
|
+
3. Covered unknown edges add only their declared fallback commands.
|
|
72
|
+
4. Fallback command ids are unique inside one plan input.
|
|
73
|
+
5. Evidence admission rejects a covered unknown edge when the referenced
|
|
74
|
+
fallback declaration is missing or no longer covers the edge class.
|
|
75
|
+
6. Plan evidence hashes include edge/fallback diagnostics.
|
|
76
|
+
7. Agent envelopes may route unknown-edge context but do not prove fallback
|
|
77
|
+
execution.
|
|
78
|
+
|
|
79
|
+
## Proof Gates
|
|
80
|
+
|
|
81
|
+
Required closeout for this surface:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
go test ./...
|
|
85
|
+
go vet ./...
|
|
86
|
+
npm run build
|
|
87
|
+
npm run check
|
|
88
|
+
git diff --check
|
|
89
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Spec Overview Claim Boundary Design
|
|
2
|
+
|
|
3
|
+
Status: implemented.
|
|
4
|
+
|
|
5
|
+
Owner: `proofkit`.
|
|
6
|
+
|
|
7
|
+
## Problem
|
|
8
|
+
|
|
9
|
+
Human spec overviews are useful for context, examples, diagrams, and rationale,
|
|
10
|
+
but durable requirement meaning must live in structured `REQ-*` records. If an
|
|
11
|
+
overview sentence says a system `must`, `shall`, `guarantees`, or `always` does
|
|
12
|
+
something without citing a `REQ-*`, the overview becomes a second source of
|
|
13
|
+
truth.
|
|
14
|
+
|
|
15
|
+
## Decision
|
|
16
|
+
|
|
17
|
+
Add `spec-overview-claims`, a deterministic report over caller-provided overview
|
|
18
|
+
claim extraction facts.
|
|
19
|
+
|
|
20
|
+
The primitive validates:
|
|
21
|
+
|
|
22
|
+
- `overviewPath` equals `specPackagePath/overview.md`;
|
|
23
|
+
- `requirementsPath` equals `specPackagePath/requirements.v1.json`;
|
|
24
|
+
- every durable overview claim cites at least one known `REQ-*`;
|
|
25
|
+
- every cited `REQ-*` is declared by the caller-provided requirement id set;
|
|
26
|
+
- non-durable claims do not carry requirement citations;
|
|
27
|
+
- extraction refs, line digests, detected markers, rationale, and non-claims are
|
|
28
|
+
explicit and deterministic.
|
|
29
|
+
|
|
30
|
+
## Authority Boundary
|
|
31
|
+
|
|
32
|
+
Proofkit validates extracted claim facts. It does not read Markdown, detect
|
|
33
|
+
claims from source text, prove extractor completeness, decide whether a cited
|
|
34
|
+
`REQ-*` semantically supports the sentence, validate requirement source records,
|
|
35
|
+
or approve merge.
|
|
36
|
+
|
|
37
|
+
## Rejected Alternatives
|
|
38
|
+
|
|
39
|
+
| Alternative | Rejected Because |
|
|
40
|
+
|---|---|
|
|
41
|
+
| Fold this into requirement-source admission. | Structured requirement records and overview prose extraction have different authority boundaries. |
|
|
42
|
+
| Parse Markdown inside Proofkit. | Consumer repositories own extraction witnesses, ignored-region policy, and Markdown provenance. |
|
|
43
|
+
| Allow overview durable claims without citations when wording is obvious. | That reintroduces duplicate durable truth and breaks fail-closed traceability. |
|
|
44
|
+
| Let non-durable lines cite `REQ-*`. | It makes examples and rationale look normative and blurs the citation contract. |
|
|
45
|
+
|
|
46
|
+
## Follow-Up
|
|
47
|
+
|
|
48
|
+
Consumer repositories should pair this primitive with a native extractor witness
|
|
49
|
+
that turns `overview.md` into claim records, including ignored regions and line
|
|
50
|
+
digests. Proofkit validates the resulting facts only.
|