Skip to content
This repository was archived by the owner on Jul 23, 2026. It is now read-only.

fix(002): stop shipping the template website/ into produced apps#25

Merged
bartekus merged 1 commit into
mainfrom
drop-template-website-from-scaffold
Jul 10, 2026
Merged

fix(002): stop shipping the template website/ into produced apps#25
bartekus merged 1 commit into
mainfrom
drop-template-website-from-scaffold

Conversation

@bartekus

Copy link
Copy Markdown
Contributor

Problem

Every produced tenant app shipped with the template's own Docusaurus documentation site (website/, baseUrl: /template-encore/, title: acme-vue-encore) at its repo root. That site documents template-encore itself; it has no runtime role in a generated app.

Root cause: the born-with carry-forward classifier (adapters/acme-vue-encore/scripts/lib/born-with.ts) is whitelist-by-default. Any top-level entry not in a skip set falls through classifyEntry to the 'app' classification and is copied into the produced app. website/ was in no skip set, so it leaked, and nothing tested for its absence.

Fix

  • Add 'website' to GENERATOR_ARTIFACT_TOP_LEVEL (the same treatment as scripts / modules / orchestration / .derived).
  • Seed a website/ entry in the synthetic baseline fixture (makeBaselineFixture) and add a negative assertion to setup-app.test.ts, so the drop is actually exercised rather than vacuously true.

Deliberately not touched

  • requirements/ stays: it is the factory pipeline's output location (per stagecraft importArtifacts.ts, which deliberately excludes it from knowledge ingestion), not a leak.
  • specs/ 000-018 stays: it is the intended born-with spec kernel that the produced app's own CI (spec-spine index check, coupling) needs.

Verification

  • All 19 setup-app carry-forward tests pass (including the new website assertion).
  • Full local CI green: typecheck + 185 tests + lockstep (14 pinned units verified against the baseline).
  • Coupling gate clean (the scripts/ files are not spec-claimed paths).

@github-actions

Copy link
Copy Markdown

AI Code Review

Coupling gate violation

specs/002-encore-generator-core/spec.md line 103 explicitly names GENERATOR_ARTIFACT_TOP_LEVEL as the canonical carry classifier (a spec-claimed code path). Adding 'website' to that set in born-with.ts is a behavioral change to a governed constant. The diff contains no changes under specs/. Per the coupling-gate discipline, the owning spec.md must change in the same PR; without it, spec-spine couple will flag a stale claim and the coupling gate will be red.

Fix: Add a line to specs/002-encore-generator-core/spec.md documenting that website/ (the template's own Docusaurus docs site) is classified as a generator artifact and excluded from produced apps. A one-sentence addition to the GENERATOR_ARTIFACT_TOP_LEVEL paragraph at FR-001 is sufficient.


Everything else looks correct

  • Logic: Adding the literal string 'website' to a ReadonlySet that guards top-level directory names is the right, minimal fix. No path-traversal risk; the set contains simple names used only in equality checks against path.basename results at the copy-walk boundary.
  • Test fixture: writeFile(root, 'website/docusaurus.config.ts', ...) correctly seeds the fixture, and the assertion fs.existsSync(path.join(dest, 'website')) correctly verifies absence. Coverage is adequate.
  • Lockstep (baseline.lock.json): Does not reference GENERATOR_ARTIFACT_TOP_LEVEL or the born-with set. No update needed.
  • Comment style: The multi-line // continuation in born-with.ts is visually detached from its entry. Not a bug, but the house style prefers minimal comments; a single trailing comment would be cleaner.

Automated review by Claude. Diff size: 13 lines.

The born-with carry-forward classifier (born-with.ts) is whitelist-by-default: any top-level entry not in a skip set falls through to the 'app' classification and is copied into every produced app. The template's own Docusaurus docs site (website/, baseUrl /template-encore/, title acme-vue-encore) matched no skip set, so it shipped into every generated tenant repo despite having no runtime role there.

Add 'website' to GENERATOR_ARTIFACT_TOP_LEVEL (same treatment as scripts/modules/orchestration/.derived). Seed a website/ entry in the synthetic baseline fixture and add a negative assertion so the drop is exercised, not vacuously true.

requirements/ is deliberately NOT touched: it is the factory pipeline's output location (per stagecraft importArtifacts.ts), not a leak. specs/ 000-018 stays: it is the intended born-with spec kernel. All 19 setup-app tests pass; full CI (typecheck + 185 tests + lockstep) green.
@bartekus
bartekus force-pushed the drop-template-website-from-scaffold branch from 2dc1815 to 7bd3cd5 Compare July 10, 2026 02:20
@bartekus
bartekus enabled auto-merge (squash) July 10, 2026 02:21
@github-actions

Copy link
Copy Markdown

AI Code Review

Review

No security issues

The change adds a single string to a ReadonlySet<string> used as a membership filter. It introduces no new path operations, external inputs, or string construction.

No lockstep concern

baseline.lock.json pins only template-encore's own app-invariant specs (001-encore-app-architecture and 002-security-data-invariants in the template's numbering). 002-encore-generator-core is a factory-encore meta-spec and is not in the pin; the spec amendment here does not trigger a lockstep failure.

Coupling gate: satisfied

born-with.ts + spec.md + the derived shard hash all move together in one PR. The amendment is dated 2026-07-09; the fixture and test land in the same commit. No gap.

Style violations (house rules)

CLAUDE.md: "Never write multi-paragraph docstrings or multi-line comment blocks — one short line max."

Three violations in this diff:

born-with.ts - 4-line inline comment on the 'website' entry:

'website', // Docusaurus documentation site FOR the template itself (baseUrl
// `/template-encore/`, title `acme-vue-encore`): template-dev docs with no
// runtime role in a produced app. Without this it fell through to the default
// `app` classification and shipped into every generated repo.

Should be trimmed to one line, e.g. // template-dev Docusaurus site; no role in a produced app.

setup-app.test.ts - 2-line comment block before the loop; trim to one line.

test-helpers.ts - 2-line comment block on the fixture writeFile; trim to one line.

Logic: correct set

GENERATOR_ARTIFACT_TOP_LEVEL is the right home for website/. The classifyEntry priority chain is: SKIP_ANYWHERE -> GENERATOR_ARTIFACT_TOP_LEVEL -> specs/ special case -> BORN_WITH_KERNEL_TOP_LEVEL -> default 'app'. website/ is not a governance substrate (BORN_WITH_KERNEL_TOP_LEVEL) and is not node_modules/.git (SKIP_ANYWHERE), so this set is the only correct placement.

Minor: spec amendment meta-commentary

The last line of the spec amendment ("Couples the born-with policy change to its owning spec per the coupling gate") is process narration, not a spec requirement. Strip it; the amendment content above it already demonstrates the coupling.


Automated review by Claude. Diff size: 30 lines.

@bartekus
bartekus merged commit 3d900fd into main Jul 10, 2026
7 checks passed
@bartekus
bartekus deleted the drop-template-website-from-scaffold branch July 10, 2026 02:23
bartekus added a commit that referenced this pull request Jul 10, 2026
…uced apps (#26)

#25 stripped website/ from produced tenant apps but left template-encore's spec
016-docs-website, which establishes website/ and .github/workflows/deploy-docs.yml.
Every scaffold then carried a spec whose established artifact was gone, so the
produced app's own `spec-spine index` emitted I-004 for the missing website/ unit
and the fail-closed `index check` in stagecraft's per-request scaffold rejected it,
orphaning the job:

  index is STALE ... stale shard(s): by-spec/016-docs-website (blocking diagnostics)

This blocked all new project creation. The stagecraft gate was correct; the drift
was the incomplete #25 cleanup.

- born-with.ts: add TEMPLATE_DEV_SPEC_IDS (016-docs-website), consulted alongside
  GENERATOR_META_SPEC_IDS in classifyEntry's specs/ branch.
- setup-app.ts: drop the orphaned .github/workflows/deploy-docs.yml in the copy
  walk (other workflows stay born-with the app).
- fixture + setup-app.test.ts: seed the spec + a kept/dropped workflow pair, with
  negative assertions.
- amend spec 002; regenerate the 002 registry + index shards.

Verified: produced tree now passes compile -> index -> index check (0 diagnostics,
"index is fresh", exit 0); full adapter suite 186/186.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant