Repository navigation
🐛 Keep xmd repl usable after repeated component calls - #969
Merged
Merged
Conversation
A path-positioned effect now belongs to the one admission of that path it could have come from: recorded earlier, on its own coroutine or an ancestor of it. This is the rule generated fragments already used; each admission records where it was written, and both attributions narrow through one `couldOwn`. One component called in two `<Spawn>` branches is two scopes with their own turns, a finished entry stays readable, and the next entry is admitted. The refusal stays where two candidates remain, so nothing is chosen by the latest or nearest admission.
PR #969: 🐛 Keep
|
| Symbol | Declared at | Refs in diff | Why flagged |
|---|---|---|---|
GeneratedOwner |
packages/cli/src/repl/model.ts:1364 |
1 | referenced ≤1× within the added diff (pre-existing usages not counted) |
Oxlint structural signals:
no-unnecessary-type-assertion×2: packages/cli/src/repl/model.ts
Slop
✅ Slop indicators look low.
Static Analysis
Oxlint: 5 diagnostics across 1 file (4 rules)
Density: 0.017 violations/added-line
no-unnecessary-type-assertion (2): packages/cli/src/repl/model.ts
no-array-sort (1): packages/cli/src/repl/model.ts
no-unnecessary-type-conversion (1): packages/cli/src/repl/model.ts
no-unnecessary-template-expression (1): packages/cli/src/repl/model.ts
Correctness
No extraneous code patterns detected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Fixes #941. One entry calls the same Markdown component once in each of two
<Spawn>branches:Both calls complete and save their replies, and then the REPL cannot read the entry. The projector looked up the owner of every effect inside
Planner.mdby path alone, found two admissions of that path, and refused the whole projection. Every laterEntryOutputandSubmitprojects the same history first, so a finished entry made the REPL unusable.What changes
Before: any effect whose source was admitted more than once in one entry refused with "names a source this entry admitted more than once", however the two calls were arranged.
After: a path-positioned effect belongs to the one admission of that path it could have come from — recorded earlier, on the effect's own coroutine or an ancestor of it. Two calls in two branches are two scopes (
Planner-1,Planner-2), each holding its own turns, questions and bindings. A cold reopen reads the saved work without asking a provider or writing a record. The refusal stays for histories where that rule still leaves two candidates.How it works
This is the rule generated fragments already used (
generatedOwnerOf). Each admission now records the coroutine and journal position it was written at, which animport_componentrecord has always carried, and both attributions narrow through onecouldOwn.What must stay true
How to verify it
deno task test packages/cli/tests/repl-model.test.ts packages/cli/tests/repl-agent-execution.test.ts<All>/<Spawn>and two sessions, and fail against the previousownerOf(checked by restoring it).Scope
Included: the path attribution rule in
packages/cli/src/repl/model.ts, theAdvisor.mdfixture, and the tests above. Nothing changes in what the runtime records, in agent-session identity, or in the generated-fragment rule beyond sharing its narrowing.Intentionally unchanged: the same component called twice sequentially on one coroutine still refuses. No record bounds where the first call's work ends, and taking the later call would be choosing by recency.
Risks and limitations
-1is the order their admissions were journaled in, which concurrency does not fix. R1 therefore checks attribution by each record's branch rather than by that order.Scope confirmation