Skip to content

Design parser provider facade layer#748

Draft
mariusvniekerk wants to merge 1 commit into
mainfrom
locate-parser-interface
Draft

Design parser provider facade layer#748
mariusvniekerk wants to merge 1 commit into
mainfrom
locate-parser-interface

Conversation

@mariusvniekerk

Copy link
Copy Markdown
Collaborator

Designs a parser provider facade so discovery, watch routing, lookup, fingerprinting, parsing, incremental parsing, and capability reporting move behind config-bound providers instead of sync-engine switches.

The design keeps normalized ParseResult output and database writes outside providers, preserves provider-owned source shape, keeps ProviderBase as the embedded zero-value optional-method surface, and defines reusable source-set helpers for common JSONL, composite, virtual-path, and database-backed layouts.

Migration work is tracked in kata under parent task terh.

@roborev-ci

roborev-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

roborev: Combined Review (f8a39c8)

Medium-severity documentation issues need correction before merge.

Medium

  • docs/superpowers/specs/2026-06-19-provider-facade-design.md:272

    • The documented Parse example returns a zero ParseOutcome when sess == nil, but the spec later requires explicit SkipReason values to replace implicit nil-session skips. Implementers could produce ambiguous empty outcomes instead of SkipNoSession.
    • Fix: split the error and nil-session branches, and return an explicit skip outcome such as ParseOutcome{SkipReason: SkipNoSession, ResultSetComplete: true} for sess == nil.
  • docs/superpowers/specs/2026-06-19-provider-facade-design.md:578

    • The spec says successful complete parses may write a “clean skip-cache entry,” but the existing persisted skip cache is mtime-only and intended for parse errors/non-session skips, not successful current parses. Reusing it for clean successes would bypass future parser data-version reparses.
    • Fix: clarify that successful clean parses update session source metadata and data versions, while the persisted skip cache remains reserved for explicit skipped/error outcomes unless a schema-backed data-version-aware cache is introduced.

Panel: ci_default_security | Synthesis: codex, 8s | Members: codex_default (codex/default, done, 3m18s), codex_security (codex/security, done, 8s) | Total: 3m34s

@mariusvniekerk mariusvniekerk force-pushed the locate-parser-interface branch from f8a39c8 to 204a879 Compare June 19, 2026 18:45
@roborev-ci

roborev-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

roborev: Combined Review (204a879)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 2m12s), codex_security (codex/security, done, 11s) | Total: 2m23s

@roborev-ci

roborev-ci Bot commented Jun 20, 2026

Copy link
Copy Markdown

roborev: Combined Review (3632277)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (claude-code/default, done, 1m56s), codex_security (claude-code/security, done, 18s) | Total: 2m14s

@mariusvniekerk

mariusvniekerk commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator Author

This change is part of the following stack:

Change managed by git-spice.

@roborev-ci

roborev-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown

roborev: Combined Review (3d2b79d)

No issues found.


Panel: ci_default_security | Synthesis: codex | Members: codex_default (codex/default, done, 13s), codex_security (codex/security, done, 9s) | Total: 22s

Parser integration has grown across registry callbacks, sync-engine switches, and provider-specific source handling. This design captures a shared provider facade so future parser work has one contract for discovery, fingerprinting, parsing, capabilities, and source lookup while preserving current normalized output types and sync semantics.

It also records the decision to keep source shape provider-owned, provide reusable JSONL source helpers, migrate every existing provider, and use enumer-generated capability support values for readable JSON reporting.

docs(parser): clarify provider embedding pattern

The provider facade design was intended to use embedded defaults, but the written spec did not show that pattern concretely enough. Add explicit provider examples so new provider implementations start from ProviderBase and embed or delegate source helper types instead of treating the facade as a loose collection of functions.

docs(parser): harden provider facade contract

The provider facade spec needed sharper boundaries before implementation: providers must be root-bound instances, source lookup cannot assume persisted paths are real files, and parse outcomes need to preserve retry eligibility without corrupting data-version state.

This keeps ProviderBase as the single embedded no-op surface while making reusable source discovery plain composition with explicit forwarding, so new provider work has a predictable contract without a hidden hook layer.

Validation: rg stale contract terms; git diff --check.

docs(parser): clarify provider facade edge cases

The provider facade contract still had ambiguity around mixed multi-session outcomes, fresh source lookup, changed-path filtering, and migration staging. Those gaps would let different provider migrations handle retries, diagnostics, and lookup callers differently.

This follow-up makes data-version state per parsed result, defines fresh-source resolution without assuming filesystem paths, gives fingerprint performance criteria, and splits caller migration into reviewable stages.

Validation: rg stale contract terms; git diff --check. Go tests not run because this is docs-only.

docs(parser): require provider config snapshots

Provider instances are meant to be root-bound and immutable after construction. The examples now show ProviderConfig cloning so helper roots and ProviderBase.Config cannot share a mutable caller slice.

Validation: rg stale contract terms; git diff --check. Go tests not run because this is docs-only.

docs(parser): define partial source failure semantics

Multi-session providers need an unambiguous rule for retryable session failures. The spec now requires SourceError.SessionID for per-session errors, routes unknown-scope failures to whole-source errors, and preserves absent rows during partial parses unless the provider explicitly excludes or cleanly replaces them.

Validation: rg stale contract terms; git diff --check. Go tests not run because this is docs-only.

docs(parser): tighten provider retry cache semantics

Provider results now have per-session retry state, but skip-cache persistence remains source-scoped. The spec now makes that aggregate rule explicit and also requires independent root-slice ownership between ProviderBase config and source helpers.

Validation: rg stale contract terms; git diff --check. Go tests not run because this is docs-only.

docs(parser): require complete results for clean source skips

Per-result retry state does not make skip-cache entries per-result. The spec now requires providers to declare a complete result set before the engine can persist a clean source/fingerprint skip, and keeps failures as diagnostic or failure-cache state instead of clean source state.

Validation: rg stale contract terms; git diff --check. Go tests not run because this is docs-only.

docs(parser): define provider contract edge cases

Provider migration depends on source references being fingerprintable, outcome IDs being comparable to persisted rows, and incremental parsing having unambiguous fallback semantics. Without those rules, a new provider could satisfy the facade shape while diverging in skip-cache, retry, or caller migration behavior.

This also records provider concurrency and SourceRef lifetime requirements so helpers can stay plain data holders while engine callers can safely share one provider instance.

docs(parser): require dual-run provider migration

Provider branches need to prove migration, not just add parallel provider implementations. Documenting the root dual-run harness, manifest opt-in, and stack-tip-only legacy removal gives each PR an obvious review surface while preserving legacy sync as the writer during the stack.

Validation: git diff --check; spec self-review for placeholders and stale defaulting language; mdformat hook formatting.
@mariusvniekerk mariusvniekerk force-pushed the locate-parser-interface branch from 3d2b79d to 833ccf4 Compare June 25, 2026 05:47
@roborev-ci

roborev-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown

roborev: Combined Review (833ccf4)

No Medium, High, or Critical findings; the documentation-only change looks clean at the requested severity threshold.


Panel: ci_default_security | Synthesis: codex, 4s | Members: codex_default (codex/default, done, 1m31s), codex_security (codex/security, done, 10s) | Total: 1m45s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant