tracegrove 0.3.0 → 0.3.1

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.
@@ -1,127 +0,0 @@
1
- # Attach a retained report to existing work
2
-
3
- Receipt import and work attachment are separate delivery stages. An import can be
4
- acknowledged while attachment is still prepared, unknown, or awaiting review.
5
- Neither stage approves or completes work.
6
-
7
- Bind the work before execution. For example, an operator-owned `work-binding.json`:
8
-
9
- ```json
10
- {"workId":"00000000-0000-4000-8000-000000000003","requirementRefs":[]}
11
- ```
12
-
13
- Replace the example with the actual work UUID and agreed requirement refs. Empty
14
- requirement refs do not assert a native work contract or permission to complete it.
15
- Planning freezes the parsed binding into the request digest:
16
-
17
- ```sh
18
- tracegrove plan --config ./verification/workflow.yaml --purpose work_proof --work-binding ./work-binding.json --output ./request.json
19
- tracegrove run --request ./request.json --state-dir ./run-state --json
20
- ```
21
-
22
- An unbound historical campaign cannot acquire a work binding during export.
23
- Run a new, explicitly bound campaign if it is genuinely a new requested effort.
24
- Normal unbound planning remains unchanged. SDK callers supply the same typed
25
- `workBinding` to `plan`; it is copied and validated before planning.
26
-
27
- Ingest and import the result using the [result sink](result-sink.md) and
28
- [AWR delivery](awr-delivery.md). After import acknowledgement, create a protected
29
- `target.json` with the actual work type, the same full UUID, its native workspace,
30
- and the exact native `updated_at` value. Preserve timestamp precision and offset:
31
-
32
- ```json
33
- {"entityType":"task","entityId":"00000000-0000-4000-8000-000000000003","workspaceId":"00000000-0000-4000-8000-000000000001","expectedUpdatedAt":"2026-10-18T01:00:00.123456Z"}
34
- ```
35
-
36
- ```sh
37
- tracegrove report-prepare --sink ./retained-results --id <result-id> --target ./target.json --json
38
- tracegrove report-inspect --sink ./retained-results --id <result-id> --json
39
- tracegrove report-attach --sink ./retained-results --id <result-id> --json
40
- ```
41
-
42
- Preparation and inspection are offline. Attachment uses the protected credential
43
- environment described in the AWR guide. It calls the existing authenticated receipt
44
- read endpoint with the frozen workspace UUID, then the existing artifact-create
45
- endpoint with a stable Idempotency-Key header and deterministic artifact UUID.
46
- The snapshot workspace must match the frozen import destination. Preparation
47
- requires a timestamp supplied from an authorized native work read; it does not
48
- fetch or invent one. The examples are placeholders, not observed work state.
49
- The API receives `expected_scope.workspace_id` and
50
- `expected_scope.expected_updated_at` on every attempt. The snapshot is a condition
51
- on attachment admission, not proof that execution tested that work revision.
52
- The returned artifact must match the exact workspace, work type/ID, report link,
53
- evidence metadata, and artifact UUID before the sender records acknowledgement.
54
-
55
- The report link is the existing private OrgX work-ledger receipt page. It does not
56
- create another object store or save an expiring signed URL. Before each fresh
57
- attachment attempt, the sender compares the full hosted receipt's canonical bytes
58
- with the frozen receipt digest and freshly checks the retained local archive.
59
- A substituted report, missing import, foreign target ID, or corrupted archive blocks
60
- the attempt. Changing a target type, workspace or timestamp after preparation also
61
- conflicts. Projects, initiatives, workstreams, milestones and tasks are supported.
62
-
63
- The artifact is born `in_review`, with `external_unverified` provenance and an
64
- explicit product verdict in its preview. A failed product campaign stays failed;
65
- attaching its evidence does not label the product as passing. The link serves the
66
- redacted imported report, not the full local bundle, recordings or raw observations.
67
- Protected publication of those additional bytes remains a separate integration.
68
-
69
- ## Independent retries
70
-
71
- The attachment outbox stores a separate immutable intent and acknowledgement from
72
- the AWR import. Both stages reuse `LocalDeliveryJournal`, which owns bounded
73
- attempt history, synced intent/attempt/acknowledgement records, version checks and
74
- in-flight exclusion on the existing fenced ledger. Existing AWR journal event names
75
- and receipt shapes remain readable; no migration or extra database is introduced.
76
-
77
- If artifact creation succeeds but the response is lost, attachment becomes
78
- `acknowledgement_unknown`. Reopen and retry with the same result ID: the exact
79
- payload, artifact UUID and idempotency key are reused. A failed local acknowledgement
80
- write is recovered the same way. Receipt import is not repeated, and no runner,
81
- fixture seeder or completion service is invoked. A confirmed retry reports
82
- `attached`, with a separate `recordedArtifactStatus`. Evaluation or human review
83
- may have changed that status since creation; a retry records the returned status
84
- without confusing it with delivery or native work acceptance. Historical
85
- acknowledgement is not a fresh read; acknowledged retries make no network call.
86
-
87
- The scoped intent uses `workflow.report-attachment/v2`. A v1 journal has no atomic
88
- snapshot and is refused with a reconciliation message. Keep that journal and
89
- reconcile any prior artifact with the original sender; this version does not
90
- rewrite it, silently attach a snapshot later, or generate a replacement identity.
91
-
92
- ## Host authority and limits
93
-
94
- `LocalReportAttachmentOutbox` exports typed `ReportAttachmentAuthority` and
95
- `ReportAttachmentTransport` ports. The authority must resolve the target's actual
96
- type, owner and workspace and authorize the side effects, including any artifact
97
- evaluation costs. It is checked after readback and immediately before recording a
98
- POST attempt. A lost response does not turn into a new approval grant.
99
-
100
- The CLI represents a local operator's explicit configuration. Local labels and
101
- no-op callbacks do not authenticate a tenant. Scoped attachment requires the
102
- native API and migration in [OrgX #3663](https://github.com/hopeatina/orgx/pull/3663).
103
- That transaction checks workspace ownership, locks the work target, and compares
104
- the frozen workspace and timestamp before insertion. Matching historical retries
105
- return the original artifact after a work change, subject to current workspace
106
- access. The sender makes no separate mutable target read before POST and has no
107
- unscoped fallback. An older strict API rejects the unknown scope field; a missing
108
- native function must fail without a direct insert. Deploy the native migration
109
- and API before using scoped delivery. Hosted tenant qualification still needs
110
- live acceptance evidence; local transport tests do not establish it.
111
-
112
- A native HTTP 409 produces a conflict with instructions to preserve the delivery
113
- and reconcile its receipt. HTTP 400/401/403/404/422 blocks delivery and asks the
114
- operator to check scope, access and contract support. Provider response text is
115
- discarded. Connection loss, throttling and unavailable services retain an unknown
116
- acknowledgement and the same retry key. None of these errors refreshes the
117
- timestamp, strips the assertion, reimports the receipt or reruns the campaign.
118
-
119
- `OrgxReportAttachmentHttpTransport` reuses the import transport's credential,
120
- same-origin, redirect, deadline and bounded-response handling. It exposes no work
121
- completion or outcome API. Full native proof, task acceptance, delayed outcomes,
122
- live hosted qualification, and actual widget-host/mobile packs remain separate gates.
123
-
124
- Conformance runs import/readback/attachment over real loopback HTTP with simulated
125
- native authorization and storage. It drops the first artifact acknowledgement after
126
- admission, reopens the sender, and requires one import, one artifact, identical POST
127
- bytes, separate stage states, and no completion calls. It is not live OrgX evidence.