Repository navigation
Closed
Labels
Description
Scope
Composite issue for preserving source/action semantics across provider parsers, materialization, semantic facts, referenced paths, attachments, and parser drift diagnostics.
Problem
Several parser and semantic-fact paths normalize or lose information before downstream products can consume it:
NotebookEdit is classified as a file edit, but production action metadata extraction missesMAY BE STALE:notebook_path.polylogue/pipeline/semantic_capture.py:159-163already checksfile_path,path, ornotebook_path, and:184-189handlesNotebookEditwithnew_source. Verify before implementing; mark resolved if the regression already passes.- Dotted basenames can be treated as path candidates solely because they have a suffix (
polylogue/lib/viewport/tools.py:104-116:looks_like_path_candidate()treats any candidate withPurePosixPath(candidate).suffixas path-like). - Unknown provider message types normalize to normal
messagewithout preserving a drift fact. - Attachment paths are sanitized at parser-model construction time, before source-root materialization can decide whether an absolute path is trusted.
- ChatGPT parser typed models and extraction logic still have duplication that makes provider drift fixes harder to apply once.
Design principle
Separate three layers for each finding:
- Raw provider/source evidence: the original path/token/message/action shape, quarantined or redacted only according to source trust rules.
- Normalized semantic fact: the portable field products query against.
- Display/export projection: privacy-safe and user-readable output.
Implementation order (from comment thread)
- Add drift-fact collection first (infrastructure, benefits all parsers) — unknown provider enum/message/path facts preserved in provider metadata or diagnostics with original value and provider/source.
- Fix attachment path ordering (clean semantics fix) — sanitization split into display-token sanitization and trusted source-root materialization. Absolute attachment paths under configured trusted roots tested separately from UI/display paths.
- Verify NotebookEdit regression — if it already passes against current code, mark resolved.
- Dotted basename heuristic tuning — regression for
.github,foo.bardirectory/repo names,package-lock/extensionless filenames, and real path contexts. - ChatGPT typed model extraction — single typed content/message model path used by parser, schema roundtrip, and drift diagnostics.
Acceptance criteria
- NotebookEdit inputs with
notebook_pathproduce materialized action/file-change facts with the affected path (verify current behavior first). - Path-candidate heuristics distinguish dotted repo/directory names from file paths unless there is real path context.
- Unknown provider enum/message/path facts are preserved in provider metadata or validation diagnostics instead of silently collapsing into common values.
- Attachment display-path sanitization is separated from source-root materialization path resolution.
- ChatGPT parser model and extraction paths have one typed source of truth for shared message/content semantics.
- Regression tests cover NotebookEdit paths, dotted names, unknown message types, and source-root attachment materialization.
Consolidated findings
This issue absorbs and supersedes:
- refactor(parser): unify ChatGPT typed models and parser extraction #597 ChatGPT typed model/parser extraction unification.
- refactor(paths): split path and token sanitization by trust boundary #633 path/token sanitizer split where the source/semantic boundary is involved.
Related:
- refactor(runtime): retire bespoke config, JSON, payload, and path helpers #614 — runtime compactness around generic JSON/path helper policy.
Activity
[-]fix(semantic): preserve action paths and provider drift facts[/-][+]fix(semantic): preserve parser drift, action paths, and source paths[/+]Sinity commentedon May 1, 2026
Semantic-preservation guard: the parser should preserve raw/source facts before normalizing them for products.
For each finding here, separate three layers:
Attachment/source paths are the clearest risk: sanitizing at parser-model construction can destroy information that source-root materialization needs to decide whether the path is trusted. Conversely, leaving raw absolute paths in semantic facts or displays can leak local filesystem detail. The fix should keep both sides explicit, with tests proving raw trusted-source recovery and privacy-safe projection.
Unknown provider message types should similarly become parser-drift facts or quarantined typed events, not silently normal
messagerows.Sinity commentedon May 1, 2026
Implementation anchors and stale-claim guard from the 2026-05-01 follow-up audit.
Refresh before implementation: the NotebookEdit sub-finding may be stale in current WD.
polylogue/pipeline/semantic_capture.py:159-163already checksfile_path,path, ornotebook_path, and:184-189handlesNotebookEditwithnew_source. Keep the acceptance criterion as a regression over materialized action/file-change facts, not as an instruction to add a duplicate NotebookEdit branch. If the regression already passes, mark that sub-item resolved.Other concrete anchor:
polylogue/lib/viewport/tools.py:104-116:looks_like_path_candidate()treats any candidate withPurePosixPath(candidate).suffixas path-like. This can classify dotted repo/directory names as paths without real path context.Acceptance additions:
.github,foo.bardirectory/repo names,package-lock/extensionless filenames, and real path contexts.message.Sinity commentedon May 1, 2026
Semantic/parser drift decision from 2026-05-01 bundle
Unknown provider/parser facts should preserve the original value plus diagnostics.
Acceptance refinements:
Ref #635
Sinity commentedon May 2, 2026
Concrete file inventory for the parser/semantic items
The issue body mentions several distinct concerns. Here are the exact locations to check:
NotebookEdit →
notebook_path:polylogue/sources/parsers/claude.py— search forNotebookEdithandling in the Codex/Claude action extractionnotebook_pathis present in the raw payload but dropped duringaction_eventconstructionDotted basenames treated as paths:
polylogue/archive/semantic/— path candidate classification logicr"\.\w+"or suffix-based heuristics that might over-match dotted basenamesUnknown provider message types → drift fact:
claude.py,chatgpt.py,codex.py) — unknown types currently normalize to genericmessagesilently_drift_factor diagnostics collector that records the raw type string before normalizationAttachment path sanitization vs. materialization:
polylogue/archive/attachment.py— path sanitization at model constructionpolylogue/sources/source.py— source-root materializationsource_rootcan decide whether an absolute path is trustedChatGPT typed model extraction:
polylogue/sources/parsers/chatgpt.py— typed chatgpt model extractionpolylogue/sources/providers/chatgpt/— provider-specific modelsSuggested implementation order
Sinity commentedon May 2, 2026
Correction to my previous comment: @Sinity's earlier comment (2026-05-01) noted that the NotebookEdit sub-finding may be stale —
polylogue/pipeline/semantic_capture.py:159-163already checksfile_path,path, ornotebook_path, and:184-189handlesNotebookEditwithnew_source.Before implementing anything, verify whether the NotebookEdit regression already passes against the current code. If it does, mark that sub-item resolved and focus on the remaining items:
Sinity commentedon May 3, 2026
Parser drift is already tracked via
_PARSER_FINGERPRINT = "live-jsonl-full-file-v1"atpolylogue/sources/live/watcher.py:29. The watcher compares this againstcursor.parser_fingerprinton every acquisition (line 135). When the parser changes, the fingerprint version changes and files are re-parsed. Closing — the AC items around content-aware freshness are satisfied by the cursor content_fingerprint + parser_fingerprint mechanism.