Skip to content

ci: wire the two dead cockpit spec files into targets CI actually runs - #936

Merged
blove merged 1 commit into
mainfrom
blove/wire-dead-specs
Sep 1, 2026
Merged

ci: wire the two dead cockpit spec files into targets CI actually runs#936
blove merged 1 commit into
mainfrom
blove/wire-dead-specs

Conversation

@blove

@blove blove commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Two spec files were executed by nothing. Both are wired in — neither deleted.

Spec Verdict Now runs under
cockpit/deep-agents/footprint.spec.ts wire in nx test cockpit (glob, per #918)
libs/cockpit-docs/src/lib/docs-bundle.spec.ts wire in nx test cockpit-docs (new target, per #916)

On /docs/deep-agents

When I opened this PR the library did not exist. #937 landed it while this PR was in CI, so this branch is rebased onto it — and it confirms the call below rather than overturning it.

The new library is six pages shaped deep-agents/capabilities/<topic>.mdx and deep-agents/getting-started/introduction.mdx — the three-segment guide shape. The spec asserted deep-agents/core-capabilities/<topic>/python/<page>.mdx. Those assertions would still fail against main today, now for the same reason as chat and render: the website is organised by guide, not by cockpit topic.

#937 also rewired the six deep-agents sentinels to real targets, leaving COCKPIT_TOPICS_WITHOUT_DOCS empty so that blanking anything now fails. Worth recording that I had drafted an inverted "no docs library yet" tripwire and dropped it before pushing — it would be red on main today. The generic guard #937 strengthened is the right home for this, not a footprint spec.

Three further gaps surfaced while wiring

1. cockpit-docs and cockpit-registry were both unreachable. Adding a test target to cockpit-docs mirroring its cockpit-registry sibling would have been dead on arrival: nx test does not walk ^test, and the library job runs a hardcoded LIBS: chat,langgraph,ag-ui,render,a2ui,telemetry. npx nx test cockpit-registry appears nowhere in any workflow, so its three specs (manifest, validate-manifest, resolve-language) had never run either. The cockpit job now uses nx run-many -t test --projects=cockpit,cockpit-docs,cockpit-registry.

2. The footprint specs would have passed vacuously. They resolved paths from process.cwd(), which under nx test cockpit is apps/cockpit, not the repo root. Wired in unchanged, the new deep-agents assertion pointed at apps/cockpit/apps/website/... and passed green while asserting nothing. They now resolve from import.meta.url.

3. ci-scope could not see them. cockpit/<product>/*.spec.ts sits outside every project root, so nx affected attributes it to root, which carries only npm:private — no scope: tag. A PR touching only these specs produced an empty scope and skipped the job that runs them (inherited from #918, which affected the matrix specs too). ci-scope.mjs now maps them onto the cockpit scope by path.

The stale assertions, and why removing them is not weakening

All three footprint specs (chat, render, deep-agents — the latter two were also unwired) asserted a website page per topic at content/docs/<product>/core-capabilities/<topic>/python/<page>.mdx. That is the five-segment shape #918 deleted. From libs/cockpit-registry/src/lib/docs-links.ts:

An earlier five-segment formula (/docs/<product>/core-capabilities/<topic>/overview/<language>) produced a URL that 404s for every product.

The website tree is organised by guide (chat/{components,guides,getting-started}/*.mdx), not by cockpit topic. Every one of those ~90 assertions was describing a layout the website has never served. For deep-agents specifically, docs-links.ts mapped all six topics to NO_COCKPIT_DOCS_LINK; #937 has since pointed them at real pages — at the guide-shaped URLs, not the five-segment ones.

I removed them rather than inverting them into a tripwire, because the coverage already exists and is stronger: apps/cockpit/src/lib/docs-links.spec.ts (7 tests, already running) checks every non-sentinel link against the website's actual content tree and nav config, and asserts the blanked set equals COCKPIT_TOPICS_WITHOUT_DOCS so nobody can silently blank an entry. What remains in the footprint specs is what "footprint" means: the cockpit modules exist and are runnable. Those assertions were already true on main and are unchanged.

Coverage lost: nothing that was running, and nothing another running spec does not cover better.

Verification

Mutation-tested — each broken, observed red through the CI-visible target, restored:

Mutation Target Result
'planning''planning-BROKEN' nx test cockpit exit 1, ENOENT .../planning-BROKEN/python/project.json (path proves root resolution)
page count 56 nx run-many (exact CI cmd) exit 1, Failed tasks: cockpit-docs:test
drop cockpit-docs from ci.yml node --test ci-workflow.spec.mjs not ok 15 - runs the cockpit sibling libraries…
neuter COCKPIT_ROOTLESS_SPEC node --test ci-scope.spec.mjs 5 failures

Green after restore:

  • nx test cockpit45 files / 426 tests, up from 42 / 421 (re-run after the rebase onto Add the /docs/deep-agents website library #937, which touched cockpit-shell.spec.tsx, route-resolution.spec.ts and all five deep-agents src/index.ts)
  • nx test cockpit-docs — 1 file / 4 tests (confirmed non-vacuous by direct vitest count)
  • nx test cockpit-registry — passes
  • node --test ci-scope.spec.mjs ci-workflow.spec.mjs — 85 pass / 0 fail
  • nx build cockpit-docs — passes (spec still excluded from tsconfig.lib.json)

Reachability traced through the real classifier: footprint-only PR → cockpit=true (cockpit_e2e stays false); docs-bundle PR → cockpit=true.

Pre-existing, unrelated: cockpit-shell.spec.tsx "copies sanitized diagnostics…" times out at 5000 ms on my machine (needs ~7.5 s). It fails identically on unmodified main, and passes 19/19 with --testTimeout=30000. Not touched — that is a separate call about the timeout.

Follow-up: a structural guard against this whole class

This repo has now yielded eight unwired suites (website e2e drift, root generator specs, mit-cutover, cockpit matrix specs, these two, the deploy gates measuring at the wrong layer, and cockpit-registry found here). Each was repaired one at a time, after drifting silently.

Proposing as a follow-up, not built here: a meta-spec that enumerates every *.spec.* in the repo and asserts each is matched by some project's vitest include globs (or an explicit, commented allowlist for the node --test suites, which scripts/vite.config.mts already models). It would run in ci-scope, cost seconds, and fail loudly the day a spec lands unowned instead of years later. The allowlist is the design question worth settling before building it — it must be narrow enough that "add it to the allowlist" is not the path of least resistance.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
threadplane Ready Ready Preview Sep 1, 2026 9:57pm UTC

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

`cockpit/deep-agents/footprint.spec.ts` and
`libs/cockpit-docs/src/lib/docs-bundle.spec.ts` were executed by nothing: no
vitest project included the first, and `cockpit-docs` had no `test` target at
all. Both are wired in here, following #916 (give the orphan a target) and
#918 (glob out-of-project cockpit specs into `nx test cockpit`).

Wiring surfaced three further gaps, all fixed:

- `cockpit-docs` and `cockpit-registry` were both unreachable. `nx test` does
  not walk `^test`, and the `library` job runs a hardcoded LIBS list that
  excludes them, so cockpit-registry's three specs had never run either. The
  cockpit job now uses `nx run-many` over all three projects.
- The footprint specs resolved paths from `process.cwd()`, which under
  `nx test cockpit` is `apps/cockpit`. Left as-is they would have asserted
  against `apps/cockpit/cockpit/...` and passed vacuously. They now resolve
  from `import.meta.url`.
- `cockpit/<product>/*.spec.ts` sits outside every project root, so
  `nx affected` attributes it to the untagged `root` project and a PR touching
  only those specs skipped the job that runs them. ci-scope now maps them onto
  the cockpit scope by path.

The website `.mdx` assertions in all three footprint specs asserted the
five-segment docs shape #918 deleted — the one docs-links.ts records as having
"produced a URL that 404s for every product". They are removed, not weakened:
that coupling is a table checked against the website's real content tree by
apps/cockpit/src/lib/docs-links.spec.ts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@blove
blove force-pushed the blove/wire-dead-specs branch from c4b48ae to 78e800e Compare September 1, 2026 21:55
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove merged commit eeb4a17 into main Sep 1, 2026
73 checks passed
@blove
blove deleted the blove/wire-dead-specs branch September 1, 2026 22:25
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.

1 participant