Add verified reference lookup and immutable consumer receipts

Assistant: codex
Assistant-Model: gpt-6.1-sol
Assistant-Session: 01a1045b-933d-7aa1-b2db-104557487a79
This commit is contained in:
tegwick 2026-10-04 09:02:35 +02:00
parent c7f87b791b
commit bd85fcd179
15 changed files with 583 additions and 11 deletions

View file

@ -12,6 +12,49 @@ implementation authority. A deployment repair or documentation-only inspection o
this pattern repository is not an external frontend use. Unsupported contexts should
produce an explicit no-match decision, not a forced pattern selection.
## Local lookup and closeout helper
The local helper is available before hosted federation enrollment. From the reference
checkout, `python3 scripts/reference_consume.py --version 0.1 lookup --candidate CAND-0007`
returns a verified candidate with exact corpus/packaging citation pins. Force and
responsibility filters narrow research leads; they do not make the consumer decision.
Read the linked contracts and their alternatives. Preserve abstention and unsupported
needs; do not turn a matching force into a complete architecture claim.
The [decision-input example](decision-input.example.json) is explicitly synthetic,
with dummy provenance. It is a format example, never an eligible real use. For an
actual eligible task, the consumer creates its own JSON with stable use/event IDs,
explicit `kind`, full consumer commit, task/producer/run references, constraints,
considered/selected IDs, action/reason/artifact reference and an observable outcome
expectation. Unknown is the default outcome; reported helpfulness requires observation
and evidence locators and still awaits independent verification. No private code,
credentials or transcript belongs in the input.
From that consumer's checkout, using the path to the reference tool:
```bash
python3 /path/to/frontend-patterns/scripts/reference_consume.py --version 0.1 receipt \
--input decision.json --output research/pattern-use/use-01/event-01.json
```
The helper validates input and the frozen release, fills its version/packaging/digest
pins, exclusively writes a new source-relative file, and prints the exact path/SHA-256
entry for the consumer's schema-v1 receipt index. JSON is valid YAML for activity-core's
existing collector. Without `--output`, it prints the event for inspection. It never
overwrites a receipt, enrolls a source or supplies collector-verified origin.
A later outcome uses the same `use_id`, a new `event_id` and the preceding file's
`previous_event_sha256`. Retain the earlier event/index entry; chronology and predecessor
integrity are checked by the existing collector. The helper preserves a supplied
digest but does not independently verify the event chain or outcome artifact.
Consumer owners still integrate invocation into their normal closeout hook, commit the
receipt/index and arrange authorized enrollment through WP-0008. This preparation does
not establish hosted discovery, automatic hook installation, real value or the loop's
delayed-artifact refresh. `make consumption-test` includes disclosed synthetic cases
and an integration check against the sibling activity-core validator when its Python
environment is present; release acceptance requires that check to run without a skip.
## Short planning and closeout instruction
> For eligible frontend architecture work, query

View file

@ -18,6 +18,10 @@ Consumer index (at most 100 entries across one collection):
```
Events follow [PatternUseReceipt.yaml](../templates/PatternUseReceipt.yaml).
The [local producer helper](ConsumerIntegration.md#local-lookup-and-closeout-helper)
prepares verified reference pins and a new immutable JSON/YAML event plus its index
entry from explicit consumer provenance. It does not install the closeout hook or
enroll a consumer. `decision-input.example.json` is a synthetic format fixture.
One stable `use_id` links immutable events; `previous_event_sha256` identifies a
follow-up. Identical events deduplicate; conflicting IDs, missing predecessors,
branches/cycles and malformed records are quarantined in the report. Synthetic

View file

@ -0,0 +1,28 @@
{
"use_id": "fixture-consumer:FEP-DEV-01:decision-01",
"event_id": "fixture-decision-01",
"recorded_at": "2026-10-04T06:49:41Z",
"kind": "synthetic",
"consumer": {
"repo": "fixture-consumer",
"revision": "0000000000000000000000000000000000000000",
"task_ref": "fixture:FEP-DEV-01",
"producer": "disclosed-development-fixture",
"run_ref": "fixture:no-external-use"
},
"context": {
"problem": "A shared-record edit timed out; decide whether creating another attempt is justified.",
"constraints": ["The original operation result is unknown.", "Replay identity and retention are not yet verified."],
"considered": ["CAND-0007"],
"selected": []
},
"decision": {
"action": "rejected",
"reason": "Do not claim safe replay before verifying the authority's lookup and retention contract.",
"artifact_ref": null
},
"outcome": {
"expectation": "A later authority-contract check establishes whether bounded replay is available.",
"next_observation": "Actual consumer would link its authority-contract check; fixture remains unknown."
}
}