Repository navigation
feat(import): declare Hermes source fidelity - #2789
Conversation
Problem: import explain treated Hermes SQLite databases as opaque bytes and could not distinguish retained source evidence from unavailable or derived fields. What changed: inspect structurally valid Hermes state databases through the production parser, expose a typed per-source fidelity declaration, and mark JSON fallback, cost coverage, message state, runtime spans, and merge evidence with explicit statuses. Compatibility: the new fidelity field is additive on import-explain payloads. Ref polylogue-fs1.3. Co-Authored-By: Claude <[email protected]>
Problem: the fidelity declaration read JSON capability lists as an untyped object, which failed strict type verification. What changed: narrow the source capability payload to a list before testing membership. Ref polylogue-fs1.3. Co-Authored-By: Claude <[email protected]>
Regenerate the import-explain CLI output schema after adding the Hermes fidelity declaration. Ref polylogue-fs1.3. Co-Authored-By: Claude <[email protected]>
|
Warning Review limit reached
Next review available in: 1 minute Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CI triage: the GitHub Actions workflow failures are infrastructure-level. Run |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c4745d654
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) | ||
|
|
||
| fidelity = ( | ||
| _fidelity_payload(hermes_state.import_fidelity_declaration(sessions, acquisition_method="json_fallback")) |
There was a problem hiding this comment.
Preserve sqlite fidelity for state-db markers
When the input is a Hermes state-db marker JSON, dispatch does not use the JSON fallback: _lower_payload_specs lowers it as local_artifact_document (polylogue/sources/dispatch.py:688-689) and _parse_lowered_spec calls parse_state_db_payload (polylogue/sources/dispatch.py:777-778). This unconditional Hermes branch therefore reports acquisition_method=json_fallback, absent retained-blob reproducibility, and missing message-state evidence for a SQLite parse, so import-explain can give operators the opposite fidelity declaration for retained state.db markers.
Useful? React with 👍 / 👎.
| if hermes_state.looks_like_state_db_path(path): | ||
| return _explain_hermes_state_db(path, provider_hint=provider_hint) |
There was a problem hiding this comment.
Include state.db files when explaining Hermes directories
This new state.db parser branch is only reached for candidate paths already yielded by _candidate_paths. For polylogue import --explain ~/.hermes, the CLI calls explain_import_path(path) with the default unknown source (polylogue/cli/commands/import_command.py:243), while the directory walker only yields .db files when provider is Provider.HERMES (polylogue/sources/source_walk.py:38-41), so Hermes state.db under a directory is skipped and the explain output says no supported files instead of exercising this branch.
Useful? React with 👍 / 👎.
…789,2792,2797 d3xj, w8et, w379 (cost-honesty, PR #2776), fs1.3 (hermes-wedge, PR #2789), and f2qv.5 (usage-convergence, PR #2797) fully satisfied — closed. cuxz (temporal-provenance, PR #2786), th0 (test-harness, PR #2777), and fs1.11/ fs1.12 (hermes-wedge cluster, PR #2792) partially satisfied — noted with disposition, left open per closure-discipline (no closing on partial ACs). Co-Authored-By: Claude <[email protected]>
Summary
Add an additive fidelity declaration to import-explain and inspect structurally valid Hermes state.db files through the production parser.
Problem
Hermes SQLite imports had reproducible parser behavior, but import-explain treated their bytes as opaque JSON failures. Operators could not see which states, provenance fields, or runtime evidence were retained versus unavailable.
Solution
Acceptance criteria
Anti-vacuity
test_hermes_state_db_explain_declares_v16_fidelity_and_coveragedrives the production SQLite detector, parser, and fidelity projector. Removing the SQLite explain branch or state/count projection makes it fail.test_hermes_state_db_explain_reports_later_schema_capabilitydrives the parser capability map from a v17-shaped database. Removing repository-capability projection makes it fail.test_hermes_json_fallback_explain_declares_missing_state_evidencedrives the real Hermes JSON detector/parser route. Removing Hermes fallback projection makes it fail.test_hermes_state_db_explain_marks_removed_cost_provenance_absentuses a valid state database with the optional provenance columns omitted. Removing capability-derived fidelity changes the required absent state and caveat.Verification
nix develop --command devtools test tests/unit/sources/test_hermes_import_explain.py tests/unit/sources/test_parsers_local_agent.py tests/unit/mcp/test_server_surfaces.py -k 'hermes or recall or manifest'— 20 passed, 84 deselected.nix develop --command devtools verify --quick— passed all 15 checks, including mypy and render-all.Ref polylogue-fs1.3
Ref polylogue-fs1.11
Ref polylogue-fs1.12