forked from Dicklesworthstone/pi_agent_rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremote-validation-proof-ledger-contract.json
More file actions
264 lines (264 loc) · 8.06 KB
/
Copy pathremote-validation-proof-ledger-contract.json
File metadata and controls
264 lines (264 loc) · 8.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
{
"schema": "pi.remote_validation.proof_ledger_contract.v1",
"ledger_schema": "pi.remote_validation.proof_ledger.v1",
"entry_schema": "pi.remote_validation.proof_entry.v1",
"example_corpus_schema": "pi.remote_validation.proof_ledger.example_corpus.v1",
"contract_version": "1.0.0",
"bead_id": "bd-e5le6.1",
"parent_bead_id": "bd-e5le6",
"purpose": "operator_remote_validation_evidence_not_release_performance_claim",
"summary": "Defines the machine-readable ledger shape for proving whether cargo, script, UBS, or Beads-ledger validation ran, which changed paths the proof covered, whether RCH execution or local fallback was observed, and whether build artifact retrieval completed cleanly. The ledger is operator evidence for bead closeout and runpack handoff; it is not release performance evidence and does not replace RCH, cargo_headroom.sh, CI, UBS, Beads, Agent Mail, or claim-integrity gates.",
"non_goals": [
"replace_rch_scheduler_or_worker_logs",
"replace_cargo_headroom_admission",
"replace_ci_or_release_claim_integrity_gates",
"treat_local_fallback_as_remote_proof",
"treat_artifact_retrieval_warnings_as_clean_remote_proof",
"hide_queue_backoff_or_stale_progress",
"store_raw_secrets_mail_tokens_or_full_unredacted_logs",
"support_release_facing_speed_memory_or_dropin_claims"
],
"claim_boundaries": {
"release_performance_claims_allowed": false,
"strict_dropin_claims_allowed": false,
"operator_closeout_claims_allowed": true,
"required_phrase": "operator evidence only; not release performance evidence",
"policy": "A pass entry proves only that the named command met this contract for the current git/worktree/runner context. It must not be cited as speed, memory, throughput, drop-in, or benchmark support."
},
"required_ledger_top_level_keys": [
"schema",
"ledger_id",
"generated_at_utc",
"producer",
"git",
"worktree",
"entries",
"summary",
"redaction_summary",
"claim_boundaries"
],
"required_entry_keys": [
"schema",
"entry_id",
"bead_id",
"command",
"command_class",
"runner",
"timing",
"exit",
"paths",
"artifact_retrieval",
"warnings",
"evidence_classification"
],
"command_contract": {
"required_fields": [
"argv",
"rendered",
"cwd",
"command_fingerprint",
"feature_flags",
"env_allowlist"
],
"allowed_command_classes": [
"cargo_check",
"cargo_clippy",
"cargo_test",
"cargo_build",
"cargo_fmt_check",
"script_self_test",
"ubs_staged",
"beads_ledger_reconcile",
"custom_validation"
],
"fingerprint_policy": "command_fingerprint must include argv, cwd, git head, command_class, feature flags, CARGO_TARGET_DIR, TMPDIR, runner_requirement, and dirty-path policy."
},
"runner_contract": {
"required_fields": [
"requested_runner",
"resolved_runner",
"runner_requirement",
"remote_execution",
"local_fallback",
"fallback_reason",
"rch_job_id",
"worker_id",
"worker_host",
"queue_state",
"worker_state",
"command_rewrite",
"status_excerpt"
],
"allowed_requested_runners": [
"rch",
"local",
"read_only"
],
"allowed_resolved_runners": [
"rch_remote",
"local",
"not_run"
],
"allowed_runner_requirements": [
"rch_required",
"local_allowed",
"read_only",
"no_compile"
],
"allowed_local_fallback": [
"none",
"refused",
"observed",
"unknown"
],
"remote_proof_policy": "For runner_requirement=rch_required, clean proof requires resolved_runner=rch_remote, remote_execution=true, and local_fallback=none. local_fallback=observed is never clean proof. local_fallback=refused is a correct fail-closed blocker, not a pass."
},
"timing_contract": {
"required_fields": [
"started_at_utc",
"ended_at_utc",
"duration_ms",
"heartbeat_at_utc",
"stale_progress_detected"
],
"timestamp_policy": "Timestamps must be RFC3339 UTC strings ending in Z. duration_ms must be non-negative. stale_progress_detected=true degrades proof unless a later clean exit is recorded in the same entry."
},
"exit_contract": {
"required_fields": [
"exit_code",
"success",
"termination_reason",
"stderr_excerpt",
"stdout_excerpt"
],
"allowed_termination_reasons": [
"completed",
"failed",
"timed_out",
"cancelled",
"queue_backoff",
"local_fallback_refused",
"not_run"
]
},
"paths_contract": {
"required_fields": [
"cargo_target_dir",
"tmpdir",
"remote_target_dir",
"remote_tmpdir",
"artifact_paths"
],
"path_policy": "Entries must name the target and temp directories used for the command. Dynamic user paths may be normalized, but missing target/TMPDIR data must be reported as degraded instead of inferred."
},
"artifact_retrieval_contract": {
"required_fields": [
"status",
"retrieved_paths",
"missing_paths",
"warning_details",
"retrieval_exit_code",
"retrieval_elapsed_ms"
],
"allowed_status": [
"clean",
"warning",
"failed",
"skipped",
"not_applicable",
"unknown"
],
"retrieval_policy": "status=warning or failed must remain visible in operator handoff. A command may have exit.success=true while artifact_retrieval.status=warning; that is degraded remote proof, not clean proof."
},
"warning_contract": {
"required_fields": [
"warning_id",
"severity",
"message",
"source",
"redacted"
],
"allowed_severity": [
"info",
"warning",
"error"
],
"required_warning_ids": [
"local_fallback_observed",
"local_fallback_refused",
"queue_backoff",
"artifact_retrieval_warning",
"stale_progress",
"unrelated_worktree_blocker",
"worker_workspace_shadow",
"proof_claim_coverage_mismatch"
]
},
"evidence_classification_contract": {
"required_fields": [
"status",
"clean_remote_proof",
"operator_evidence_only",
"suppressed_claims",
"coverage",
"degraded_reasons",
"next_actions"
],
"allowed_status": [
"pass",
"degraded",
"blocked",
"fail"
],
"required_suppressed_claims": [
"release_performance",
"strict_dropin",
"benchmark_throughput",
"memory_or_startup_claim"
],
"classification_policy": "clean_remote_proof=true is allowed only when command exit succeeded, RCH remote execution is proven, no local fallback occurred, artifact retrieval is clean or not_applicable, and no error-severity warning is present. authoritative_for_bead=true is stricter: the proof must pass and cover every claimed changed path."
},
"coverage_contract": {
"required_fields": [
"changed_paths",
"claimed_paths",
"covered_paths",
"uncovered_paths",
"coverage_status",
"coverage_rationale",
"claimed_authoritative",
"authoritative_for_bead"
],
"allowed_coverage_status": [
"covered",
"partial",
"uncovered",
"blocked",
"fail",
"claimed_uncovered",
"no_changed_paths",
"no_claimed_paths"
],
"fail_closed_policy": "If a proof explicitly claims authoritative bead coverage but any claimed path is not covered, the entry must classify as fail with warning_id=proof_claim_coverage_mismatch."
},
"golden_examples": {
"path": "tests/golden_corpus/remote_validation_proof_ledger/examples.json",
"required_case_ids": [
"pass_remote_clean",
"local_fallback_refusal",
"queue_backoff",
"retrieval_warning"
]
},
"operator_docs": {
"runbook_path": "docs/swarm-operations-runbook.md",
"readme_path": "README.md",
"required_fragments": [
"pi.remote_validation.proof_ledger.v1",
"operator evidence only",
"not release performance evidence",
"local fallback",
"artifact retrieval"
]
}
}