You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cf48c97
Browse filesBrowse the repository at this point in the historyBrowse files
💥 Replace invocation() with getExpansion() and derive expansion identity
## Motivation
Durable workflow effects (#291) and workflow-owned worktrees (#293) need a
deterministic identity for one logical evaluation of an authored element.
Nothing in the engine could supply one: the only run-scoped identifier was the
`BlockCounter`, which advances with however much has already run and so moves
under retry and under a branch that did or did not execute.
`invocation()` already answered the other half of the question — the authored
name and where it was written — but only for function components, and only as a
Component Api operation any middleware could intercept, while four families of
durable record name are derived from it.
## Approach
`getExpansion()` replaces `invocation()` with no alias, and covers Markdown
component expansions as well. It answers with `{ id, name, position? }`.
`id` is derived from the root document and the structural path that reached the
element. Each step contributes a frame — root document, authored element, loop
iteration, each item, projection — and the path is threaded explicitly as the
digest so far, so extending it costs one hash. An element is placed by its own
source path and offset rather than by an index into the list being expanded,
which is what makes the derivation independent of how much ran before it.
`Expansion` is delivered as a plain context value. An Effection context is
identified by its name, and two descriptors built with the same name address the
same context — the portability mechanism that lets a second instance of core
read what the engine published, which is what a repository `.ts` component
importing core from disk is while the compiled binary carries its own copy. A
first attempt branded the value with a private class field; every Deno check
stayed green while the compiled binary failed 2 of 10 documents.
Every produced location string is unchanged, so `elicit:`, `prompt:`, `test:`,
`testing:` and the web-form record names are byte-identical and existing
journals still replay.
## Verification
Tier XP (17 tests) discriminates each claim by the derivation it would kill,
including two concurrent projections of one slot keeping their identifiers when
completion order reverses, a projection operation constructed but never
interpreted consuming no ordinal, and a context descriptor built elsewhere
reading the engine's expansion — which moves the compiled-binary-only break into
the fast suite.
`deno task lint`, `check`, `test` (352), `check:jsr`, `tsc --project
tsconfig.node.json`, `bun run test:bun` (2342), `deno task build` with the
compiled-binary smoke over `packages/core/src`, and `git diff --check` are all
green.
0 commit comments