fix(content-lane): add snake_case aliases to protectedFrontmatterFields - #7478
Conversation
…ds (JSONbored#7445) protectedFrontmatterFields listed every protected field in camelCase only, so an entry that wrote a protected field in the legitimately-accepted snake_case convention (e.g. download_url instead of downloadUrl) was invisible to protectedFrontmatterChanges — the gate compared before["downloadUrl"]/after["downloadUrl"], both undefined, saw no change, and the protected-close never fired even though the underlying value changed. Same divergence class as JSONbored#7250 (urlFields vs sourceUrlFields), already fixed in this repo via PR JSONbored#7269. This adds the 19 snake_case aliases for every multi-word camelCase member (author, category, disclosure, slug are single all-lowercase words and don't need one). Data-only addition to the Set; protectedFrontmatterChanges's comparison logic is untouched. Closes JSONbored#7445
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7478 +/- ##
==========================================
- Coverage 91.36% 91.36% -0.01%
==========================================
Files 717 717
Lines 73022 73022
Branches 21632 21632
==========================================
- Hits 66719 66715 -4
Misses 5265 5265
- Partials 1038 1042 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-20 12:10:28 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Closes #7445
Summary
protectedFrontmatterFields(packages/loopover-engine/src/review/content-lane/content-repo-spec.ts)listed every protected field in camelCase only, so an entry that wrote a protected field in the
legitimately-accepted snake_case convention (e.g.
download_url:instead ofdownloadUrl:) wasinvisible to
protectedFrontmatterChanges(src/review/content-lane/duplicates.ts:154) — the gatecompares
before["downloadUrl"]/after["downloadUrl"]by literal parsed key, bothundefined, seesno change, and the protected-close never fires even though the underlying value actually changed. A
real bypass of the identity/provenance/monetization protected-edit gate, based purely on which naming
convention a submission happens to use.
This is the same divergence class as #7250 (
urlFieldsvssourceUrlFields), already fixed in thisexact file via #7269. This PR mirrors that fix's shape exactly: adds the 19 snake_case aliases for
every multi-word camelCase member of
protectedFrontmatterFields(author,category,disclosure,slugare single all-lowercase words — byte-identical in both conventions, so no separate alias isneeded). Pure data addition to the
Set;protectedFrontmatterChanges's comparison logic and everyother field list in
content-repo-spec.tsare untouched.Scope
site//CNAME/lovable; no new dependency.Closes #7445).Validation
git diff --check— cleannpm run typecheck(root) — cleannpm run engine-parity:drift-check— oknpm run build --workspace @loopover/engine— cleanvitest run --coverage, scoped to the two changed files): 100%statements/branches/functions/lines (193/193, 211/211, 42/42, 175/175)
test/unit/content-lane-*.test.tssuite (11 files, 549 tests) — all passtest/unit/content-lane-duplicates.test.ts: (1) an end-to-endbefore/after
download_url:frontmatter change throughparseSimpleFrontmatteris nowreported by
protectedFrontmatterChanges, matching what the equivalent camelCase-keyed editalready produced; (2) a pairing assertion that every multi-word camelCase member of
protectedFrontmatterFieldshas its snake_case counterpart also present in the set, mirroringcontent-repo-spec's sourceUrlFields omits the snake_case aliases its sibling urlFields already has #7250's
sourceUrlFields/urlFieldspairing-assertion test.If any required check was skipped, explain why:
packages/loopover-engine/src/review/content-lane/content-repo-spec.ts(oneconstant) + its test file;
src/review/content-lane/content-repo-spec.tsis theexport *re-export shim documented in its own header comment and picks up the change automatically — not
duplicated there, per the issue's explicit requirement.
Safety
the protected-close gate recognize the same fields duplicate-detection (
urlFields) already did.