Skip to content

[finding] The scaffold-comment pin's MONOREPO_ONLY vocabulary has no pattern for monorepo-RELATIVE paths, so ../../content/docs in a scaffolded README ships green #15150

Description

@os-trump

Found while widening init-template-comments-self-contained.test.ts to a two-source population (#14823). Out of that card's scope by its own terminal fence — "reusing the three assertions unchanged" — so filed rather than acted on, and unassigned.

Measured, on origin/main e37456eb03, with the widened pin in place

The widened pin sweeps both scaffolders and is green. It is green partly because its assertion-1 vocabulary cannot see one shape that is present in the swept text right now.

MONOREPO_ONLY is four patterns:

{ label: 'an ADR identifier',        re: /\bADR-\d{3,4}\b/ },
{ label: 'a bare issue number',      re: /(^|[^\w/])#\d{3,6}\b/ },
{ label: 'a repo build-script path', re: /\bscripts\/[\w.-]+\.(?:mjs|mts|cjs|ts|js)\b/ },
{ label: 'a monorepo package path',  re: /\bpackages\/[a-z0-9][\w-]*\//i },

Every one of them matches an absolute-ish, repo-rooted spelling. None matches a path that climbs out of the scaffolded project with ../. So this, rendered by os create example into the project's README.md (create.ts:182, :183), is swept and passes:

- [ObjectStack Documentation](../../content/docs)
- [Examples](../)

A scaffolded project has no ../../content/docs and no sibling examples/ tree. It is the same defect class the pin exists to close — a reference the reader cannot follow — one spelling over. The pin reports on it and says nothing, which is worse than not reporting on it: the file appears in the sweep's own output as a passing row.

Positive control that this is a vocabulary gap and not a population gap: injecting ADR-0999 into that same create literal does redden create:example/objectstack.config.ts, so the file is genuinely in the population and genuinely being read.

Why this is filed separately rather than fixed in #14823

Widening a sweep's POPULATION and widening its VOCABULARY are two changes with two review questions, and #14823's triage fenced the second one out explicitly. The vocabulary question also has a cost the population question did not: \.\./ is common in legitimate emitted TypeScript (relative imports inside the scaffolded project itself, ./src/objects, and extends targets), so a naive pattern would redden text that is correct. It needs its own design — probably "a ../ that climbs ABOVE the project root", judged on depth the way check:cross-package-test-inputs judges the shallowest point a path reaches, not a bare \.\./ grep.

Relationship to the other two cards, stated so nobody merges them

⇒ The durable unit of work here is the pattern, not the two README lines. Grading it should probably wait on #14824 only insofar as the create instances do; the init exposure stands on its own.

Shape of the fix, if graded queueable

Add a fifth MONOREPO_ONLY entry for a project-escaping relative path, designed against the false-positive set above, and re-run the widened pin — expecting it to go red on create:example/README.md and to stay green on every init template. The repair of whatever it catches is a third change again, not this one.

Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions