Repository navigation
test(core): keep HTML policy fixtures in sync - #47
Conversation
|
Two-axis review of StandardsNo hard breach of AGENTS.md/CLAUDE.md (review notes stay off-tree), eslint/prettier, core Convention, not a written rule — judgement: Hand-written Exporting Baseline smells (all judgement)Divergent change — export const BLOCKED_TAGS = [ ... ] as const;
if (BLOCKED_TAGS.some((blockedTag) => blockedTag === tagName)) {Speculative generality — those exports (and the Feature envy / mysterious name — Duplicated code — same file then SpecAgainst issue #40: table-test the HTML policy with shared accept/reject fixtures. Do: ``it.each Done when: Adding a blocklist entry without a fixture fails, and the server and seed use the same fixture corpus. (a) Missing / partial
(b) Not asked for
(c) Looks done, implementation wrong
Implementation methodThe ticket asked to Filename + exported constants. Better method. Keep Array + “Real-shaped.” Accept pages are small static sites. Reject pages are the same skeleton plus one pill. Fine as cases; they are not representative published HTML. Protocol tables only assert Server / seed. Upload 422 is only Fixture import. Relative paths skip Coverage claim. “Add a blocklist entry without a fixture fails” is true only for the two newly exported arrays. YAGNIIssue 40 wanted a shared on-disk corpus, Essential: Speculative: runtime kind check, handwritten
Do not add more fixtures, a generator, or a fixtures package. Fix lookup, package export, filename coupling; leave the HTML. Fixture uniqueness (adversarial)Ranked regressions that stay green today:
Intact: adding a Module seams
Summary: Standards: 0 hard violations, 4 smells — worst is production |
|
I checked each finding against the branch. I’m going to address the parts that weaken the intended contract:
I’m not going to make the seed upload reject fixtures: accept-only is intentional for useful local seed data; it still reads the shared corpus through the same loader. I’m also not expanding this ticket into matrices for every URL attribute, CSS-regex arm, empty input, or max-size behavior. Those are either pre-existing coverage gaps or broader policy tests, not the blocklist/fixture-sync contract in #40. I’ll keep the |
|
Addressed the accepted findings in
The intentionally deferred coverage remains as described above. Local verification is green ( |
The HTML policy's hand-written cases left individual blocked tags and protocols unverified, so the policy could change without a representative page. Server tests and local seed data also had no shared set of realistic examples.
This introduces one real-shaped accept/reject corpus in
packages/core. The core tables require a fixture for every exported blocklist entry, while the server upload tests andseed:devcommand consume the same corpus.Closes #40
Verification:
pnpm test(454 tests), affected-package typechecks,pnpm lint, and a localseed:devsmoke run.Implemented with OpenAI Codex GPT-5.6-sol in the Oh My Pi harness.