|
| 1 | +# Capability and evidence-claim integrity guardrails |
| 2 | + |
| 3 | +GitHub issue #84 is the authority for this repository-wide correction. This |
| 4 | +note fixes the claim boundaries every adapter, shared helper, command, and |
| 5 | +conformance lane must respect. It defines no new RAES contract, capability, |
| 6 | +evidence type, status vocabulary, or implementation plan. |
| 7 | + |
| 8 | +## Keep four claims distinct |
| 9 | + |
| 10 | +An authored task requirement, a backend capability declaration, a captured |
| 11 | +run artifact, and a post-run satisfaction claim are different facts with |
| 12 | +different owners: |
| 13 | + |
| 14 | +- `ExperimentTaskModel` owns what evidence the author requires. A requirement |
| 15 | + is demand, not proof that an adapter can capture it. |
| 16 | +- The published RAES `BackendManifest` and capability models own what the |
| 17 | + selected production target advertises. A capability is admissible only when |
| 18 | + its production component and capture path are executable; a constraint, |
| 19 | + source-ledger row, injected driver, or planned feature is not a substitute. |
| 20 | +- `ExperimentEvidenceRecordModel`, `ExperimentDerivedMeasureModel`, and |
| 21 | + `ExperimentArtifactRefModel` describe what one run actually emitted. A file |
| 22 | + containing an evaluator summary is not an action log, availability series, |
| 23 | + host-compromise series, or reward-component record merely because all of |
| 24 | + them concern the same episode. |
| 25 | +- `validate_experiment_run_against_task()` owns the task/run satisfaction join. |
| 26 | + Conformance, qualification, source admission, cleanup, or a successful run |
| 27 | + cannot bypass that join or manufacture its inputs. |
| 28 | + |
| 29 | +The pinned RAES contract validates a semantic `satisfies_refs` entry by |
| 30 | +reference identity. `ExperimentEvidenceSatisfactionReferenceModel` cannot |
| 31 | +express required-field coverage or the availability, redaction, withholding, |
| 32 | +or loss status of those fields. Therefore a generic authored evidence concept |
| 33 | +must not be placed in `satisfies_refs` until the applicable published RAES |
| 34 | +contract can express and validate the complete artifact-and-field witness. |
| 35 | +Current researcher tasks that require such a concept must fail closed even if |
| 36 | +that makes an adapter or example temporarily non-runnable. An exact authored |
| 37 | +artifact identity remains admissible only where the existing RAES validator |
| 38 | +can verify its identity and any authored digest/path constraints directly. |
| 39 | + |
| 40 | +## Canonical incumbents |
| 41 | + |
| 42 | +| Concern | Canonical owner and required use | |
| 43 | +| --- | --- | |
| 44 | +| Manifest and capability shape | RAES `BackendManifest`, `BackendCapabilitySet`, component capability models, `backend_manifest_payload()`, capability-admission helpers, and `RuntimeTarget` presence/signature validation. Do not add an adapter capability schema or infer support from component existence alone. | |
| 45 | +| Runtime admission | `RuntimeManager.plan()`, public target components, `ApplyResult`, snapshot-transition validation, participant admission/history validation, evaluator result validation, and cleanup receipt validation. Every affirmative production claim must survive its applicable public execution path. | |
| 46 | +| Experiment evidence | RAES capture-spec, evidence-record, derived-measure, artifact, run, and task models plus `_experiment_evidence.py` and `_researcher_support.py` for mechanics only. Backend-local code owns source projection; shared helpers must not assign semantic evidence identities. | |
| 47 | +| Task/run joins | `validate_experiment_run_against_task()` and `validate_experiment_study_against_tasks_and_runs()`. Do not copy their join logic or predeclare a positive result in `_BackendAdapter`, a manifest constraint, or a pack file. | |
| 48 | +| Manifest conformance | `run_conformance_probe()`, canonical RAES report projection/writer, and executable adapter-local probes. `affirmative_capability_pointers()` is inventory only; a static pointer-to-reference table and one broad pass flag are not proof that each leaf was exercised. | |
| 49 | +| Source truth | Backend qualification records, source admission, scenario/source ledgers, and loss disclosures. These establish provenance and bounded source facts; they do not satisfy per-run capture requirements. | |
| 50 | +| Failures and disclosure | RAES `Diagnostic`/`DiagnosticModel`, `diagnostic_model()`, `ApplyResult`, stable command exit codes, and `base.redaction`. Missing, unavailable, withheld, redacted, lossy, unsupported, and failed must remain distinct non-success dispositions. | |
| 51 | +| Persistence | `atomic_write_json_artifact()`, the RAES conformance report writer, exclusive confined output roots, and inventory-last sealing. Runtime state remains behind RAES runtime/control-plane ownership; no evidence registry, cache, or adapter store is introduced. | |
| 52 | +| Verification | Existing repository tests, clean-installed distribution probes, the single nox graph, and the `PR Gate`. Negative tests must exercise every registered adapter and shared command path, not a hand-maintained subset that silently omits the next adapter. | |
| 53 | + |
| 54 | +Backend manifests may contain declarative values, but those values are not |
| 55 | +self-authenticating. Shared constructors such as standard evaluator, |
| 56 | +orchestrator, or cleanup capability builders may factor shape only after the |
| 57 | +caller supplies truth established by the production path. They must not grant |
| 58 | +support merely because several gym-style adapters are expected to share it. |
| 59 | +Likewise, reporting every PrimAITE capability as an open conformance gap does |
| 60 | +not make its affirmative production manifest truthful; an inadmissible adapter |
| 61 | +is allowed to break. |
| 62 | + |
| 63 | +## Validation and security path |
| 64 | + |
| 65 | +| Layer the design passes | Required treatment | |
| 66 | +| --- | --- | |
| 67 | +| Authentication and authorization | The current researcher command is local and adds no auth surface. Participant authority still comes from exact manifest/selection/configuration joins and public participant admission. Any later network surface must use the RAES strict-default control-plane security, verified identity, role/target authorization, request limits, denial audit, and redacted exception handling; adapters do not add endpoints. | |
| 68 | +| Secrets and environment bindings | No claim path reads credentials, a secret store, `.env`, or ambient configuration. Do not add token options or environment-selected capability/evidence overrides. Native credentials, action details, observations, rewards, argv, environment maps, and source paths never enter portable evidence or diagnostics. | |
| 69 | +| Static input and config shape | Reuse closed `argparse` choices, per-backend required/foreign argument checks, pack digest validation, confined child resolution, duplicate-key-rejecting JSON loading, RAES SDL parsing, closed contract models, participant joins, target config normalizers, and selected-source admission. No arbitrary import, driver, profile, schema, or capture map is caller-selectable. | |
| 70 | +| Runtime validators | Preserve manifest/component checks, capability admission, plan/resource/dependency validation, `ApplyResult` shape, snapshot transitions, participant action/result/history joins, evaluator/proposition checks, and cleanup verification. A native transition with an unverifiable projection is failure, not partial evidence satisfaction. | |
| 71 | +| OS and process exposure | Keep relative confined outputs, exclusive mode-0700 creation, atomic publication, no shell interpolation or runtime download, clean-install isolation, cleared `PYTHONPATH`, `PYTHONSAFEPATH=1`, and discarded native stdout/stderr. Do not put evidence payloads, credentials, or native paths in argv or filenames. | |
| 72 | +| Error envelopes and observability | Reuse bounded `_CommandFailure` messages, RAES diagnostics, canonical report projection, and default-deny redaction. Logs and terminal output may carry safe identities, pointers, counts, and dispositions only. Never serialize exception text, rejected values, native output, object representations, or tracebacks. | |
| 73 | +| Artifact publication | Validate RAES models and task/run joins before sealing success; write the final inventory last. A checksum proves byte identity, not semantic completeness or safety. Failure, cleanup failure, or an unsatisfied requirement cannot be published with a successful disposition. | |
| 74 | + |
| 75 | +## Extension seam |
| 76 | + |
| 77 | +The extension seam is the existing backend strategy boundary, parameterized by |
| 78 | +the live `BackendManifest`, the authored `ExperimentTaskModel`, and the actual |
| 79 | +validated evidence records/artifact bytes from that run. A future published |
| 80 | +RAES satisfaction contract may be consumed there without changing authored |
| 81 | +task semantics or adding a repository schema. Until that owner can validate |
| 82 | +field-level witnesses and negative data-quality states, the seam returns no |
| 83 | +semantic satisfaction claim and lets the canonical task/run validator reject |
| 84 | +the run. |
| 85 | + |
| 86 | +A future adapter registers with the existing command/target strategy and is |
| 87 | +automatically included by repository-wide claim-integrity tests. It must not |
| 88 | +require editing a global evidence allowlist, standard capability grant, copied |
| 89 | +schema, or backend-name conditional. |
| 90 | + |
| 91 | +## Gotchas and anti-patterns |
| 92 | + |
| 93 | +- Do not retain `evidence_satisfies_refs`, a backend-name evidence allowlist, |
| 94 | + unconditional `supports_* = True`, or a test-only/injected-driver bypass. |
| 95 | +- Do not promote a source-ledger reference, capability pointer, conformance |
| 96 | + evidence id, capture-spec declaration, content checksum, or evidence-record |
| 97 | + existence into per-run satisfaction. |
| 98 | +- Do not let an evaluator summary satisfy an action/observation/time-series |
| 99 | + requirement when those records and required fields were not emitted. |
| 100 | +- Do not treat missing, unavailable, redacted, withheld, lossy, unknown, |
| 101 | + unsupported, partial, or unverified as aliases for satisfied. |
| 102 | +- Do not define a local field-witness DTO, evidence status enum, validator, |
| 103 | + exception hierarchy, manifest extension, profile, registry, or persistence |
| 104 | + service to work around a missing RAES contract. |
| 105 | +- Do not make positive tests depend only on current adapters. Mutation and |
| 106 | + negative cases must catch a new manifest leaf, a new adapter registration, |
| 107 | + an omitted artifact, missing required content, a negative data-quality state, |
| 108 | + and a static reference reintroduced through any shared path. |
| 109 | + |
| 110 | +## Non-goals and boundaries |
| 111 | + |
| 112 | +Issue #84 does not implement missing action logs, availability or compromise |
| 113 | +series, reward-component capture, source qualification, deterministic replay, |
| 114 | +scientific equivalence, or new researcher backends. It does not rewrite |
| 115 | +authored task semantics merely to keep current examples runnable. |
| 116 | + |
| 117 | +It also does not add or change a RAES schema, capability vocabulary, evidence |
| 118 | +type, status model, validator, profile, diagnostic envelope, controller, store, |
| 119 | +HTTP surface, console script, distribution, lockfile, or workflow. If a |
| 120 | +published RAES contract cannot express and verify the required claim, the |
| 121 | +repository records the gap by failing closed rather than creating local |
| 122 | +authority. |
0 commit comments