Repository navigation
fix(core): context and plan-feature forward --origin; emitted commands quote and locate the project (#791, #790) - #797
Merged
Conversation
…s quote and locate the project (#791, #790) #791: context, context --task and plan-feature compiled the project with applySite(loaded,{}), discarding the operator's --origin, so a site.sitemap project failed claiming the flag was missing. compile() now takes the origin; FeaturePlanOptions gains `origin`; the CLI plan-feature and the MCP get_context/plan_feature paths forward it. Without an origin the site expansion error still names --origin; nothing is guessed. #790: the project argument in emitted commands is shell-quoted with shellWord (context and task context, including projectFlag overrides). MCP get_context emitted `--project .`, which from the client's working directory (the site root for `--project app --host-file host.mjs`) named the site itself and put host.mjs inside the "project", failing the host-file check. It now emits the project's absolute path, matching the absolute host file. Tests: test/context-commands.test.ts covers sitemap+origin via SDK, CLI and the real serveMcp path, spaces/apostrophe quoting executed through /bin/sh, and the site-root MCP scenario executed from the site root. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…to core (#793, #795) #793: the contact-form recipe said test and audit probes do not fire its signal. They do: fixtures are ordinary requests, and only HEAD and the /_urlcode health, readiness and metrics probes are exempt. The recipe README, docs/EGRESS.md (new "Signals under test and audit" section) and the egress example README now say so and recommend a controlled test receiver. A new egress-runtime test runs the recipe's fixtures through runProjectTests and auditProject with only the transport replaced and asserts one signal POST each. #795: examples/cloudflare and examples/vercel depended on core ^0.3.0. release-bump now rewrites the exact @jimhoyd/urlcode pin in every tracked examples/*/package.json and --check fails when one drifts; both examples pin the current version. VERSION-ALIGNMENT and RELEASE-OPERATIONS describe it, and release-bump tests cover the bump and the drift. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#777) A dev reload of `init --with admin,form-records --example` was rejected with "Store directory is already locked by this process": the replacement runtime activated its extensions while the serving one still held the store lock. Define the reload lifecycle (RIM-EXT-HANDOFF-001): the replacement snapshot is built and fully checked with its extensions deferred; the server then holds newly admitted requests, waits (bounded by closeTimeoutMs) for the serving snapshot's in-flight requests, closes its extensions, activates the replacement's and makes it current before the held requests resume. If the replacement refuses, the serving snapshot's plan is activated again and keeps serving; a failed restore answers 503 with readiness degraded until a later reload succeeds. At most one activation of each registration is ever live, so the store lock stays single-writer without being removed or force-unlocked. prepareExtensions returns a reusable ExtensionPlan (fresh registry per activate, idempotent close); activations receive `declarations`, the snapshot's validated extension configs, and store's ui screen source now reads its config from there instead of the project file on disk, so a restored last-good snapshot keeps its screens. Core still imports no package. Tests: test/extension-handoff.test.ts (ordering, restore, failed restore, in-flight hold and drain timeout, deferred runtime) and packages/form-records/test/reload.test.ts, which serves the site `init --with admin,form-records --example` generates through its host.mjs with the real packages, reloads the changed contact title, and checks a refused reload keeps the last-good snapshot with exactly one store lock. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolves runtime.ts/server.ts/extensions.ts and the RIM table. One rule now covers both features: an admitted stream holds its runtime's extensions, so a handoff release waits for open streams as well as buffered requests, and a dev reload of a project declaring extensions first ends open streams with the new end reason `reload` (clients resume, e.g. MCP Last-Event-ID) rather than being refused for as long as a client stays connected. A project declaring no extensions has nothing to hand over and keeps #796's behavior: streams run on the retired runtime. handle() keeps its request counted until a stream is admitted, so no release or close runs between dispatch settling and tracking. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 26, 2026 19:42
#798 fixed #777, #793 and #795 with its own design (an extension handoff() hook with a reference-counted exclusive resource) and merged first. This resolves the conflict by taking main for all of that, so this branch's own reload-handoff, recipe-signal and example-pin changes are dropped. What remains is the context/plan-feature/MCP fix for #791 and #790 on top of main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #791 and #790.
Scope change: #798 merged separately and fixed #777, #793 and #795 with its own design. This branch's earlier changes for those issues were dropped in a merge commit that takes main's version. The net diff against main is now only the context/MCP command fix.
#791:
context,context --task,plan-featureand MCP dropped--origincontext.tspasses the origin to site expansion (applySite(loaded,{origin})) in bothbuildContextandbuildTaskContext.FeaturePlanOptions.originis added, and CLIplan-featureand MCPplan_featureforward it.--origin; nothing is guessed.#790: emitted commands mishandled paths and the working directory
--projectargument, includingprojectFlagoverrides, goes throughshellWord.get_contextnow emits the absolute project path. It used to emit--project ., which from the site root, where.mcp.jsonruns--project app --host-file host.mjs, puthost.mjsinside the "project". The host-file safety check is unchanged.--projectas the user typed it, now quoted.docs/TOOLING.mddocuments all of this.Evidence
test/context-commands.test.ts, 5 tests; all fail on the old source. They cover:serveMcp(get_context, the task variant,plan_feature), plus the error when it's missing;/bin/sh;npm run verifyexits 0 on this exact tree: 1006 core tests pass, and every workspace suite has 0 failures.Limitations
npx --no --package @jimhoyd/urlcode, so they need a directory inside the site. That is the documented client working directory.Closes #791
Closes #790
🤖 Generated with Claude Code