feat(classification): generated-code exclusion + PII policy enforcement (6.5, D5/G7)#56
Merged
officialCodeWork merged 1 commit intoJul 16, 2026
Conversation
…nt (6.5, D5/G7) Machine-generated code is retained as lineage/API metadata but kept out of match candidates, and the screenshot-privacy policy is enforced in CI. - isGeneratedFile classifies files by __generated__//generated/ path segment, .generated./.gen. filename infix, @generated/DO NOT EDIT banner, or a minified (>=3000-char) line. A post-pass tags component/hook nodes with a `generated` flag (function + class components + hooks, uniformly). - matchComponents drops `generated` components from the candidate pool and IDF corpus; their nodes/edges (incl. data sources) stay for tracing. - docs/security.md states the G7 PII policy; packages/vision/src/policy.test.ts enforces it — greps vision source for fs-write/image-persistence APIs and asserts the package never imports fs. - New fixture d5-generated-code: path- and banner-classified generated components trace to endpoints but decline on their text; the hand-written component matches and isn't poisoned by generated text in the query. 6 parser-react + 7 vision tests; eval 314/0/0/0, determinism 1.000, all metrics 1.000; typecheck + lint clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 6.5 — Generated/vendored classification & PII policy (failure modes D5, G7)
Closes the D5/G7 criteria of the Phase 6 gate.
Generated-code classification (D5)
Machine-generated code is retained in the graph as lineage / API metadata but excluded from match candidates — it is not authored UI, so a screenshot or ticket must never resolve to it.
isGeneratedFileclassifies a file by:__generated__/orgenerated/directory segment, or a.generated./.gen.filename infix;@generated/DO NOT EDIT/AUTO-GENERATEDbanner in the file head;generatedflag (uniform across function components, class components, hooks).matchComponentsdropsgeneratedcomponents from the candidate pool and the IDF corpus; their nodes/edges — including data sources — stay for tracing.PII policy (G7)
docs/security.md: screenshots are ephemeral (processed in memory, never written/embedded/logged); the graph and corrections store hold terms only, never images.packages/vision/src/policy.test.ts— greps the vision source for filesystem-write / image-persistence APIs (writeFile*,appendFile*,createWriteStream,toDataURL, …) and asserts the package never importsfs. Fails CI on regression.Fixture
d5-generated-code: path-classifiedGlyphCatalog+ banner/filename-classifiedSchemaViewer+ hand-writtenRevenuePanel. Both generated components trace to their endpoints yet decline on their rendered text;RevenuePanelmatches and is not poisoned by generated text mixed into the query.Verification
pnpm eval→ 314 pass · 0 fail · determinism 1.000 · all metrics 1.000pnpm typecheck,pnpm lintgreen.Tracker updated. 6.1 / 6.2 / 6.4 still to land for the full lifecycle phase.
🤖 Generated with Claude Code