Repository navigation
init --no-mcp and EPERM diagnostics, fence-aware docs search, fixed-contract adapter recipe (#825, #826, #828) - #831
Merged
Merged
Conversation
…ions (#826) Docs search found headings with a multiline regex over the whole document, so a shell or YAML comment in a fenced code block (the store README's '# or, in an existing site:') became the reported section and could pull the excerpt toward it. headingsOf now scans each document once, tracking CommonMark backtick/tilde fences (same character, at least as long, blank after to close; unclosed runs to the end), and both sectionAt and the 'opens a section' ranking in focus use that list. Headings stay column-0 ATX only, so indented code blocks cannot hold one. Output for the core documents is unchanged (45 queries, 124 results compared against main). Refs #826 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…p.json (#825) - `urlcode init --no-mcp` and `urlcode bootstrap --create --no-mcp` (alone or with --adopt, and with init --with) create the same runnable site without .mcp.json, the only client configuration init writes (AGENTS.md is guidance, .github/ is CI). Existing .mcp.json and .claude/ are left untouched. Output and the bootstrap packet report mcpRegistration: skipped with a note; the default init still writes .mcp.json and its output is unchanged. - A write the OS or a sandbox refuses (EPERM, EACCES, EROFS) during init is a ConfigError with code init-write-denied naming the operation and the destination-relative path; for .mcp.json it points at --no-mcp, otherwise at a writable destination. It never suggests changing permissions or disabling a sandbox. Both system error maps gain fixed EPERM and EROFS sentences. - Rollback removes only what the run created; an in-place package.json is restored only if init actually rewrote it, so a refused run leaves it byte- and mtime-identical. - starters/default/.mcp.json is deleted (init already renders it), so the package ships no client configuration; package-smoke asserts that and exercises init --no-mcp on the installed CLI. - Docs: TOOLING, STARTERS, AI-AUTHORING, llms.txt, CONTRIBUTING, CLI help. Refs #825, #542, #807, #814, #581 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Per the owner decision on #828 (option a): a compatibility audit plus a tested recipe, with no new runtime capability, no generic response rewriting and no new extension package. recipes/fixed-contract-adapter serves a typical fixed JSON contract through a thin operator module (api-contract.mjs, carried in the README, registered in host.mjs after auth and store). It reads the signed-in account through AuthExports.account() and keeps owner-scoped items through StoreExports.records(), projecting to {email, role} and {id, title, done} and mapping store and body refusals to a fixed {error: {code, message}} envelope; site.errors (#821) gives runtime errors under /api the same envelope. It never reads a cookie, checks a password or token, starts or ends a session, or compares owners, and refuses to activate on a contract route without auth's principal-providing policy, on a shared collection or with an undeclared field. The README's compatibility audit lists what is safe over the public APIs and what the client must change: sign-in and sign-out at contract paths (AuthExports has neither; AuthService.login would skip auth's CSRF, backoff, device and cookie handling), CSRF/origin skipping, header-borne sessions, the contract body on auth's 401/403 (never rewritten), cross-owner access, custom password hashing, and delete (StoreExports v1 has no delete; the native store mount deletes). packages/auth/test/fixed-contract-adapter-recipe.test.ts runs the README module against the real extensions: the lifecycle and every error mapping, activation refusals, the fixtures twice, headless-auth-profile's fixtures on the same auth database, and urlcode test/audit through --host-file (audit ready, 5 routes). Catalog, planner terms, RECIPES, AI-AUTHORING, EXTENSIONS, llms, the auth JSON contract page and the authoring skill link the recipe. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rement Measured on the merged branch (Node 26): 876609 packed, 3468112 unpacked, 493 entries. Budgets: 860 KiB packed, 3395 KiB unpacked. 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.
Problem and change
#825:
init --no-mcp, and a clear diagnostic when a sandbox refuses a writeurlcode init <dir> --no-mcpskips.mcp.json, the only client configuration file init writes.bootstrap --create --no-mcppasses it through, with or without--adopt.AGENTS.mdis guidance and is still written..mcp.jsonor.claude/is left untouched."mcpRegistration":"skipped"with a note; it never claims MCP registration succeeded.initis unchanged.init-write-denied, with a path relative to the destination and a limited message. For.mcp.json, the message suggests--no-mcp. It never recommends disabling a sandbox or changing permissions. EPERM and EROFS are added to both general error maps.package.jsonis restored only if init actually rewrote it.starters/default/.mcp.jsonis removed, since init already renders it. That avoidsEPERMwarnings fromnpm installunder protected agent-config paths. The package smoke test asserts the tarball contains no.mcp.json, and runsinit --no-mcpfollowed byurlcode test.#826: docs search ignores
#inside fenced codeheadingsOf()scans a document once, following CommonMark fence rules: ``` and ~~~ fences, matching length, info strings, and an unclosed fence runs to the end.sectionAtand the "opens a section" ranking both use it.#828: compatibility audit and the
fixed-contract-adapterrecipe (owner decision: option a)defineExtension,requires: [auth, store]) that uses onlyAuthExportsandStoreExports, withauth: trueon its mounts. It lives in the recipe README next tohost.mjs, and the tests run that README code.{email, role};/api/me;site.errorsfor runtime errors;urlcode-auth import.POST /api/loginand/api/logoutat contract paths;DELETEthrough the contract path.urlcode audit --expect-routes 5reports ready. The nativeheadless-auth-profilecontract still passes on the same auth service.Verification
npm run verifyexits 0.test:addons: 4/4.npm run test:packageexits 0: "39 packaged example commands ran from consumer copies; Packed installation and starter/cookbook checks passed".New tests:
test/init-no-mcp.test.ts(8). EPERM is injected through a preloaded fs stub rather than chmod, so it should also work on Windows.test/docs-search.test.ts.packages/auth/test/fixed-contract-adapter-recipe.test.ts(4).Core package budget, set from the merged measurement:
All other packages are within budget; auth is at 248008 of 250 KiB packed.
Limitations
[Bug]: Agent sandbox blocks MCP scaffold writes and init hides EPERM #825:
.claude/skills/….[Bug]: docs search treats # comments inside fenced code blocks as section headings #826: fences inside blockquotes or deep list nesting are not tracked.
[Request]: Evaluate fixed-contract API adapters that preserve auth and store ownership #828:
Changes match the documented portable contract; docs/examples are updated where needed.
Relevant tests and package checks pass, or limitations are explained above.
No credentials, customer data or private project material are included.
Runtime/starter changes remain aligned where applicable.
Closes #825
Closes #826
Closes #828
🤖 Generated with Claude Code