Skip to content

ci: cut duplicated CI work and widen the core boundary check - #596

Merged
jimhoyd merged 2 commits into
mainfrom
claude/ci-cost-boundaries
Sep 23, 2026
Merged

jimhoyd merged 2 commits into
mainfrom
claude/ci-cost-boundaries

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #554
Refs #567

Core boundary check (#554)

scripts/check-core-boundaries.ts now also recognises:

  • require() / require.resolve(), including a require made by createRequire (bound to a name or called directly)
  • import.meta.resolve()
  • template and const-bound variable import() specifiers (resolved statically where possible; a partly static specifier is checked by its static prefix, so `../../${x}/…` is reported as able to reach any extension)
  • typeof import('…') types (type-only imports of core modules, like policies/agents.ts:218, still pass)
  • .js/.mjs/.cjs sources in core as well as .ts

A specifier with no static prefix at all (the five pathToFileURL(...).href loaders for project/operator/bundle modules) cannot be analysed, so it must be listed in a reviewed runtimeModuleLoaders set in the script; a new opaque loader fails until reviewed. The list lives in the script, not as markers in src/. test/core-boundaries.test.ts has one fixture per form, plus a check that the real repository passes.

CI cost (#567)

  • Installs: every CI job except build-fidelity uses npm ci --ignore-scripts. The root prepare script is the build, so a plain npm ci built everything twice. docs and audit never read dist/, so they no longer build at all. static runs one explicit build: typecheck resolves the package's own @jimhoyd/urlcode/* self-imports through the exports-map types in dist/. The first CI run on this PR failed there without that build. build-fidelity keeps plain npm ci so it tests the same thing as before. The only dependency with an install script is @parcel/watcher (dev, via the Tailwind CLI). That script builds from source only on request; the prebuilt binary is still installed, and workspace:styles passes. Release workflows and the Dockerfile already used --ignore-scripts.
  • scripts/check.ts: syntax-checks 65 files instead of about 280, and skips dist/ and node_modules/. The .ts files that tsc already covers (packages/core/src, test, scripts) are no longer spawned. JavaScript is still checked with node --check, in parallel, under examples/, recipes/, starters/, action/ and scripts/. .ts files outside the tsc project are now checked with module.stripTypeScriptTypes. Finding: node --check does not strip types, so it rejected recipes/typescript/functions/hello.ts once recipes were included. The old per-file .ts node --check was therefore not a reliable type-stripping check.
  • container: now needs: plan and if: lane == 'full'. The job name is unchanged, so the required check keeps its identity. GitHub reports a job skipped by its own if as satisfying a required check. ci-plan.ts gate moved container to the code list, so verify-complete accepts a skip only for a successful docs plan. Every prose path the classifier admits is outside the image build context (.dockerignore). release-run.ts still requires container SUCCESS on release PRs, and those always change manifests and so run in the full lane.
  • npm run test:examples: builds, then runs test:examples:built: starter and example tests, the Cloudflare build and the cookbook audit, the same commands the checks job used inline. CI now calls test:examples:built.
  • extension-artifacts.yml has timeout-minutes: 15 and per-tag concurrency with cancel-in-progress: false. extension-bundles.yml has timeout-minutes: 15; successful runs take 1–2 minutes, and the environment approval wait is not counted.
  • release.yml steps are numbered 1–11 contiguously. Its tests now also fail if an ordered step is missing; before, indexOf returned -1 and the order check still passed.
  • New tests: every workflow job that has steps declares a timeout; the extension publishers serialize; the install and build rules above hold.

Not done (left on #567)

  • Merging the small workspace-verify jobs and running them only on Linux for Node 22/26. This changes the platform coverage and timing tradeoffs recorded in [Request]: Measure CI lanes and complete release-train validation after alignment #185 and ci-plan.ts, so it needs a maintainer decision.
  • A weekly cron instead of daily. Scheduled runs are the exact-SHA release coverage that release-run.ts selectedRun looks for, so reducing them affects the release flow.

Evidence

  • npm run verify: pass. That covers lint, typecheck, check (including the new boundary check and check.ts), build, npm test and the workspace verify and integration suites.
  • npm run test:examples: pass.
  • Targeted: test/core-boundaries.test.ts 12/12, test/ci-release.test.ts 22/22, test/release.test.ts 13/13.
  • I confirmed by hand that check.ts fails on a bad .mjs in action/ and on an enum in a .ts under recipes/.
  • CI behaviour (skipped container on a docs-lane PR, installs with --ignore-scripts on Windows and macOS) is validated only by CI on this PR and later docs PRs. This PR runs in the full lane.

🤖 Generated with Claude Code

jimhoyd and others added 2 commits September 23, 2026 17:29
Core boundary check (#554): also catch require()/createRequire,
import.meta.resolve, template and const-bound dynamic import(), and
typeof import('...') types; partly-static specifiers are checked by their
static prefix, and fully opaque runtime loaders must be reviewed and listed.
Scans .js/.mjs/.cjs in core too. One fixture per form.

CI cost (#567): npm ci --ignore-scripts plus one explicit build (build-fidelity
keeps plain npm ci); check.ts syntax-checks only files tsc does not cover,
skips dist/ and node_modules, adds recipes/ and action/, and checks .ts with
Node's type stripper (node --check does not strip types); the required
container job is gated on the plan and accepted as skipped only in the docs
lane; new npm run test:examples; timeouts/concurrency on extension publishers;
release.yml steps numbered consistently.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The typecheck resolves the package's own @jimhoyd/urlcode/* self-imports
through the exports-map types, which live in dist/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jimhoyd
jimhoyd merged commit 27a2974 into main Sep 23, 2026
61 checks passed
@jimhoyd
jimhoyd deleted the claude/ci-cost-boundaries branch September 23, 2026 23:38
jimhoyd added a commit that referenced this pull request Sep 24, 2026
The merge with origin/main lost #596's timeout-minutes on the job that
builds/attests/publishes bundles, since that job was split into tag/publish
in #601. Restore it on publish (the tag job already got one from the merge).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
jimhoyd added a commit that referenced this pull request Sep 24, 2026
) (#601)

* fix(core): make extension bundle verification failures diagnosable (#579)

- Pass a bounded, sanitized excerpt of `gh attestation verify` output and
  the applied policy through on refusal instead of discarding it.
- Check `init --with` / `extension-bundles install` names against the
  bundles this core builds before any network call, with did-you-mean.
- Report an unreachable GitHub as such, naming the release being fetched.
- Release workflow: a dispatch from main only creates the tag and
  re-dispatches on it, so build and attestation run on refs/tags/<release>;
  verify assets with the CLI's own transport before and after publishing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: add missing timeout-minutes to extension-bundles publish job

The merge with origin/main lost #596's timeout-minutes on the job that
builds/attests/publishes bundles, since that job was split into tag/publish
in #601. Restore it on publish (the tag job already got one from the merge).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
jimhoyd added a commit that referenced this pull request Sep 24, 2026
….ts's self-import

check-agent-facts.ts (new in this PR) imports packages/core/src/mcp.ts,
which imports its own public export '@jimhoyd/urlcode/agent-context' to
prove that export is sufficient. That resolves to dist/agent-context.js,
which the docs CI job (changed by #596 to skip building) never produces.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd added a commit that referenced this pull request Sep 24, 2026
…ks (#606)

* fix(docs): correct trust, short-link and wildcard guidance for agents

Refs #539 #540 #585 #558

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* wip agent facts

* wip

* wip

* feat(check): add implementation-derived agent-facts check and fix contradictions

Add scripts/check-agent-facts.ts (wired into check:docs) that derives an
inventory from implementation sources -- extension bundle set, auth/admin kit
adoption, --with canonical ordering, MCP tool counts and the store shortLinks
contract -- and fails on agent-visible prose contradicting it. Fix the forms,
ui, --with ordering and MCP count contradictions it found.

Refs #541

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(ci): build before check:docs so check-agent-facts.ts resolves mcp.ts's self-import

check-agent-facts.ts (new in this PR) imports packages/core/src/mcp.ts,
which imports its own public export '@jimhoyd/urlcode/agent-context' to
prove that export is sufficient. That resolves to dist/agent-context.js,
which the docs CI job (changed by #596 to skip building) never produces.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: check-core-boundaries misses require, import.meta.resolve and non-literal dynamic imports

1 participant