Repository navigation
feat: implement RV-I03 review scheduling and advisory readiness - #8
Conversation
christophersesugh
left a comment
There was a problem hiding this comment.
RV-I03 review — changes required
Reviewed the 23-file diff from 14445f81f472f77e2b12b1bb4e8b1875f4b96a61 against accepted Specification 0001 §§1–6, 8–9, ADR-0001, source architecture and RV-I03 at context 9c1fd6dffb1839e823fad4c4eaefe0f840bc41ed.
Two P2 findings: public explanation accepts malformed projection values; public replay/advance lifecycle conformance needs explicit scope-cutoff and revocation regression evidence. The latter is a test/acceptance gap, not a demonstrated reconciliation bug. The existing practice progression, qualification, identity checks, separation of authority and pure module architecture otherwise look consistent with the accepted rules.
Exact-head CI passed on Ubuntu and Windows. Source inspection and CI records only; no independent local execution. RV-I06 source prerequisite is merged (#7); its tracker closure is still pending in the inspected context revision. No ranking, host-integration or release work is required in this PR.
Standards: Changes required. Specification: Changes required. Merge recommendation: Changes required.
| if (!fields) { | ||
| return failure("INVALID_EVENT", "review"); | ||
| } | ||
| const concepts = array(fields.concepts, LIMITS.concepts); |
There was a problem hiding this comment.
[P2] Reject malformed replay values at the public explanation boundary. Specification 0001 §§1, 4, 6 defines explainReview over a valid result and requires strict plain JSON shapes, identifiers, enums and bounds; AGENTS.md applies these rules at public boundaries. Here identity, appliedEventIds, and controlEventIds are only checked for presence; lines 72–112 likewise accept arbitrary values for the practice/candidate scalar fields. For example explainReview({identity:null,appliedEventIds:false,controlEventIds:42,concepts:[],lifecycleReasons:[{code:"CREDIT_CORRECTION"}]}) returns success despite not being a replay result. A valid result altered to scheduleState:"bogus" or dueAtMs:NaN also succeeds. Validate the consumed ReviewResult envelope and nested scalar/array shapes using shared projection/identity validation (including bounded IDs and supported versions, with appropriate derived identity string limits). Reject malformed results with typed safe errors; no evidence authentication or scheduling rerun is needed. Add negative tests for these cases and keep valid replay/explanation round trips passing.
| ); | ||
| }); | ||
|
|
||
| it("matches reference replay on permutations, duplicates and a late effective append", () => { |
There was a problem hiding this comment.
[P2] Complete public lifecycle/advance regression coverage for RV-21/22/37/39. The new public tests cover a correction followed by event deletion on rebuild, and advance only with ordinary appended observations. Existing reconcile tests cover scope cutoff, late targets and revocation internally, but do not assert that public rebuild/advance/evaluateReadiness preserve both projections for those histories. RV-I03 explicitly requires correction/deletion recomputation and reference replay equivalence. Add a public regression with an initially qualifying credited streak, append revocation and scope deletion controls (including a later correction to a suppressed root or late original), assert applied IDs, practice counts/state and candidate counts/readiness, and compare each advance to full rebuild; also compare evaluateReadiness to the candidate projection. This is missing acceptance evidence, not a proven suppression defect.
Scope
RV-I03, RET-04–08/10–12/17; accepted specification, ADR, architecture and tracker. I02 and I06 source PRs merged and accepted; context #193 is still pending tracker-only closure of I06. Based on
14445f81f472f77e2b12b1bb4e8b1875f4b96a61.Contract representation choices for review
Positional APIs documented in docs/replay.md; a single scope-level identity envelope contains ASCII-ordered concepts. Concepts named in validated history with no surviving active observations have unobserved projections; an empty history names no concepts. No candidate field when eligibility absent (single-concept query returns null). Advance allows late effective records and identical duplicates, and validates combined raw input. Explain consumes successful replay values, validates reason-bearing shapes and bounds and returns no arbitrary correction text. These are implementation representation choices, not changes to accepted scheduling rules.
Verification
RV-02–04/06/08–15/20–23/29–32/36–39 library cases targeted in tests, including exact progression, support, early/no observation, explicit calendar arithmetic, qualifying clocks, correction/deletion, replay equivalence and identity rejection. Host evidence admission, official credit, completeness, storage and stale-generation rejection remain host-owned. Local environment lacks pinned Node 24/pnpm and direct GitHub access; exact-head CI is required. RV-I07 due ranking and RV-I04 release verification remain separate; no release or completion claim before review/merge.