Skip to content

Commit 1b2f7d7

Browse files
committed
📝 Hold the provenance exception, example and refusal to their exact wording
Three review findings, none of them runtime behavior. The architecture exception closed by inviting the next candidate to satisfy the same constraints, which read as an eligibility test for module registries generally. #424 authorizes one association, so say only that, and name the terminology entry after the type it defines. The new README example imported the public API from the wrong namespace. WAC11 proved refusal and ordering but accepted any Error, so the diagnostic the provider is required to report was not under test. Pinning it means the stale identity wording, or any unrelated pre-transaction failure, now fails.
1 parent ba6496c commit 1b2f7d7

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎architecture.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Existing documents and code get aligned to this section retroactively.
5454
| checkpoint | a completed journal boundary associated with the logical Workspace root visible after that effect |
5555
| history fork | a new workflow run that replays a compatible journal prefix and continues from its checkpoint and Workspace root under a new immutable document definition |
5656
| loaded copy | one independently evaluated instance of a package, such as the copy bundled into the binary or a separately installed dependency |
57-
| journal provenance | a non-operational, equality-only witness that a live publication stream descends from the exact journal backend a provider selected for one workflow run; it grants no append, read, execution, publication or reconciliation capability, and is meaningful only because the provider retains the witness it established and later requires exact equality |
57+
| `JournalProvenance` | a non-operational, equality-only witness that a live publication stream descends from the exact journal backend a provider selected for one workflow run; it grants no append, read, execution, publication or reconciliation capability, and is meaningful only because the provider retains the witness it established and later requires exact equality |
5858

5959
## Three axes
6060

@@ -947,8 +947,9 @@ coordination; a wrapper-private one could not refuse duplicate establishment on
947947
an arbitrary stream. Neither adds a security property this lacks, and both
948948
enlarge the trusted surface.
949949

950-
This is not permission for module-scoped caches or registries generally. Any
951-
other candidate is refused unless it satisfies every constraint above.
950+
This exception authorizes only the canonical `JournalProvenance` association
951+
described here. It creates no general eligibility test for module-scoped state;
952+
any other exception requires its own explicit architecture decision.
952953

953954
## State across loaded copies
954955

‎packages/durable-streams/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ import {
677677
establishJournalProvenance,
678678
guardDurableStream,
679679
preserveJournalProvenance,
680-
} from "@effectionx/durable-streams";
680+
} from "@executablemd/durable-streams";
681681

682682
const provenance = establishJournalProvenance(journal); // retained by the provider
683683
```

‎packages/workflow/tests/workspace-effect-transaction.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ const WorkspaceInvocationCollision = createApi<InvocationCollisionApi>(
8787
},
8888
);
8989

90+
/** The diagnostic a provenance refusal must carry, and no other. */
91+
const PROVENANCE_REFUSAL =
92+
"the live Workspace journal does not have the provenance of the selected WorkflowRun.";
93+
9094
function* raised(operation: Operation<unknown>): Operation<unknown> {
9195
try {
9296
yield* operation;
@@ -892,6 +896,10 @@ describe("Tier WAC — atomic provider-level Workspace effects", () => {
892896
);
893897
expect(failure).toBe(caught);
894898
expect(failure).toBeInstanceOf(Error);
899+
// The refusal names the fact that failed. A generic, stale-identity or
900+
// unrelated pre-transaction error would satisfy every other assertion
901+
// here while reporting the wrong thing to whoever reads the run.
902+
expect(Reflect.get(failure ?? {}, "message")).toBe(PROVENANCE_REFUSAL);
895903
expect(mutations).toBe(0);
896904
expect(laterExecutions).toBe(0);
897905
// Refused before the transaction does any work: no savepoint opened,

0 commit comments

Comments
 (0)