Repository navigation
fix: preserve prior session profiles and bound metadata warnings - #578
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedNext included review available in 16 minutes. View limit detailsLimit details: You’ve used all 8 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (7)
📒 Files selected for processing (18)
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 |
|
| Filename | Overview |
|---|---|
| internal/store/session_creation_profile.go | Accepts historical version 4 profiles while rejecting version 5 ACP selections in version 4 witnesses. |
| internal/logger/failure_warnings.go | Introduces constant-space failure sampling, deterministic fingerprints, and per-scanner warning backoff. |
| internal/session/query_health.go | Adds a read-only scan that validates session metadata and available global creation witnesses. |
| internal/session/query.go | Replaces per-session metadata warnings with one bounded summary per listing scan. |
| internal/memory/dream_workspace.go | Aggregates unreadable metadata encountered during memory consolidation scans. |
| internal/doctor/session_metadata_probe.go | Adds the runtime.session_metadata diagnostic with bounded structured evidence. |
| internal/api/core/doctor_payload.go | Registers the new diagnostic when the production session manager exposes its health source. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Session metadata scan] --> B{Metadata readable?}
B -- No --> C[Add bounded failure sample]
B -- Yes --> D{Creation witness present?}
D -- No --> E[Count checked session]
D -- Yes --> F[Load content-addressed profile and catalog identity]
F --> G{Witnesses match?}
G -- No --> C
G -- Yes --> E
C --> H[Return failure summary]
E --> H
H --> I[Doctor diagnostic]
H --> J[Fingerprint and warning backoff]
Reviews (1): Last reviewed commit: "fix: preserve prior session profiles and..." | Re-trigger Greptile
|
@coderabbitai full review |
|
|
@coderabbitai full review |
|
|
CI follow-up for The complete local affected gate has now passed, including the unchanged-byte The only completed CI failure is Go race shard 7/8, propagated to the aggregate Verify check. The unchanged owning regression passed 20 isolated repetitions with |
What & why
Fixes #566.
An upgrade from 0.3.0-beta.21 left valid version 4 session creation profiles unreadable: the version 5 codec required strict equality even though the only new profile field was optional ACP selections. Every list scan then logged the same failure once per session, while doctor did not inspect persisted session witnesses.
The persistence codec now explicitly supports versions 4 and 5. Version 4 cannot contain ACP selections. Historical canonical bytes, profile references, policy digests, and per-session creation digests remain intact; new runtime profiles still use version 5. This preserves catalog references and immutable managed-session witnesses rather than rehashing historical state. Unsupported versions and tampered witnesses still fail integrity validation.
Both session listing and memory scanning now aggregate unreadable metadata into one bounded warning per scan. Each scanner retains a constant-size fingerprint/backoff state. Identical failures repeat at most once every five minutes; a changed failure set is reported immediately, including changes outside the five-item sample, and a healthy scan resets backoff. This reduces repeated log output without skipping reads or claiming the reporter's CPU causality.
Doctor adds
runtime.session_metadatathrough the existingDiagnosticItemenvelope. The read-only probe checks on-disk metadata and global creation witnesses and returns checked/unreadable counts, up to five redacted bounded samples, and an omitted count. It neither repairs files nor changes warning cadence; cancellation/scan errors remain explicit probe errors.How you verified it
Implementation and verification by Codex, GPT-6-Astra at High reasoning. Reviewed the changed diff before final validation.
store: unsupported session creation profile version 4.v0.3.0-beta.21(93a5c04c880c893a4a975accb469b9276e702b0b), not current hash functions. Metadata read/rewrite and global SQLite close/reopen preserve the original witnesses and stored bytes. Tampering and unknown future versions remain rejected.CGO_ENABLED=1 go test -race -tags=integration ./internal/store/globaldb ./internal/session -run 'TestGoalSessionCreationIdentityIntegration|TestManagerIntegrationUsesRealSQLitePerSessionDB' -count=1passed with real SQLite.clean: true. The complete scope, commands, runtime evidence paths, and impact audit are indocs/qa/reports/2026-09-09-issue566-session-upgrade.md; RT-002 and RT-022 were updated.make gatepassed all affected lanes onb975c49a8057b6dc5c6fe627d8431f6dd162270f, including the.json.goldenfixture paths. Lint: zero warnings/errors; race-enabled tests: pass. Resource caps:GOMAXPROCS=4 COMPOZY_GO_TEST_P=1 COMPOZY_GO_LINT_CONCURRENCY=2. Unchanged package evidence was reused. The owner authorized publishing while this final local run was still finishing; it has now completed successfully.Limits: this verifies the historical creation-profile format inside current SQLite streams, not every shape in a complete beta.21 home. Doctor does not validate every
events.db; the history reader was exercised independently. No live provider spawn or benchmark was required. No claim is made to reproduce 90 MB/h or attribute CPU load. The lab also logged existing user-skill warnings unrelated to this change.Impact
make gatepasses locally; this PR is delivered only after its required CI checks are green