Skip to content

Delete the function the docs-gate fix orphaned, and pin display-name uniqueness - #444

Merged
moritzhartmeier merged 1 commit into
mainfrom
fix/docs-gate-deadcode-and-display-uniqueness
Sep 22, 2026
Merged

moritzhartmeier merged 1 commit into
mainfrom
fix/docs-gate-deadcode-and-display-uniqueness

Conversation

@eugenia-scandit

Copy link
Copy Markdown
Collaborator

Two small follow-ups to #430, split out so that PR could keep the approval it had already earned. Both were found by a review round that ran after #430 was approved; neither is urgent, and neither changes behaviour today.

Base note: this targets fix/framework-frontmatter-ssot so the diff shows only these two files. GitHub retargets it to main automatically once #430 merges.

1. shQuiet() is dead, and a comment still points at it

#430's last commit replaced frontmatterOnly's only shQuiet call with execFileSync("git", [...]) — deliberately, to stop interpolating a git-derived path into a shell string — but left the function defined and left the call-site comment reading "see the note on shQuiet".

The cost is not the dead function, it is the instruction attached to it: the next reader is told stderr suppression comes from shQuiet, goes looking, finds nothing calling it, and if they "restore" the call they reintroduce exactly the class #430 removed.

Deleted. The comment now says what actually suppresses the noise — stdio: ["ignore", "pipe", "ignore"] — and why there is noise to suppress: a file the PR adds has no base blob, so git prints fatal: path ... exists on disk, but not in ... once per new page. That failure is expected and handled (the catch treats the file as body-changed, which is right for a new file), but forty such lines ahead of the gate's own output reads as a crashed gate rather than as forty new pages.

2. display is a map key in four places and nothing pinned its uniqueness

slug uniqueness was asserted. display was not, despite being keyed off in:

  • FRAMEWORK_URL_PATH and FRAMEWORK_SLUG (SkillsCallout)
  • FRAMEWORK_DISPLAY_TO_SLUG (utils/frameworks.ts)
  • the features.json / products.json / skills.json cross-check in verify-frameworks.cjs

The field's own doc comment already says "Used as a map key by SkillsCallout, so it is load-bearing."

A duplicate is easy to introduce — a copy-pasted entry whose display was not updated. Object.fromEntries silently keeps only the last one, so SkillsCallout would build the other framework's /sdks/<routeSegment>/agent-skills link and report the wrong framework to analytics. yarn verify:frameworks stays green throughout, because it only ever asks whether a display is in the registry, never whether it appears once.

Verification

  • yarn test:frameworks → 17 passed (16 + the new row)
  • yarn test:docs-gate → 37 passed
  • yarn verify:frameworks → OK
  • npx tsc --noEmit → clean
  • Mutation-tested: changing linux's display to "Web" fails the new assertion. It bites.

🤖 Generated with Claude Code

Base automatically changed from fix/framework-frontmatter-ssot to main September 22, 2026 10:41
The previous commit replaced frontmatterOnly's only shQuiet call with
execFileSync and left shQuiet defined, called by nothing - and left the
call-site comment reading "see the note on shQuiet". So the next reader is
told stderr suppression comes from a function that no longer participates,
goes looking for it, and finds dead code; and if they "restore" the call
they reintroduce the shell-string interpolation of a git-derived path that
the same commit removed on purpose. Deleted, and the comment now says what
actually suppresses the noise: stdio ["ignore", "pipe", "ignore"], and why
that noise exists at all - a file the PR ADDS has no base blob, so git
prints a fatal line per new page and forty of them ahead of the gate's
output reads as a crash rather than as forty new pages.

`display` is a map key in four places - FRAMEWORK_URL_PATH and
FRAMEWORK_SLUG in SkillsCallout, FRAMEWORK_DISPLAY_TO_SLUG in
utils/frameworks.ts, and the features/products/skills cross-check in
verify-frameworks.cjs - and its own doc comment says so. Nothing enforced
that it is unique, while `slug` uniqueness was pinned. A duplicate is easy
to introduce from a copy-pasted entry, Object.fromEntries silently keeps
the last one, and SkillsCallout would then build the OTHER framework's
agent-skills link and report the wrong framework to analytics -
with verify:frameworks still green, because it only asks whether a display
is IN the registry, never whether it appears once. Now pinned, and
mutation-checked: duplicating a display fails the new row.

test:frameworks 17 passed, test:docs-gate 37 passed, verify:frameworks OK,
tsc clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@moritzhartmeier
moritzhartmeier force-pushed the fix/docs-gate-deadcode-and-display-uniqueness branch from 57ee573 to 7348bbc Compare September 22, 2026 10:44
@moritzhartmeier

Copy link
Copy Markdown
Member

Heads-up: I force-pushed this branch to clear the conflicts. Previous head was 57ee573a4 if you need to recover anything.

Cause: #430 was squash-merged, so main got the whole thing as a single commit (804180a1e) while this branch still carried the 30 original commits. Retargeted from fix/framework-frontmatter-ssot to main, it was replaying work already in main — hence 136 changed files and the conflicts. Nothing was actually wrong with your change.

What I did: cherry-picked your 57ee573a4 onto current main and dropped the inherited history. It applied cleanly, no conflict resolution, and your authorship is intact:

git checkout -b <branch> origin/main
git cherry-pick 57ee573a4

This PR is now 1 commit, 2 files, +29 -14 — just the change you meant it to be, and MERGEABLE.

Verified on the rebased tree before pushing: no shQuiet references remain anywhere under scripts/, test:frameworks 17 passed, test:docs-gate 37 passed. I also checked the new uniqueness test earns its place rather than trusting the comment — injecting a duplicate display (Cordova -> iOS) fails it loudly, and FRAMEWORK_DISPLAY_TO_SLUG really is an Object.fromEntries keyed on display, so the silent last-wins overwrite you describe is real.

If you had local work on top of the old head, git fetch && git reset --hard origin/<branch> and re-apply.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-22 10:49 UTC

@moritzhartmeier
moritzhartmeier merged commit 0efef58 into main Sep 22, 2026
5 checks passed
@moritzhartmeier
moritzhartmeier deleted the fix/docs-gate-deadcode-and-display-uniqueness branch September 22, 2026 10:48
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.

2 participants