problem-frame-gate 0.3.0__tar.gz → 1.0.0__tar.gz
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.
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/.gitignore +1 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/CITATION.cff +1 -1
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/PKG-INFO +69 -13
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/README.md +66 -11
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/SECURITY.md +2 -0
- problem_frame_gate-1.0.0/docs/examples/gate-request.json +39 -0
- problem_frame_gate-1.0.0/docs/examples/horizon.json +100 -0
- problem_frame_gate-1.0.0/docs/examples/log.json +184 -0
- problem_frame_gate-1.0.0/docs/issue-codes.md +25 -0
- problem_frame_gate-1.0.0/docs/operations.md +44 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/docs/pypi-release.md +2 -2
- problem_frame_gate-1.0.0/docs/quickstart.md +66 -0
- problem_frame_gate-1.0.0/docs/schema.md +62 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/docs/theory-mapping.md +25 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/examples/ai_agent_gate.py +49 -2
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/pyproject.toml +5 -3
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/schemas/envelope-log.schema.json +8 -4
- problem_frame_gate-1.0.0/schemas/gate-bundle.schema.json +77 -0
- problem_frame_gate-1.0.0/schemas/gate-request.schema.json +99 -0
- problem_frame_gate-1.0.0/schemas/horizon.schema.json +76 -0
- problem_frame_gate-1.0.0/schemas/join-proposal.schema.json +43 -0
- problem_frame_gate-1.0.0/schemas/patch-proposal.schema.json +50 -0
- problem_frame_gate-1.0.0/schemas/reachability.schema.json +38 -0
- problem_frame_gate-1.0.0/schemas/replay-certificate.schema.json +38 -0
- problem_frame_gate-1.0.0/schemas/risk-claim.schema.json +47 -0
- problem_frame_gate-1.0.0/schemas/source-cut.schema.json +25 -0
- problem_frame_gate-1.0.0/scripts/generate_sbom.py +53 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/__init__.py +16 -3
- problem_frame_gate-1.0.0/src/problem_frame_gate/_version.py +1 -0
- problem_frame_gate-1.0.0/src/problem_frame_gate/certificates.py +266 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/cli.py +23 -45
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/gate.py +190 -11
- problem_frame_gate-1.0.0/src/problem_frame_gate/join.py +309 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/model.py +2 -0
- problem_frame_gate-1.0.0/src/problem_frame_gate/patch.py +424 -0
- problem_frame_gate-1.0.0/src/problem_frame_gate/records.py +581 -0
- problem_frame_gate-1.0.0/src/problem_frame_gate/risk.py +418 -0
- problem_frame_gate-1.0.0/src/problem_frame_gate/schema.py +611 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/verifier.py +241 -2
- problem_frame_gate-1.0.0/tests/test_docs_examples.py +28 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/tests/test_formation_risk_cli.py +36 -1
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/tests/test_gate_patch_join.py +45 -1
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/tests/test_public_api_edges.py +53 -11
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/tests/test_records_and_strictness.py +125 -8
- problem_frame_gate-1.0.0/tests/test_v1_completion.py +979 -0
- problem_frame_gate-0.3.0/docs/operations.md +0 -24
- problem_frame_gate-0.3.0/docs/quickstart.md +0 -32
- problem_frame_gate-0.3.0/docs/schema.md +0 -10
- problem_frame_gate-0.3.0/schemas/gate-request.schema.json +0 -36
- problem_frame_gate-0.3.0/schemas/horizon.schema.json +0 -41
- problem_frame_gate-0.3.0/src/problem_frame_gate/_version.py +0 -1
- problem_frame_gate-0.3.0/src/problem_frame_gate/certificates.py +0 -116
- problem_frame_gate-0.3.0/src/problem_frame_gate/join.py +0 -150
- problem_frame_gate-0.3.0/src/problem_frame_gate/patch.py +0 -191
- problem_frame_gate-0.3.0/src/problem_frame_gate/records.py +0 -210
- problem_frame_gate-0.3.0/src/problem_frame_gate/risk.py +0 -203
- problem_frame_gate-0.3.0/tests/test_docs_examples.py +0 -14
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/LICENSE +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/NOTICE +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/docs/ai-agent-quickstart.md +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/docs/json-format.md +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/docs/security.md +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/digest.py +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/errors.py +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/fold.py +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/formation.py +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/py.typed +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/result.py +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/src/problem_frame_gate/security.py +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/tests/test_digest_security.py +0 -0
- {problem_frame_gate-0.3.0 → problem_frame_gate-1.0.0}/tests/test_verifier.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
cff-version: 1.2.0
|
|
2
2
|
message: "If you use this software, cite the theory paper and this repository."
|
|
3
3
|
title: "Problem Frame Gate"
|
|
4
|
-
version: "0.
|
|
4
|
+
version: "1.0.0"
|
|
5
5
|
license: Apache-2.0
|
|
6
6
|
repository-code: "https://github.com/kadubon/problem-frame-gate"
|
|
7
7
|
references:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: problem-frame-gate
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Audit logs and action gates for safer AI agents.
|
|
5
5
|
Project-URL: Homepage, https://github.com/kadubon/problem-frame-gate
|
|
6
6
|
Project-URL: Documentation, https://github.com/kadubon/problem-frame-gate/tree/main/docs
|
|
@@ -11,7 +11,7 @@ License-Expression: Apache-2.0
|
|
|
11
11
|
License-File: LICENSE
|
|
12
12
|
License-File: NOTICE
|
|
13
13
|
Keywords: ai,ai-agents,audit-log,authorization,open-source,provenance,pypi,python,risk-management,security
|
|
14
|
-
Classifier: Development Status ::
|
|
14
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
15
15
|
Classifier: Intended Audience :: Developers
|
|
16
16
|
Classifier: Intended Audience :: Science/Research
|
|
17
17
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
25
|
Classifier: Topic :: Security
|
|
25
26
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
27
|
Classifier: Typing :: Typed
|
|
@@ -71,20 +72,21 @@ Create a strict manifest:
|
|
|
71
72
|
pfg init-manifest > horizon.json
|
|
72
73
|
```
|
|
73
74
|
|
|
74
|
-
Validate and fold a log
|
|
75
|
+
Validate and fold a log. The repository contains complete copy-paste JSON
|
|
76
|
+
fixtures in `docs/examples/`:
|
|
75
77
|
|
|
76
78
|
```bash
|
|
77
|
-
pfg validate-schema horizon horizon.json
|
|
78
|
-
pfg validate-schema log log.json
|
|
79
|
-
pfg verify-log --horizon horizon.json log.json
|
|
80
|
-
pfg fold --horizon horizon.json log.json
|
|
79
|
+
pfg validate-schema horizon docs/examples/horizon.json
|
|
80
|
+
pfg validate-schema log docs/examples/log.json
|
|
81
|
+
pfg verify-log --horizon docs/examples/horizon.json docs/examples/log.json
|
|
82
|
+
pfg fold --horizon docs/examples/horizon.json docs/examples/log.json
|
|
81
83
|
```
|
|
82
84
|
|
|
83
85
|
Check an action gate and emit the atomic bundle:
|
|
84
86
|
|
|
85
87
|
```bash
|
|
86
|
-
pfg validate-schema gate-request gate-request.json
|
|
87
|
-
pfg check-gate --horizon horizon.json --bundle gate-request.json log.json
|
|
88
|
+
pfg validate-schema gate-request docs/examples/gate-request.json
|
|
89
|
+
pfg check-gate --horizon docs/examples/horizon.json --bundle docs/examples/gate-request.json docs/examples/log.json
|
|
88
90
|
```
|
|
89
91
|
|
|
90
92
|
The generated bundle contains exactly five protected rows:
|
|
@@ -98,21 +100,45 @@ The generated bundle contains exactly five protected rows:
|
|
|
98
100
|
Each row must be written by the executor writer and committed in one atomic
|
|
99
101
|
group. A standalone `OutboxClaim` is rejected.
|
|
100
102
|
|
|
103
|
+
For a new project, copy the three JSON files from `docs/examples/`, then change
|
|
104
|
+
the writer ids, certificate issuers, frame id, action name, risk id, and resource
|
|
105
|
+
ids to match your deployment.
|
|
106
|
+
|
|
101
107
|
## Python Example
|
|
102
108
|
|
|
103
109
|
```python
|
|
104
|
-
from problem_frame_gate import
|
|
110
|
+
from problem_frame_gate import (
|
|
111
|
+
Envelope,
|
|
112
|
+
EnvelopeClass,
|
|
113
|
+
ExecutorGate,
|
|
114
|
+
GateRequest,
|
|
115
|
+
Horizon,
|
|
116
|
+
RiskClaimRecord,
|
|
117
|
+
RiskRouteWitness,
|
|
118
|
+
digest_json,
|
|
119
|
+
)
|
|
105
120
|
|
|
106
121
|
horizon = Horizon.strict_default(agent_writers=("agent",))
|
|
107
122
|
|
|
108
123
|
def env(eid: str, commit: int, kind: str, **payload: object) -> Envelope:
|
|
109
124
|
return Envelope(eid, eid, "0", commit, "agent", "agent", 1, EnvelopeClass.NORMAL, {"kind": kind, **payload})
|
|
110
125
|
|
|
126
|
+
family_check = {
|
|
127
|
+
"accepted": True,
|
|
128
|
+
"checker": "example-certificate-family-v1",
|
|
129
|
+
"transcript_digest": digest_json({"checker": "example-certificate-family-v1", "accepted": True}),
|
|
130
|
+
"dependency_digest": digest_json({"dependencies": [], "source_ids": []}),
|
|
131
|
+
"revocation_frontier": [],
|
|
132
|
+
"checked_at": 2,
|
|
133
|
+
"assumption": "CertificateFamilyChecker",
|
|
134
|
+
}
|
|
135
|
+
|
|
111
136
|
log = [
|
|
112
137
|
env("e0", 0, "Frame", frame_id="p1", scope="lab", goal="test anomaly",
|
|
113
138
|
evidence_ids=["u1"], actions=["run-check"], acceptance=["review"], risk_ids=["r1"]),
|
|
114
139
|
env("e1", 1, "Evidence", evidence_id="u1", digest="sha256:source"),
|
|
115
|
-
env("e2", 2, "Issue", cert_id="c-risk", family="risk", issuer="agent",
|
|
140
|
+
env("e2", 2, "Issue", cert_id="c-risk", family="risk", issuer="agent",
|
|
141
|
+
expires_at=99, family_check=family_check),
|
|
116
142
|
env("e3", 3, "Activated", frame_id="p1"),
|
|
117
143
|
env("e4", 4, "RiskReg", hypothesis_id="h1", family="fixed"),
|
|
118
144
|
env("e5", 5, "RiskReserve", risk_id="r1", hypothesis_id="h1", frame_id="p1", eta="1/100"),
|
|
@@ -123,11 +149,28 @@ log = [
|
|
|
123
149
|
env("e9", 9, "AuthorizeOutbox", outbox_id="out1", frame_id="p1", action="run-check"),
|
|
124
150
|
]
|
|
125
151
|
|
|
152
|
+
risk_claim = RiskClaimRecord(
|
|
153
|
+
claim_id="q1",
|
|
154
|
+
risk_id="r1",
|
|
155
|
+
hypothesis_id="h1",
|
|
156
|
+
mode="fixed",
|
|
157
|
+
cert_id="c-risk",
|
|
158
|
+
eta="1/100",
|
|
159
|
+
event_id="F1",
|
|
160
|
+
standardized_event_id="F1",
|
|
161
|
+
route_witness=RiskRouteWitness(
|
|
162
|
+
accepted=True,
|
|
163
|
+
checker="example-risk-route-v1",
|
|
164
|
+
transcript_digest=digest_json({"checker": "example-risk-route-v1", "mode": "fixed"}),
|
|
165
|
+
route="fixed",
|
|
166
|
+
),
|
|
167
|
+
)
|
|
168
|
+
|
|
126
169
|
request = GateRequest(
|
|
127
170
|
gate_id="gate1", bundle_id="bundle1", frame_id="p1", action="run-check",
|
|
128
171
|
outbox_id="out1", capability_id="cap1", lease_id="lease1",
|
|
129
172
|
risk_id="r1", hypothesis_id="h1", risk_mode="fixed", risk_cert_id="c-risk",
|
|
130
|
-
source_time=9, commit_time=10,
|
|
173
|
+
source_time=9, commit_time=10, risk_claim=risk_claim.to_json(), risk_alpha="1/50",
|
|
131
174
|
)
|
|
132
175
|
|
|
133
176
|
gate = ExecutorGate()
|
|
@@ -142,8 +185,21 @@ The library proves finite audit consistency. It does not prove external truth,
|
|
|
142
185
|
cryptographic collision resistance, statistical model validity, or physical
|
|
143
186
|
effect. Those are explicit assumptions in checker results.
|
|
144
187
|
|
|
188
|
+
Strict certificates require a finite family-check record with a checker name,
|
|
189
|
+
transcript digest, dependency digest, revocation frontier, and check time.
|
|
190
|
+
Boolean certificate flags are treated as legacy assumptions and fail strict
|
|
191
|
+
v1.0.0 checks.
|
|
192
|
+
|
|
193
|
+
There are two verification routes:
|
|
194
|
+
|
|
195
|
+
- JSON-only use relies on manifest-declared environment assumptions such as
|
|
196
|
+
`CertificateFamilyChecker` and `StatisticalModel`.
|
|
197
|
+
- Python deployments can register callable `CertificateFamily` and `RiskMode`
|
|
198
|
+
checkers. The verifier reuses those registries when replaying embedded
|
|
199
|
+
`GateCheck` transcripts.
|
|
200
|
+
|
|
145
201
|
See `docs/quickstart.md`, `docs/schema.md`, `docs/theory-mapping.md`, and
|
|
146
|
-
`docs/
|
|
202
|
+
`docs/issue-codes.md` for operational use.
|
|
147
203
|
|
|
148
204
|
## Release
|
|
149
205
|
|
|
@@ -34,20 +34,21 @@ Create a strict manifest:
|
|
|
34
34
|
pfg init-manifest > horizon.json
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
Validate and fold a log
|
|
37
|
+
Validate and fold a log. The repository contains complete copy-paste JSON
|
|
38
|
+
fixtures in `docs/examples/`:
|
|
38
39
|
|
|
39
40
|
```bash
|
|
40
|
-
pfg validate-schema horizon horizon.json
|
|
41
|
-
pfg validate-schema log log.json
|
|
42
|
-
pfg verify-log --horizon horizon.json log.json
|
|
43
|
-
pfg fold --horizon horizon.json log.json
|
|
41
|
+
pfg validate-schema horizon docs/examples/horizon.json
|
|
42
|
+
pfg validate-schema log docs/examples/log.json
|
|
43
|
+
pfg verify-log --horizon docs/examples/horizon.json docs/examples/log.json
|
|
44
|
+
pfg fold --horizon docs/examples/horizon.json docs/examples/log.json
|
|
44
45
|
```
|
|
45
46
|
|
|
46
47
|
Check an action gate and emit the atomic bundle:
|
|
47
48
|
|
|
48
49
|
```bash
|
|
49
|
-
pfg validate-schema gate-request gate-request.json
|
|
50
|
-
pfg check-gate --horizon horizon.json --bundle gate-request.json log.json
|
|
50
|
+
pfg validate-schema gate-request docs/examples/gate-request.json
|
|
51
|
+
pfg check-gate --horizon docs/examples/horizon.json --bundle docs/examples/gate-request.json docs/examples/log.json
|
|
51
52
|
```
|
|
52
53
|
|
|
53
54
|
The generated bundle contains exactly five protected rows:
|
|
@@ -61,21 +62,45 @@ The generated bundle contains exactly five protected rows:
|
|
|
61
62
|
Each row must be written by the executor writer and committed in one atomic
|
|
62
63
|
group. A standalone `OutboxClaim` is rejected.
|
|
63
64
|
|
|
65
|
+
For a new project, copy the three JSON files from `docs/examples/`, then change
|
|
66
|
+
the writer ids, certificate issuers, frame id, action name, risk id, and resource
|
|
67
|
+
ids to match your deployment.
|
|
68
|
+
|
|
64
69
|
## Python Example
|
|
65
70
|
|
|
66
71
|
```python
|
|
67
|
-
from problem_frame_gate import
|
|
72
|
+
from problem_frame_gate import (
|
|
73
|
+
Envelope,
|
|
74
|
+
EnvelopeClass,
|
|
75
|
+
ExecutorGate,
|
|
76
|
+
GateRequest,
|
|
77
|
+
Horizon,
|
|
78
|
+
RiskClaimRecord,
|
|
79
|
+
RiskRouteWitness,
|
|
80
|
+
digest_json,
|
|
81
|
+
)
|
|
68
82
|
|
|
69
83
|
horizon = Horizon.strict_default(agent_writers=("agent",))
|
|
70
84
|
|
|
71
85
|
def env(eid: str, commit: int, kind: str, **payload: object) -> Envelope:
|
|
72
86
|
return Envelope(eid, eid, "0", commit, "agent", "agent", 1, EnvelopeClass.NORMAL, {"kind": kind, **payload})
|
|
73
87
|
|
|
88
|
+
family_check = {
|
|
89
|
+
"accepted": True,
|
|
90
|
+
"checker": "example-certificate-family-v1",
|
|
91
|
+
"transcript_digest": digest_json({"checker": "example-certificate-family-v1", "accepted": True}),
|
|
92
|
+
"dependency_digest": digest_json({"dependencies": [], "source_ids": []}),
|
|
93
|
+
"revocation_frontier": [],
|
|
94
|
+
"checked_at": 2,
|
|
95
|
+
"assumption": "CertificateFamilyChecker",
|
|
96
|
+
}
|
|
97
|
+
|
|
74
98
|
log = [
|
|
75
99
|
env("e0", 0, "Frame", frame_id="p1", scope="lab", goal="test anomaly",
|
|
76
100
|
evidence_ids=["u1"], actions=["run-check"], acceptance=["review"], risk_ids=["r1"]),
|
|
77
101
|
env("e1", 1, "Evidence", evidence_id="u1", digest="sha256:source"),
|
|
78
|
-
env("e2", 2, "Issue", cert_id="c-risk", family="risk", issuer="agent",
|
|
102
|
+
env("e2", 2, "Issue", cert_id="c-risk", family="risk", issuer="agent",
|
|
103
|
+
expires_at=99, family_check=family_check),
|
|
79
104
|
env("e3", 3, "Activated", frame_id="p1"),
|
|
80
105
|
env("e4", 4, "RiskReg", hypothesis_id="h1", family="fixed"),
|
|
81
106
|
env("e5", 5, "RiskReserve", risk_id="r1", hypothesis_id="h1", frame_id="p1", eta="1/100"),
|
|
@@ -86,11 +111,28 @@ log = [
|
|
|
86
111
|
env("e9", 9, "AuthorizeOutbox", outbox_id="out1", frame_id="p1", action="run-check"),
|
|
87
112
|
]
|
|
88
113
|
|
|
114
|
+
risk_claim = RiskClaimRecord(
|
|
115
|
+
claim_id="q1",
|
|
116
|
+
risk_id="r1",
|
|
117
|
+
hypothesis_id="h1",
|
|
118
|
+
mode="fixed",
|
|
119
|
+
cert_id="c-risk",
|
|
120
|
+
eta="1/100",
|
|
121
|
+
event_id="F1",
|
|
122
|
+
standardized_event_id="F1",
|
|
123
|
+
route_witness=RiskRouteWitness(
|
|
124
|
+
accepted=True,
|
|
125
|
+
checker="example-risk-route-v1",
|
|
126
|
+
transcript_digest=digest_json({"checker": "example-risk-route-v1", "mode": "fixed"}),
|
|
127
|
+
route="fixed",
|
|
128
|
+
),
|
|
129
|
+
)
|
|
130
|
+
|
|
89
131
|
request = GateRequest(
|
|
90
132
|
gate_id="gate1", bundle_id="bundle1", frame_id="p1", action="run-check",
|
|
91
133
|
outbox_id="out1", capability_id="cap1", lease_id="lease1",
|
|
92
134
|
risk_id="r1", hypothesis_id="h1", risk_mode="fixed", risk_cert_id="c-risk",
|
|
93
|
-
source_time=9, commit_time=10,
|
|
135
|
+
source_time=9, commit_time=10, risk_claim=risk_claim.to_json(), risk_alpha="1/50",
|
|
94
136
|
)
|
|
95
137
|
|
|
96
138
|
gate = ExecutorGate()
|
|
@@ -105,8 +147,21 @@ The library proves finite audit consistency. It does not prove external truth,
|
|
|
105
147
|
cryptographic collision resistance, statistical model validity, or physical
|
|
106
148
|
effect. Those are explicit assumptions in checker results.
|
|
107
149
|
|
|
150
|
+
Strict certificates require a finite family-check record with a checker name,
|
|
151
|
+
transcript digest, dependency digest, revocation frontier, and check time.
|
|
152
|
+
Boolean certificate flags are treated as legacy assumptions and fail strict
|
|
153
|
+
v1.0.0 checks.
|
|
154
|
+
|
|
155
|
+
There are two verification routes:
|
|
156
|
+
|
|
157
|
+
- JSON-only use relies on manifest-declared environment assumptions such as
|
|
158
|
+
`CertificateFamilyChecker` and `StatisticalModel`.
|
|
159
|
+
- Python deployments can register callable `CertificateFamily` and `RiskMode`
|
|
160
|
+
checkers. The verifier reuses those registries when replaying embedded
|
|
161
|
+
`GateCheck` transcripts.
|
|
162
|
+
|
|
108
163
|
See `docs/quickstart.md`, `docs/schema.md`, `docs/theory-mapping.md`, and
|
|
109
|
-
`docs/
|
|
164
|
+
`docs/issue-codes.md` for operational use.
|
|
110
165
|
|
|
111
166
|
## Release
|
|
112
167
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"action": "run-check",
|
|
3
|
+
"bundle_id": "bundle1",
|
|
4
|
+
"capability_id": "cap1",
|
|
5
|
+
"commit_time": 10,
|
|
6
|
+
"frame_id": "p1",
|
|
7
|
+
"gate_id": "gate1",
|
|
8
|
+
"hypothesis_id": "h1",
|
|
9
|
+
"lease_id": "lease1",
|
|
10
|
+
"outbox_id": "out1",
|
|
11
|
+
"risk_alpha": "1/50",
|
|
12
|
+
"risk_cert_id": "c-risk",
|
|
13
|
+
"risk_claim": {
|
|
14
|
+
"assumption": "StatisticalModel",
|
|
15
|
+
"cert_id": "c-risk",
|
|
16
|
+
"claim_id": "q1",
|
|
17
|
+
"eta": "1/100",
|
|
18
|
+
"event_id": "F1",
|
|
19
|
+
"hypothesis_id": "h1",
|
|
20
|
+
"ledger_digest": null,
|
|
21
|
+
"mode": "fixed",
|
|
22
|
+
"risk_id": "r1",
|
|
23
|
+
"route_witness": {
|
|
24
|
+
"accepted": true,
|
|
25
|
+
"assumption": "StatisticalModel",
|
|
26
|
+
"checker": "example-risk-route-v1",
|
|
27
|
+
"route": "fixed",
|
|
28
|
+
"spend_before_selection": true,
|
|
29
|
+
"transcript_digest": "sha256:2dec4bbd2ff232e51a06953bc9bcbeedaa0b7ce22f74e6a10df924cb50343169"
|
|
30
|
+
},
|
|
31
|
+
"selection_event_id": null,
|
|
32
|
+
"selection_time": null,
|
|
33
|
+
"standardized_event_id": "F1",
|
|
34
|
+
"stopping_time_id": null
|
|
35
|
+
},
|
|
36
|
+
"risk_id": "r1",
|
|
37
|
+
"risk_mode": "fixed",
|
|
38
|
+
"source_time": 9
|
|
39
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"allow_local_paths": false,
|
|
3
|
+
"audit_order": [],
|
|
4
|
+
"availability_order": [],
|
|
5
|
+
"capacities": {
|
|
6
|
+
"abort": 100,
|
|
7
|
+
"failClosed": 10,
|
|
8
|
+
"normal": 100
|
|
9
|
+
},
|
|
10
|
+
"causal_order": [],
|
|
11
|
+
"certificate_families": {
|
|
12
|
+
"approval": [
|
|
13
|
+
"agent"
|
|
14
|
+
],
|
|
15
|
+
"formation": [
|
|
16
|
+
"agent"
|
|
17
|
+
],
|
|
18
|
+
"risk": [
|
|
19
|
+
"agent"
|
|
20
|
+
],
|
|
21
|
+
"safety": [
|
|
22
|
+
"agent"
|
|
23
|
+
],
|
|
24
|
+
"source": [
|
|
25
|
+
"agent"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"clock_policy": "integer-commit-time",
|
|
29
|
+
"codebook": [
|
|
30
|
+
"fixed",
|
|
31
|
+
"selectedEvent",
|
|
32
|
+
"conditionalSelective",
|
|
33
|
+
"anytime"
|
|
34
|
+
],
|
|
35
|
+
"commit_groups": {},
|
|
36
|
+
"env_assumptions": [
|
|
37
|
+
"CertificateFamilyChecker",
|
|
38
|
+
"StatisticalModel"
|
|
39
|
+
],
|
|
40
|
+
"events": [],
|
|
41
|
+
"executor_writer": "executor-gate",
|
|
42
|
+
"gate_bundle_kinds": [
|
|
43
|
+
"GateCheck",
|
|
44
|
+
"OutboxClaim",
|
|
45
|
+
"UseCap",
|
|
46
|
+
"ConsumeResource",
|
|
47
|
+
"RiskClose"
|
|
48
|
+
],
|
|
49
|
+
"protected_constructors": {
|
|
50
|
+
"ConsumeResource": [
|
|
51
|
+
"executor-gate"
|
|
52
|
+
],
|
|
53
|
+
"GateCheck": [
|
|
54
|
+
"executor-gate"
|
|
55
|
+
],
|
|
56
|
+
"OutboxClaim": [
|
|
57
|
+
"executor-gate"
|
|
58
|
+
],
|
|
59
|
+
"RiskClose": [
|
|
60
|
+
"executor-gate"
|
|
61
|
+
],
|
|
62
|
+
"UseCap": [
|
|
63
|
+
"executor-gate"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"risk_modes": [
|
|
67
|
+
"fixed",
|
|
68
|
+
"selectedEvent",
|
|
69
|
+
"conditionalSelective",
|
|
70
|
+
"anytime"
|
|
71
|
+
],
|
|
72
|
+
"strict": true,
|
|
73
|
+
"version_intervals": {
|
|
74
|
+
"*": {
|
|
75
|
+
"maximum": 1,
|
|
76
|
+
"minimum": 1
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"writer_authority": {
|
|
80
|
+
"*": [
|
|
81
|
+
"agent",
|
|
82
|
+
"executor-gate"
|
|
83
|
+
],
|
|
84
|
+
"ConsumeResource": [
|
|
85
|
+
"executor-gate"
|
|
86
|
+
],
|
|
87
|
+
"GateCheck": [
|
|
88
|
+
"executor-gate"
|
|
89
|
+
],
|
|
90
|
+
"OutboxClaim": [
|
|
91
|
+
"executor-gate"
|
|
92
|
+
],
|
|
93
|
+
"RiskClose": [
|
|
94
|
+
"executor-gate"
|
|
95
|
+
],
|
|
96
|
+
"UseCap": [
|
|
97
|
+
"executor-gate"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"class": "normal",
|
|
4
|
+
"commit": 0,
|
|
5
|
+
"eid": "e0",
|
|
6
|
+
"event": "e0",
|
|
7
|
+
"owner": "agent",
|
|
8
|
+
"payload": {
|
|
9
|
+
"acceptance": [
|
|
10
|
+
"human-review"
|
|
11
|
+
],
|
|
12
|
+
"actions": [
|
|
13
|
+
"run-check"
|
|
14
|
+
],
|
|
15
|
+
"evidence_ids": [
|
|
16
|
+
"u1"
|
|
17
|
+
],
|
|
18
|
+
"frame_id": "p1",
|
|
19
|
+
"goal": "investigate a bounded anomaly",
|
|
20
|
+
"kind": "Frame",
|
|
21
|
+
"risk_ids": [
|
|
22
|
+
"r1"
|
|
23
|
+
],
|
|
24
|
+
"scope": "agent-demo"
|
|
25
|
+
},
|
|
26
|
+
"slot": "0",
|
|
27
|
+
"version": 1,
|
|
28
|
+
"writer": "agent"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"class": "normal",
|
|
32
|
+
"commit": 1,
|
|
33
|
+
"eid": "e1",
|
|
34
|
+
"event": "e1",
|
|
35
|
+
"owner": "agent",
|
|
36
|
+
"payload": {
|
|
37
|
+
"digest": "sha256:source",
|
|
38
|
+
"evidence_id": "u1",
|
|
39
|
+
"kind": "Evidence"
|
|
40
|
+
},
|
|
41
|
+
"slot": "0",
|
|
42
|
+
"version": 1,
|
|
43
|
+
"writer": "agent"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"class": "normal",
|
|
47
|
+
"commit": 2,
|
|
48
|
+
"eid": "e2",
|
|
49
|
+
"event": "e2",
|
|
50
|
+
"owner": "agent",
|
|
51
|
+
"payload": {
|
|
52
|
+
"cert_id": "c-risk",
|
|
53
|
+
"expires_at": 99,
|
|
54
|
+
"family": "risk",
|
|
55
|
+
"family_check": {
|
|
56
|
+
"accepted": true,
|
|
57
|
+
"assumption": "CertificateFamilyChecker",
|
|
58
|
+
"checked_at": 2,
|
|
59
|
+
"checker": "example-certificate-family-v1",
|
|
60
|
+
"dependency_digest": "sha256:6dc416ab067f207d6c485f2dc657efb8587b03e29676982cdc9d239a627564f2",
|
|
61
|
+
"revocation_frontier": [],
|
|
62
|
+
"transcript_digest": "sha256:c6eb3ce40abe6b7d35e77c5494d579d7de737871da0c5be57aa1fa6a4f323b51"
|
|
63
|
+
},
|
|
64
|
+
"issuer": "agent",
|
|
65
|
+
"kind": "Issue"
|
|
66
|
+
},
|
|
67
|
+
"slot": "0",
|
|
68
|
+
"version": 1,
|
|
69
|
+
"writer": "agent"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"class": "normal",
|
|
73
|
+
"commit": 3,
|
|
74
|
+
"eid": "e3",
|
|
75
|
+
"event": "e3",
|
|
76
|
+
"owner": "agent",
|
|
77
|
+
"payload": {
|
|
78
|
+
"frame_id": "p1",
|
|
79
|
+
"kind": "Activated"
|
|
80
|
+
},
|
|
81
|
+
"slot": "0",
|
|
82
|
+
"version": 1,
|
|
83
|
+
"writer": "agent"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"class": "normal",
|
|
87
|
+
"commit": 4,
|
|
88
|
+
"eid": "e4",
|
|
89
|
+
"event": "e4",
|
|
90
|
+
"owner": "agent",
|
|
91
|
+
"payload": {
|
|
92
|
+
"family": "fixed",
|
|
93
|
+
"hypothesis_id": "h1",
|
|
94
|
+
"kind": "RiskReg"
|
|
95
|
+
},
|
|
96
|
+
"slot": "0",
|
|
97
|
+
"version": 1,
|
|
98
|
+
"writer": "agent"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"class": "normal",
|
|
102
|
+
"commit": 5,
|
|
103
|
+
"eid": "e5",
|
|
104
|
+
"event": "e5",
|
|
105
|
+
"owner": "agent",
|
|
106
|
+
"payload": {
|
|
107
|
+
"eta": "1/100",
|
|
108
|
+
"frame_id": "p1",
|
|
109
|
+
"hypothesis_id": "h1",
|
|
110
|
+
"kind": "RiskReserve",
|
|
111
|
+
"risk_id": "r1"
|
|
112
|
+
},
|
|
113
|
+
"slot": "0",
|
|
114
|
+
"version": 1,
|
|
115
|
+
"writer": "agent"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"class": "normal",
|
|
119
|
+
"commit": 6,
|
|
120
|
+
"eid": "e6",
|
|
121
|
+
"event": "e6",
|
|
122
|
+
"owner": "agent",
|
|
123
|
+
"payload": {
|
|
124
|
+
"cert_id": "c-risk",
|
|
125
|
+
"eta": "1/100",
|
|
126
|
+
"frame_id": "p1",
|
|
127
|
+
"hypothesis_id": "h1",
|
|
128
|
+
"kind": "RiskSpend",
|
|
129
|
+
"mode": "fixed",
|
|
130
|
+
"risk_id": "r1"
|
|
131
|
+
},
|
|
132
|
+
"slot": "0",
|
|
133
|
+
"version": 1,
|
|
134
|
+
"writer": "agent"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"class": "normal",
|
|
138
|
+
"commit": 7,
|
|
139
|
+
"eid": "e7",
|
|
140
|
+
"event": "e7",
|
|
141
|
+
"owner": "agent",
|
|
142
|
+
"payload": {
|
|
143
|
+
"frame_id": "p1",
|
|
144
|
+
"kind": "ReserveResource",
|
|
145
|
+
"lease_id": "lease1",
|
|
146
|
+
"token_id": "tool"
|
|
147
|
+
},
|
|
148
|
+
"slot": "0",
|
|
149
|
+
"version": 1,
|
|
150
|
+
"writer": "agent"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"class": "normal",
|
|
154
|
+
"commit": 8,
|
|
155
|
+
"eid": "e8",
|
|
156
|
+
"event": "e8",
|
|
157
|
+
"owner": "agent",
|
|
158
|
+
"payload": {
|
|
159
|
+
"action": "run-check",
|
|
160
|
+
"capability_id": "cap1",
|
|
161
|
+
"frame_id": "p1",
|
|
162
|
+
"kind": "MintCap"
|
|
163
|
+
},
|
|
164
|
+
"slot": "0",
|
|
165
|
+
"version": 1,
|
|
166
|
+
"writer": "agent"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"class": "normal",
|
|
170
|
+
"commit": 9,
|
|
171
|
+
"eid": "e9",
|
|
172
|
+
"event": "e9",
|
|
173
|
+
"owner": "agent",
|
|
174
|
+
"payload": {
|
|
175
|
+
"action": "run-check",
|
|
176
|
+
"frame_id": "p1",
|
|
177
|
+
"kind": "AuthorizeOutbox",
|
|
178
|
+
"outbox_id": "out1"
|
|
179
|
+
},
|
|
180
|
+
"slot": "0",
|
|
181
|
+
"version": 1,
|
|
182
|
+
"writer": "agent"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Issue Codes
|
|
2
|
+
|
|
3
|
+
Checker results use stable issue codes so operators can route failures without
|
|
4
|
+
parsing prose messages.
|
|
5
|
+
|
|
6
|
+
| Code | Meaning | Typical fix |
|
|
7
|
+
| --- | --- | --- |
|
|
8
|
+
| `incomplete-manifest` | Strict manifest is missing a required safety table. | Start from `pfg init-manifest` and fill capacities, writer authority, protected constructors, certificate families, and risk modes. |
|
|
9
|
+
| `protected-writer-authority` | A protected constructor was written by a non-executor writer. | Route `GateCheck`, `OutboxClaim`, `UseCap`, `ConsumeResource`, and `RiskClose` through the executor gate only. |
|
|
10
|
+
| `gate-bundle-coherence` | The five gate rows do not bind the same request tuple. | Recreate the bundle from one accepted `GateRequest`. |
|
|
11
|
+
| `gate-semantic-transcript` | Embedded `GateCheck` transcript does not replay. | Re-run `ExecutorGate.check()` on the same source prefix and registry/assumption policy. |
|
|
12
|
+
| `gate-risk-claim-missing` | Strict gate request has no accepted risk claim. | Add a `RiskClaimRecord` with route witness and declared assumption or registered checker. |
|
|
13
|
+
| `risk-claim-eta` | Risk claim spend is not a finite fraction string. | Use values such as `0`, `1/100`, or `3/10`. |
|
|
14
|
+
| `risk-alpha-format` | Risk budget is not a finite fraction string. | Use the same fraction format as risk spend values. |
|
|
15
|
+
| `risk-alpha-bound` | Finite risk spend exceeds the declared budget. | Lower spend, increase the declared bound, or split the decision. |
|
|
16
|
+
| `certificate-family-unregistered` | Strict certificate has no registered checker or declared assumption. | Register a `CertificateFamily` checker or declare the assumption in the manifest. |
|
|
17
|
+
| `source-cut-digest` | Source cut digest does not match included rows. | Recompute the source cut from the exact prefix. |
|
|
18
|
+
| `patch-affected-completeness` | A touched invariant was not listed for recheck. | Add the invariant to `affected_invariants` and provide a read/touch witness. |
|
|
19
|
+
| `join-liveness-repair` | A branch conflict lacks a folded and rechecked repair witness. | Add repair rows and typed repair witnesses for the conflict key. |
|
|
20
|
+
| `reach-witness-payload` | Reachability transition is digest-only. | Include a typed witness payload for `patch`, `join`, `gate`, `abort`, or `failClosed`. |
|
|
21
|
+
| `reach-transcript-digest` | Reachability witness replay does not match the transcript digest. | Recompute the transition witness with the same checker and manifest. |
|
|
22
|
+
| `sensitive-payload` | Log payload contains secret-looking data or a local machine path. | Replace raw secrets and local paths with stable identifiers or digests. |
|
|
23
|
+
|
|
24
|
+
Commercial deployments should treat every error issue as fail-closed. Warning
|
|
25
|
+
issues indicate weaker assumptions and should be reviewed before production use.
|