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,142 @@
|
|
|
1
|
+
# Producer Policy Self-Proof Design
|
|
2
|
+
|
|
3
|
+
Status: accepted; implemented as a generic report primitive.
|
|
4
|
+
|
|
5
|
+
Owner: `proofkit`.
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Producer admission policy is a protected repository contract. A pull request
|
|
10
|
+
that expands that policy must not satisfy its own merge obligations with
|
|
11
|
+
receipts that become merge-satisfying only because of the same policy change.
|
|
12
|
+
This design adds a generic self-proof guard for that cycle.
|
|
13
|
+
|
|
14
|
+
Formal goal:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
caller-owned producer-policy change facts
|
|
18
|
+
+ caller-owned merge-obligation receipt refs
|
|
19
|
+
-> proofkit producer-policy self-proof report
|
|
20
|
+
-> caller-owned invalid_producer / merge decision
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Authority Boundary
|
|
24
|
+
|
|
25
|
+
Proofkit owns:
|
|
26
|
+
|
|
27
|
+
- exact input schema admission;
|
|
28
|
+
- digest grammar for caller-provided policy digests;
|
|
29
|
+
- safe repository-relative policy and evidence refs;
|
|
30
|
+
- deterministic tuple-level self-proof detection;
|
|
31
|
+
- deterministic reports and boundary non-claims.
|
|
32
|
+
|
|
33
|
+
The consuming repository owns:
|
|
34
|
+
|
|
35
|
+
- producer authentication;
|
|
36
|
+
- producer-policy protection and ownership;
|
|
37
|
+
- policy-diff discovery;
|
|
38
|
+
- receipt freshness;
|
|
39
|
+
- current obligation matching;
|
|
40
|
+
- migration exception approval;
|
|
41
|
+
- merge, release, rollout, and production policy.
|
|
42
|
+
|
|
43
|
+
Formal rule:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
Proofkit can detect that a merge-obligation receipt uses a producer tuple newly
|
|
47
|
+
admitted by the same policy change.
|
|
48
|
+
Proofkit cannot decide whether the policy change is allowed to merge.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Model
|
|
52
|
+
|
|
53
|
+
The guard input describes one producer-policy change:
|
|
54
|
+
|
|
55
|
+
1. Policy identity, protected policy surface refs, and baseline/proposed/change
|
|
56
|
+
digests.
|
|
57
|
+
2. Admission changes as explicit trust tuples:
|
|
58
|
+
`producerId + producerClass + proofClass + receiptKind + environmentClass
|
|
59
|
+
+ provenanceRuleRef + artifactRetentionRuleRef + toAdmissionLevel`.
|
|
60
|
+
3. Receipt refs that cite an admitted proof-receipt record by ref and digest and
|
|
61
|
+
that the caller says are used for the same policy change's merge obligations.
|
|
62
|
+
4. Structured non-claim refs that point at caller-owned proof-scope or
|
|
63
|
+
spec-owned non-claim IDs instead of making this report a second semantic
|
|
64
|
+
non-claim owner.
|
|
65
|
+
|
|
66
|
+
The self-proof unit is a tuple, not only a producer id:
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
producerId
|
|
70
|
+
| producerClass
|
|
71
|
+
| proofClass
|
|
72
|
+
| receiptKind
|
|
73
|
+
| environmentClass
|
|
74
|
+
| provenanceRuleRef
|
|
75
|
+
| artifactRetentionRuleRef
|
|
76
|
+
| admissionLevel
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
This is required because a producer can be preexisting and safe for one proof
|
|
80
|
+
class while newly admitted for another proof class or environment. Promotions
|
|
81
|
+
from `advisory` to `merge_satisfying` are newly admitted merge-satisfying
|
|
82
|
+
tuples. Expanding receipt kind or environment class can also create a newly
|
|
83
|
+
admitted merge-satisfying tuple. Relaxing provenance or artifact-retention
|
|
84
|
+
requirements for the same producer, proof class, receipt kind, and environment
|
|
85
|
+
also creates a newly admitted trust tuple.
|
|
86
|
+
|
|
87
|
+
## Failure Rules
|
|
88
|
+
|
|
89
|
+
The report fails when:
|
|
90
|
+
|
|
91
|
+
- an unchanged policy digest declares admission changes;
|
|
92
|
+
- an `add_producer` change starts from an existing admission level;
|
|
93
|
+
- a `promote_to_merge_satisfying` change does not target `merge_satisfying`;
|
|
94
|
+
- a `promote_to_merge_satisfying` change does not change admission level;
|
|
95
|
+
- a merge-obligation receipt is not `passed`;
|
|
96
|
+
- a merge-obligation receipt is not declared `merge_satisfying`;
|
|
97
|
+
- a merge-obligation receipt uses a tuple newly admitted by the same
|
|
98
|
+
`policyChangeId`.
|
|
99
|
+
|
|
100
|
+
`usedForPolicyChangeId` must match the report `policyChangeId`; mismatches are
|
|
101
|
+
schema admission errors, not soft diagnostics.
|
|
102
|
+
|
|
103
|
+
## Rejected Alternatives
|
|
104
|
+
|
|
105
|
+
| Alternative | Rejection reason |
|
|
106
|
+
|---|---|
|
|
107
|
+
| Detect only newly admitted producer ids | Too coarse: the same producer may have old safe tuples and new unsafe tuples. |
|
|
108
|
+
| Detect only producer, receipt kind, environment, and admission level | Too weak: provenance and artifact-retention relaxations can newly admit trust for the same visible tuple. |
|
|
109
|
+
| Put self-proof detection into proof receipt admission | Receipt shape validation and producer-policy change validation are different failure classes. |
|
|
110
|
+
| Put self-proof detection into receipt producer admission | Matching receipts to current policy is not the same as proving that a policy change did not admit its own evidence. |
|
|
111
|
+
| Let proofkit discover policy diffs from git | That would make proofkit an implicit repository scanner and policy-diff owner. |
|
|
112
|
+
| Add migration-exception approval to the report | Migration approval is repository-owned policy, not a generic proofkit decision. |
|
|
113
|
+
|
|
114
|
+
## Proof Obligations
|
|
115
|
+
|
|
116
|
+
- report builder test for preexisting merge-satisfying tuple success;
|
|
117
|
+
- negative tests for newly added producer tuple, advisory-to-merge promotion,
|
|
118
|
+
receipt-kind/environment tuple expansion, and provenance or retention
|
|
119
|
+
relaxation;
|
|
120
|
+
- positive tests for newly admitted tuples that are not used for merge
|
|
121
|
+
obligations and old tuples from a producer that also gets a new tuple;
|
|
122
|
+
- negative tests for non-passed or advisory merge-obligation receipts;
|
|
123
|
+
- schema tests for malformed digests, unsafe paths, duplicate ids, unsupported
|
|
124
|
+
fields, and mismatched `policyChangeId`;
|
|
125
|
+
- CLI test for `producer-policy-self-proof`;
|
|
126
|
+
- package artifact test proving the primitive ships in the published package.
|
|
127
|
+
|
|
128
|
+
## Non-Claims
|
|
129
|
+
|
|
130
|
+
Producer policy self-proof does not claim:
|
|
131
|
+
|
|
132
|
+
- producer authentication;
|
|
133
|
+
- receipt freshness;
|
|
134
|
+
- policy digest provenance;
|
|
135
|
+
- policy-diff discovery;
|
|
136
|
+
- command execution;
|
|
137
|
+
- CI state;
|
|
138
|
+
- migration exception approval;
|
|
139
|
+
- merge approval;
|
|
140
|
+
- release approval;
|
|
141
|
+
- rollout approval;
|
|
142
|
+
- production readiness.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Project Structure Agent Envelope Design
|
|
2
|
+
|
|
3
|
+
## Decision
|
|
4
|
+
|
|
5
|
+
Proofkit provides an opt-in project-structure scaffold agent envelope that
|
|
6
|
+
projects a project-structure scaffold result into a bounded work packet for a
|
|
7
|
+
coding agent.
|
|
8
|
+
|
|
9
|
+
## Problem
|
|
10
|
+
|
|
11
|
+
`scaffold-project-structure` emits a dry-run materialization manifest with
|
|
12
|
+
starter JSON payloads and caller-owned content gaps. That is the correct
|
|
13
|
+
authority surface for human review, but it is too large and too payload-heavy
|
|
14
|
+
for the first agent routing step.
|
|
15
|
+
|
|
16
|
+
The missing invariant is:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
project-structure scaffold result
|
|
20
|
+
-> bounded agent envelope
|
|
21
|
+
-> caller-owned file materialization and native proof
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Boundary
|
|
25
|
+
|
|
26
|
+
Proofkit owns:
|
|
27
|
+
|
|
28
|
+
- deterministic projection from a project-structure scaffold result;
|
|
29
|
+
- context refs for candidate file paths without embedding file payload bodies;
|
|
30
|
+
- action items for review, materialization, caller-authored content, and
|
|
31
|
+
verification;
|
|
32
|
+
- deterministic command refs for next proofkit command text already emitted by
|
|
33
|
+
the scaffold;
|
|
34
|
+
- omitted-count records when the manifest is larger than the envelope bounds;
|
|
35
|
+
- non-claims denying file writes, payload transport, native execution,
|
|
36
|
+
freshness, merge, release, and rollout authority.
|
|
37
|
+
|
|
38
|
+
The consuming repository owns:
|
|
39
|
+
|
|
40
|
+
- whether to create, overwrite, merge, or ignore candidate files;
|
|
41
|
+
- final module specification content;
|
|
42
|
+
- final repository profile content and repository profile admission;
|
|
43
|
+
- native witness execution and receipt production;
|
|
44
|
+
- CI freshness, merge, enforcement, release, and rollout decisions.
|
|
45
|
+
|
|
46
|
+
Formal rule:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
The scaffold manifest carries payload review data.
|
|
50
|
+
The scaffold agent envelope carries bounded routing data.
|
|
51
|
+
The consuming repository owns materialization and proof.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Model
|
|
55
|
+
|
|
56
|
+
The projection emits:
|
|
57
|
+
|
|
58
|
+
- `envelopeId = <scaffold report id>.agent-envelope`;
|
|
59
|
+
- source report identity from the project-structure scaffold report;
|
|
60
|
+
- explicit `bounds` covering context refs, action items, command refs, omitted
|
|
61
|
+
records, receipt refs, and omitted counts;
|
|
62
|
+
- context refs for each candidate file path up to a bounded limit;
|
|
63
|
+
- route questions for what changed, what proves it, and who owns it;
|
|
64
|
+
- clarification questions for caller-owned content and review preconditions;
|
|
65
|
+
- command refs for the scaffold manifest next command text up to a bounded
|
|
66
|
+
limit;
|
|
67
|
+
- action items for route, candidate-change, bind, and verify phases;
|
|
68
|
+
- blocked preconditions for each `caller_content_required` file and each
|
|
69
|
+
starter repository-profile draft that still requires caller review;
|
|
70
|
+
- omissions for truncated context refs or command refs;
|
|
71
|
+
- empty receipt refs, because the scaffold step has not executed native
|
|
72
|
+
witnesses;
|
|
73
|
+
- no starter file payload bodies.
|
|
74
|
+
|
|
75
|
+
Payload files remain available only in the full scaffold result. The agent
|
|
76
|
+
envelope deliberately names them as paths and content-hash refs so an agent can
|
|
77
|
+
route work without loading every generated payload into context.
|
|
78
|
+
Content-hash refs are metadata for review and drift detection only; they are
|
|
79
|
+
not recoverable payload transport and do not prove file existence or caller
|
|
80
|
+
approval.
|
|
81
|
+
|
|
82
|
+
## Rejected Alternatives
|
|
83
|
+
|
|
84
|
+
| Alternative | Rejection reason |
|
|
85
|
+
|---|---|
|
|
86
|
+
| Put full starter payloads into the envelope | Payload bodies defeat the token-efficiency purpose of agent envelopes. |
|
|
87
|
+
| Make `scaffold-project-structure` write files | File writes require consumer-owned overwrite and review policy. |
|
|
88
|
+
| Infer `argv` by splitting command text | Shell text is display/routing metadata unless the source primitive owns structured argv. |
|
|
89
|
+
| Reuse the bootstrap envelope | Project-structure scaffolds include repo-profile scaffold and workflow inputs, so bootstrap-only roles lose owner context. |
|
|
90
|
+
| Emit an envelope for every manifest by default | Machine callers may need the full result; envelope mode must be explicit. |
|
|
91
|
+
|
|
92
|
+
## Proof Obligations
|
|
93
|
+
|
|
94
|
+
- Unit tests prove envelope bounds, context refs, command refs, omitted counts,
|
|
95
|
+
caller-content blocked preconditions, and payload-body exclusion.
|
|
96
|
+
- CLI tests prove `scaffold-project-structure --agent-envelope`, file input and
|
|
97
|
+
stdin parity, and invalid-input envelope behavior.
|
|
98
|
+
- CLI tests prove unrelated materialization flags remain fail-closed.
|
|
99
|
+
- Package artifact tests prove the package binary, packed CLI smoke path, and
|
|
100
|
+
design note are shipped to outside consumers.
|
|
101
|
+
- Full package check proves ordinary scaffold output remains unchanged without
|
|
102
|
+
`--agent-envelope`.
|
|
103
|
+
|
|
104
|
+
## Non-Claims
|
|
105
|
+
|
|
106
|
+
Project-structure scaffold agent envelopes do not claim:
|
|
107
|
+
|
|
108
|
+
- repository-state discovery;
|
|
109
|
+
- file writes;
|
|
110
|
+
- starter payload transport;
|
|
111
|
+
- file existence;
|
|
112
|
+
- overwrite safety;
|
|
113
|
+
- final specification or repository profile content;
|
|
114
|
+
- native witness execution;
|
|
115
|
+
- command pass evidence;
|
|
116
|
+
- receipt authenticity or freshness;
|
|
117
|
+
- merge approval;
|
|
118
|
+
- enforcement promotion approval;
|
|
119
|
+
- release approval;
|
|
120
|
+
- rollout approval;
|
|
121
|
+
- consumer policy authority.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Project Structure Scaffold Design
|
|
2
|
+
|
|
3
|
+
## Decision
|
|
4
|
+
|
|
5
|
+
Proofkit provides a deterministic `scaffold-project-structure` primitive that
|
|
6
|
+
composes existing starter primitives into one dry-run review packet for a new
|
|
7
|
+
or first-module consumer adoption.
|
|
8
|
+
|
|
9
|
+
## Problem
|
|
10
|
+
|
|
11
|
+
Consumers can already run `scaffold-profile-plan`, `gradual-adoption-bootstrap`,
|
|
12
|
+
`adoption-workflow-plan`, and materialization manifest projections separately.
|
|
13
|
+
That is correct for ownership, but inconvenient as the first adoption step:
|
|
14
|
+
agents must assemble the same starter file set by hand and can drift path
|
|
15
|
+
relationships between the repository profile, proof binding, bootstrap input,
|
|
16
|
+
and workflow input.
|
|
17
|
+
|
|
18
|
+
The missing invariant is:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
caller-owned project scaffold input
|
|
22
|
+
-> existing proofkit starter primitives
|
|
23
|
+
-> one dry-run file review packet
|
|
24
|
+
-> caller-owned materialization and native proof
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Boundary
|
|
28
|
+
|
|
29
|
+
Proofkit owns:
|
|
30
|
+
|
|
31
|
+
- deterministic composition of existing starter primitives;
|
|
32
|
+
- path consistency checks across the profile scaffold, bootstrap input, and
|
|
33
|
+
workflow input;
|
|
34
|
+
- stable JSON starter payloads and `sha256:` content refs;
|
|
35
|
+
- explicit caller-owned file gaps;
|
|
36
|
+
- non-claims denying scanning, writes, native execution, freshness, merge,
|
|
37
|
+
release, and rollout authority.
|
|
38
|
+
|
|
39
|
+
The consuming repository owns:
|
|
40
|
+
|
|
41
|
+
- final file writes and overwrite policy;
|
|
42
|
+
- final module specification text;
|
|
43
|
+
- final repository profile review;
|
|
44
|
+
- native witness execution;
|
|
45
|
+
- receipt production and producer admission;
|
|
46
|
+
- CI freshness, merge, enforcement, release, and rollout decisions.
|
|
47
|
+
|
|
48
|
+
## Chosen Model
|
|
49
|
+
|
|
50
|
+
The primitive accepts one explicit input containing:
|
|
51
|
+
|
|
52
|
+
- the target paths for the scaffold input, bootstrap input, and workflow input;
|
|
53
|
+
- a `repoProfileScaffold` input;
|
|
54
|
+
- a `bootstrap` input;
|
|
55
|
+
- workflow metadata and non-claims.
|
|
56
|
+
|
|
57
|
+
It builds:
|
|
58
|
+
|
|
59
|
+
- a repository profile scaffold plan;
|
|
60
|
+
- a bootstrap report and bootstrap materialization manifest;
|
|
61
|
+
- an adoption workflow input and workflow plan;
|
|
62
|
+
- one project-structure materialization manifest containing only dry-run file
|
|
63
|
+
entries.
|
|
64
|
+
|
|
65
|
+
The manifest may include starter JSON payloads for inputs and generated
|
|
66
|
+
starter records. Module specifications remain `caller_content_required`.
|
|
67
|
+
Repository profile content is a starter draft from the profile scaffold plan
|
|
68
|
+
and remains caller-reviewed, not authoritative.
|
|
69
|
+
|
|
70
|
+
## Rejected Alternatives
|
|
71
|
+
|
|
72
|
+
| Alternative | Rejection |
|
|
73
|
+
|---|---|
|
|
74
|
+
| Add file writes | File materialization requires conflict and overwrite policy owned by the consumer repository. |
|
|
75
|
+
| Fold this into bootstrap | Bootstrap owns one module's adoption payloads; it does not own repo-profile authoring or workflow input composition. |
|
|
76
|
+
| Fold this into workflow plan | Workflow plans own command routing, not payload construction or materialization review. |
|
|
77
|
+
| Embed product specification text | Product/module specs carry durable repository meaning and must be authored or reviewed by the consuming repository. |
|
|
78
|
+
| Infer paths from repository layout | Ambient discovery would make Proofkit a repository-state authority. |
|
|
79
|
+
|
|
80
|
+
## Proof Obligations
|
|
81
|
+
|
|
82
|
+
- Unit tests prove deterministic file entries, source report refs, stable
|
|
83
|
+
hashes, caller-owned gaps, path mismatch failures, and non-claims.
|
|
84
|
+
- CLI tests prove file input and stdin parity, stable JSON, and unsafe path
|
|
85
|
+
rejection.
|
|
86
|
+
- Package artifact tests prove the package binary, CLI smoke path, and design note
|
|
87
|
+
are shipped to outside consumers.
|
|
88
|
+
- Full package check proves existing profile, bootstrap, workflow, and package
|
|
89
|
+
artifact behavior remains compatible.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Proof Obligation Algebra Design
|
|
2
|
+
|
|
3
|
+
## Decision
|
|
4
|
+
|
|
5
|
+
Proofkit provides a `proof-obligation-algebra` primitive that validates
|
|
6
|
+
caller-provided proof obligation graph shape.
|
|
7
|
+
|
|
8
|
+
The primitive owns generic obligation operator grammar only:
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
atomic | all_of | any_of | conditional | deferred | waived_until
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
It does not execute witnesses, authenticate receipts, compute freshness, decide
|
|
15
|
+
proof satisfaction, or approve merge, release, rollout, or production readiness.
|
|
16
|
+
|
|
17
|
+
## Problem
|
|
18
|
+
|
|
19
|
+
Requirement proof bindings can describe direct witness routes, but large
|
|
20
|
+
requirements often need explicit composition:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
requirement
|
|
24
|
+
-> all required proof routes
|
|
25
|
+
-> one of several admitted alternatives
|
|
26
|
+
-> conditionally applicable proof routes
|
|
27
|
+
-> deferred or waived proof obligations that must stay visible
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If this composition stays in prose, agents and CI cannot reliably distinguish a
|
|
31
|
+
real proof route from an admitted deferral, a waiver, a missing child, or a
|
|
32
|
+
cross-requirement dependency.
|
|
33
|
+
|
|
34
|
+
The reusable layer is therefore:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
caller-owned obligation graph -> algebra admission -> deterministic graph report
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Boundary
|
|
41
|
+
|
|
42
|
+
Proofkit owns:
|
|
43
|
+
|
|
44
|
+
- exact input admission for obligation algebra records;
|
|
45
|
+
- operator-specific shape checks;
|
|
46
|
+
- cycle detection;
|
|
47
|
+
- unknown-child rejection;
|
|
48
|
+
- cross-requirement child checks that require explicit delegation refs;
|
|
49
|
+
- rejection of `deferred` or `waived_until` children as proof-bearing routes;
|
|
50
|
+
- deterministic report output, root ids, graph depth, and diagnostics.
|
|
51
|
+
|
|
52
|
+
The consuming repository owns:
|
|
53
|
+
|
|
54
|
+
- requirement meaning;
|
|
55
|
+
- proof-route content and adequacy;
|
|
56
|
+
- deferral and waiver policy;
|
|
57
|
+
- evidence authenticity;
|
|
58
|
+
- receipt freshness;
|
|
59
|
+
- native witness execution;
|
|
60
|
+
- merge, release, rollout, and production readiness decisions.
|
|
61
|
+
|
|
62
|
+
## Operator Rules
|
|
63
|
+
|
|
64
|
+
| Operator | Required | Forbidden |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| `atomic` | one or more `proofRouteRefs` | children, conditions, delegation refs, expiry, review condition |
|
|
67
|
+
| `all_of` | at least two `childObligationIds` | direct proof route refs, conditions, expiry, review condition |
|
|
68
|
+
| `any_of` | at least two `childObligationIds` | direct proof route refs, conditions, expiry, review condition |
|
|
69
|
+
| `conditional` | one or more children and one or more `conditionRefs` | direct proof route refs, expiry, review condition |
|
|
70
|
+
| `deferred` | evidence refs, expiry ref, review-condition ref | direct proof route refs, children, conditions, delegation refs |
|
|
71
|
+
| `waived_until` | evidence refs, expiry ref, review-condition ref | direct proof route refs, children, conditions, delegation refs |
|
|
72
|
+
|
|
73
|
+
`deferred` and `waived_until` require both `expiryRef` and
|
|
74
|
+
`reviewConditionRef`. This is a generic boundedness minimum, not a consumer
|
|
75
|
+
deferral policy: expiry bounds time, while review condition bounds the event
|
|
76
|
+
that reopens the obligation. Consumers still own the policy that decides whether
|
|
77
|
+
the deferral or waiver is acceptable.
|
|
78
|
+
|
|
79
|
+
## Invariants
|
|
80
|
+
|
|
81
|
+
- Every obligation id is stable, sorted, and unique.
|
|
82
|
+
- Every child obligation id must resolve inside the same caller-provided graph.
|
|
83
|
+
- Cycles fail the report.
|
|
84
|
+
- Cross-requirement child composition requires explicit `delegationRefs`.
|
|
85
|
+
- `deferred` and `waived_until` obligations are visible graph nodes, not
|
|
86
|
+
proof-bearing children.
|
|
87
|
+
- Input order and host locale do not affect output order or stable JSON.
|
|
88
|
+
|
|
89
|
+
## Rejected Alternatives
|
|
90
|
+
|
|
91
|
+
| Alternative | Rejection |
|
|
92
|
+
|---|---|
|
|
93
|
+
| Extend `requirement-bindings` in the same batch | The existing flat binding contract is already consumed by other reports; an additive primitive avoids behavior drift. |
|
|
94
|
+
| Put algebra into `obligation-decision` | That would mix pre-evidence proof structure with observed evidence state classification. |
|
|
95
|
+
| Let consumers express composition in prose only | Prose cannot fail closed on cycles, missing children, or deferred proof counted as proof. |
|
|
96
|
+
| Execute child proof routes from this primitive | Proofkit CLI must emit deterministic reports and plans only; native execution remains consumer-owned. |
|
|
97
|
+
| Let deferred obligations satisfy `any_of` alternatives | Deferral and waiver visibility is useful, but they are not proof-bearing routes. |
|
|
98
|
+
|
|
99
|
+
## Proof Obligations
|
|
100
|
+
|
|
101
|
+
- Unit tests prove admitted graph normalization, root detection, graph depth,
|
|
102
|
+
transitive child projection, deterministic JSON, and non-claim boundaries.
|
|
103
|
+
- Negative tests prove unary composites, non-proof-bearing proof children,
|
|
104
|
+
cross-requirement children without delegation, cycles, unknown children, and
|
|
105
|
+
malformed records fail closed.
|
|
106
|
+
- CLI tests prove file/stdin parity and unsupported presentation flags.
|
|
107
|
+
- Package artifact tests prove package binary, packed files, installed-bin behavior,
|
|
108
|
+
version, and published design note.
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Proof Receipt Admission Design
|
|
2
|
+
|
|
3
|
+
Status: accepted; implemented as a generic report primitive.
|
|
4
|
+
|
|
5
|
+
Owner: `proofkit`.
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
A proof command describes intended work. A command exit code is not enough to
|
|
10
|
+
decide whether a proof obligation is satisfied because it does not bind the run
|
|
11
|
+
to a proof plan, requirement binding, command digest, environment digest,
|
|
12
|
+
witness selectors, toolchain state, runner, producer, provenance, or artifact
|
|
13
|
+
hashes. This design adds a generic receipt-shape admission contract before
|
|
14
|
+
producer trust, freshness, and obligation-decision layers.
|
|
15
|
+
|
|
16
|
+
Formal goal:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
caller-owned observed receipt records
|
|
20
|
+
-> proofkit proof-receipt admission report
|
|
21
|
+
-> caller-owned producer admission, freshness, and obligation decision
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Authority Boundary
|
|
25
|
+
|
|
26
|
+
Proofkit owns:
|
|
27
|
+
|
|
28
|
+
- exact receipt schema admission;
|
|
29
|
+
- digest grammar;
|
|
30
|
+
- repository-relative evidence and artifact refs;
|
|
31
|
+
- timestamp ordering;
|
|
32
|
+
- status, exit-code, artifact, provenance-ref, and non-claim consistency;
|
|
33
|
+
- deterministic report output and boundary non-claims.
|
|
34
|
+
|
|
35
|
+
The consuming repository owns:
|
|
36
|
+
|
|
37
|
+
- producer authentication and attestation verification;
|
|
38
|
+
- producer admission policy;
|
|
39
|
+
- receipt freshness;
|
|
40
|
+
- command execution truth;
|
|
41
|
+
- current-obligation matching;
|
|
42
|
+
- merge, release, rollout, and production policy.
|
|
43
|
+
|
|
44
|
+
Formal rule:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
Proofkit can admit receipt shape and provenance fields.
|
|
48
|
+
Proofkit cannot prove that the producer is authentic, fresh, or merge-satisfying.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Model
|
|
52
|
+
|
|
53
|
+
Each receipt records:
|
|
54
|
+
|
|
55
|
+
- receipt identity and kind;
|
|
56
|
+
- source revision;
|
|
57
|
+
- proof plan id;
|
|
58
|
+
- proof-binding, command, environment, precondition, witness-selector,
|
|
59
|
+
toolchain, dependency, and lockfile digests;
|
|
60
|
+
- environment class;
|
|
61
|
+
- witness selectors;
|
|
62
|
+
- runner identity and class;
|
|
63
|
+
- producer id and producer admission class;
|
|
64
|
+
- optional provenance ref;
|
|
65
|
+
- start and finish timestamps;
|
|
66
|
+
- normalized status and exit code;
|
|
67
|
+
- evidence refs;
|
|
68
|
+
- artifact refs with kind, path, and sha256;
|
|
69
|
+
- proof-scope non-claims.
|
|
70
|
+
|
|
71
|
+
`merge_satisfying` receipts must include a provenance ref. This is only a
|
|
72
|
+
shape requirement: proofkit does not authenticate that provenance. Advisory
|
|
73
|
+
local receipts may omit provenance refs because consumers may still use them
|
|
74
|
+
for navigation and debugging.
|
|
75
|
+
|
|
76
|
+
## Rejected Alternatives
|
|
77
|
+
|
|
78
|
+
| Alternative | Rejection reason |
|
|
79
|
+
|---|---|
|
|
80
|
+
| Extend selective-gate evidence receipts directly | It would couple the generic receipt contract to one planner family and duplicate fields later. |
|
|
81
|
+
| Put producer authentication in this primitive | It would make proofkit a trust-root owner instead of a reusable validator. |
|
|
82
|
+
| Treat producer admission and receipt shape as one report | It would blur independent failure classes: malformed receipt vs non-admitted producer. |
|
|
83
|
+
| Compute freshness in receipt admission | Freshness depends on caller-owned invalidation rules, current obligations, dependency state, and producer policy. |
|
|
84
|
+
|
|
85
|
+
## Proof Obligations
|
|
86
|
+
|
|
87
|
+
- report builder test for deterministic valid receipt admission;
|
|
88
|
+
- negative tests for duplicate ids, malformed digests, unsafe paths, unsupported
|
|
89
|
+
fields, unsorted selectors, timestamp order, exit/status mismatch, missing
|
|
90
|
+
artifacts, missing blocked non-claims, and merge-satisfying receipt without
|
|
91
|
+
provenance;
|
|
92
|
+
- CLI test for `proof-receipt-admission`;
|
|
93
|
+
- package artifact test proving the primitive ships in the published package.
|
|
94
|
+
|
|
95
|
+
## Non-Claims
|
|
96
|
+
|
|
97
|
+
Proof receipt admission does not claim:
|
|
98
|
+
|
|
99
|
+
- producer authentication;
|
|
100
|
+
- producer policy admission;
|
|
101
|
+
- receipt freshness;
|
|
102
|
+
- native command execution;
|
|
103
|
+
- command result correctness;
|
|
104
|
+
- current-obligation matching;
|
|
105
|
+
- merge approval;
|
|
106
|
+
- release approval;
|
|
107
|
+
- rollout approval;
|
|
108
|
+
- production readiness.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Proofkit Contract Map
|
|
2
|
+
|
|
3
|
+
Status: maintained consumer routing surface.
|
|
4
|
+
|
|
5
|
+
Owner: `proofkit`.
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
This map helps consuming repositories choose the smallest Proofkit CLI command
|
|
10
|
+
or JSON contract without loading the full README or source tree. It is not an
|
|
11
|
+
exhaustive schema reference. The canonical command inventory is
|
|
12
|
+
`proofkit/cli-contract.v1.json`.
|
|
13
|
+
|
|
14
|
+
Formal rule:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
Contract map routes humans and agents.
|
|
18
|
+
CLI/JSON records own cross-language behavior.
|
|
19
|
+
Go packages implement the shipped executable.
|
|
20
|
+
Consumer repositories own product truth, local policy, and native witnesses.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Families
|
|
24
|
+
|
|
25
|
+
| Family | Main commands | Caller provides | Proofkit owns | Consumer owns | Output authority |
|
|
26
|
+
|---|---|---|---|---|---|
|
|
27
|
+
| Adoption and scaffolding | `adoption-workflow-plan`, `gradual-adoption`, `gradual-adoption-bootstrap`, `gradual-adoption-guidance`, `scaffold-profile-plan`, `scaffold-project-structure`, `stack-preset` | adoption intent, target paths, owner routes, stack preset id | deterministic starter plans, bounded guidance envelopes, dry-run manifests | final files, final requirements, rollout policy | plan or agent envelope |
|
|
28
|
+
| Requirement source | `requirement-source-admission`, `requirement-source-transition`, `spec-overview-claims`, `requirement-source-view`, `requirement-browser-server` | `requirements.v1.json`, overview claim extraction, view options | source-shape admission, lifecycle checks, presentation-only views | requirement meaning, Markdown extraction completeness, proof adequacy | source report or rendered view |
|
|
29
|
+
| Requirement proof binding | `requirement-bindings`, `proof-slice`, `evidence-graph`, `requirement-proof-resolver`, `requirement-proof-source-set`, `requirement-proof-view`, `spec-proof-bundle-admission` | requirement records, bindings, witness commands, source-set facts, receipt reports | graph validation, compact slices, resolver projections, bundle linkage checks | test semantics, witness execution, proof freshness, merge policy | proof report, slice, lookup graph, or view |
|
|
30
|
+
| Selective planning | `changed-path-set`, `impact`, `selective-gate-plan`, `selective-gate-evidence`, `selective-gate-obligation-decision-input`, `obligation-decision` | changed paths, impact facts, planned receipts, obligation routes | fail-closed planning, receipt comparison, bounded agent packets | git diff truth, command execution, producer trust, final admission | plan, evidence report, or obligation input |
|
|
31
|
+
| Receipts and producers | `proof-receipt-admission`, `receipt-producer-admission`, `receipt-currentness-scope`, `receipt-trust-class`, `producer-policy-self-proof` | receipt sets, producer policy, scope/currentness facts, trust classes | receipt shape, producer/receipt compatibility, self-proof diagnostics | producer authentication, freshness policy, CI trust roots | receipt/provenance report |
|
|
32
|
+
| Release and deployment | `release-authority`, `external-consumer`, `registry-consumer`, `deployment-evidence-admission`, `completion-criteria`, `branch-authority`, `readiness-closeout` | package facts, tarball/registry facts, deployment evidence, criteria, branch facts | artifact/channel boundary checks, release diagnostics, falsifiable criteria shape | package publication, registry fetch, deployment, rollback, approval | release/deployment/readiness report |
|
|
33
|
+
| Repository structure | `repo-profile-admission`, `workspace-registry`, `workspace-changed-package-plan`, `workspace-shard-partition`, `typescript-public-api-surfaces`, `package-runtime-dependency-admission` | explicit repo/profile facts and caller-owned roots | structural admission, workspace graph projections, TypeScript package public API checks, shard plans | repository freshness, command policy, package manager truth | structural or planning report |
|
|
34
|
+
| Custom and generated artifacts | `custom-rule-boundary`, `document-lifecycle-boundary`, `rendered-artifact-freshness`, `conformance-profile`, `witness-plan`, `witness-scheduler-plan` | custom rule metadata, document lifecycle records, artifact digests, profile manifests, command metadata | boundary checks, generated-view freshness shape, scheduler metadata checks | rule execution, document meaning, cache contents, CI scheduling | boundary or scheduler report |
|
|
35
|
+
|
|
36
|
+
## Routing Rules
|
|
37
|
+
|
|
38
|
+
1. Start from `proofkit/cli-contract.v1.json` when a machine needs the exact
|
|
39
|
+
command, flags, input mode, or output mode.
|
|
40
|
+
2. Start from this map when a human or agent only needs the correct command
|
|
41
|
+
family.
|
|
42
|
+
3. Use agent-envelope output only when a coding agent needs bounded context;
|
|
43
|
+
do not expand whole proof graphs into chat.
|
|
44
|
+
4. Treat generated views and rendered HTML as presentation only. They never
|
|
45
|
+
replace the structured source record.
|
|
46
|
+
5. Escalate to the consuming repository's owner policy whenever Proofkit reports
|
|
47
|
+
unknown scope, missing receipts, unavailable preconditions, or command
|
|
48
|
+
execution requirements.
|
|
49
|
+
|
|
50
|
+
## Omitted Surfaces
|
|
51
|
+
|
|
52
|
+
This map intentionally omits exhaustive per-field schema documentation,
|
|
53
|
+
generated view instances, generated graph instances, receipt instances, and
|
|
54
|
+
language-specific wrapper APIs. Those surfaces are either generated on demand,
|
|
55
|
+
owned by the caller, or derived from the CLI/JSON contracts.
|