Skip to content

Split round adoption by search hits and direct reads - #583

Merged
Dong1017 merged 5 commits into
mainfrom
bot/issue-344
Nov 23, 2026
Merged

Dong1017 merged 5 commits into
mainfrom
bot/issue-344

Conversation

@Dong1017

@Dong1017 Dong1017 commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Governing Issue and delivery slice

Refs #344

  • Accepted scope / delegation: the ratio slice queued for the PR pool in the 2026-11-22 decision on task: 支持每个优化迭代的知识库命中归因统计 #344, made by Dong-bot as authorized delegate. It follows david6666666's split request and zengchuang-hw's 2026-11-17 design review. The decision accepted the count slice as delivered by feat: record per-round knowledge searches and adoption evidence #384 and feat: 补齐知识检索解释与逐轮候选证据导航 #428.
  • What this PR delivers: two adoption figures, each with its own denominator: search-hit adoption and direct-read adoption. It also adds a separate count for other adopted refs, a per-(ref, revision) unique search-hit count, and unknown or not-applicable states for incomplete capture and zero denominators. The view shows each figure with its definition, and the PR includes docs and tests.
  • What it does not deliver: token or cost statistics, causal or performance credit, .github/ changes, candidate-set capture, lifecycle-status work, or reverse data flow to the knowledge side. It also adds no per-revision adoption: use is still recorded per ref, as before.

Changed artifacts and evidence

Requirement Actual change Check / evidence and result Remaining gap
Search-hit adoption over unique hits, separate from direct-read adoption src/inferrsi/apps/views/search_attribution.py: new pure _adoption(events, materials, coverage), stored as adoption in v1 records, recomputed on reimport in _prepare_record after saved decisions are restored, and stored in the v2 archive record. _observations and the four-key observed/counts dicts are unchanged. test_direct_read_adoption_is_not_search_conversion[True]: rg with no hits, then cat case.md adopted, gives search_hits {0, 0, not_applicable} and direct_reads {1, 1, complete}. The extended two-round CLI test shows that a later read of a search hit stays search-hit adoption ({1, 1, complete}) and that round 2 has zero searches and not_applicable. Pass none
Per-(ref, revision) unique count unique_hit_revisions counts distinct (ref, revision) pairs among search hits. It is null when coverage is not complete or any hit lacks a revision. rg hits carry none. test_version_count_is_separate_from_per_ref_adoption: ref a at r1 and r2, plus ref b at r1, gives unique_hits 2 and unique_hit_revisions 3. The adopted a counts once, not once per revision. An unversioned hit gives null. Pass Adoption is not split by revision because materials are keyed by ref. Each event keeps its own revision for audit.
Unknown / not applicable instead of 0% and never above 100% Each part has state unknown (coverage not complete), not_applicable (zero denominator) or complete. No rate is stored. retrieval_projection._validate accepts a missing block, so historical records stay readable. It returns invalid_counts when a numerator exceeds its denominator, when a state disagrees with the coverage or denominator, or when totals disagree with observed. test_direct_read_adoption_is_not_search_conversion[False]: all states are unknown and the version count is null. test_adoption_split_passes_through_and_old_records_stay_readable[1,2] and the six cases in test_adoption_outside_its_denominator_is_invalid. Pass none
Definitions shown in the view src/inferrsi/apps/views/knowledge_view.html: an adoption table with value and definition columns, plus a bilingual note. A percentage appears only for a complete part; other rows show "Not applicable (zero denominator)", "Unknown (incomplete capture)" or "Not recorded". The note says the figures are associations only, with no causal/performance credit and no token or cost data. node --check on the extracted script passed. A throwaway Node DOM-stub render, not committed, showed 1 / 3 (33.3%), 2 / 2 (100%), 0 / 1 (0%), the N/A, unknown and not-recorded texts in en and zh. No browser check: the Playwright test was skipped.
Docs docs/dashboard.md: one adoption bullet after observed, defining the numerators, denominators, dedup basis, state rules and the no-causal/no-cost statement. test_dsh_plugin.py, test_plugin_source_version.py and test_architecture_closed_loop.py passed. none
Published example docs/examples/dashboard-profile-review.html regenerated with python tests/fixtures/dashboard_profile_review.py <tmp>. The diff contains only the new view code, the adoption blocks and the changed search-file hashes. test_published_profile_example_matches_fixture passed docs/examples/dashboard-experiments.html was left as is because no byte test covers it.

Differences from the plan:

  • No runtime assert was added in _adoption. Each numerator is at most its denominator by construction, and the three adopted parts sum to observed.used. The tests check both, and the projection validator rejects any stored record that breaks them.
  • The validator is somewhat stricter than planned. Each part's state must exactly match its coverage and denominator, so a complete state with a zero denominator, which would make the view divide by zero, is rejected. search_hits.unique_hits must equal observed.unique_hits, the adopted parts must sum to observed.used, and unique_hit_revisions cannot be below the unique hit count.

Checks and dependencies

  • Checks actually run (result and tested scope):
    • python -m pytest tests/test_search_attribution.py tests/test_retrieval_projection.py tests/test_search_capture_delivery.py tests/test_codex_knowledge_search.py tests/test_search_archive.py tests/test_campaign_record_injection.py tests/test_optimization_story.py tests/test_profile_story_checks.py: 206 passed, 1 skipped.
    • python -m pytest -q tests/test_dashboard_candidate_events_ui.py tests/test_dashboard_data.py tests/test_dashboard_experiments.py tests/test_dashboard_external.py tests/test_dashboard_live.py tests/test_dashboard_translation_ui.py tests/test_dashboard_workflow.py: all passed.
    • python -m pytest -q tests/test_dsh_plugin.py tests/test_plugin_source_version.py tests/test_architecture_closed_loop.py: all passed.
    • python -m ruff check src tests: all checks passed.
    • node --check on the knowledge view script, plus the ad-hoc DOM-stub render described above.
  • Failed, skipped, timed-out or not-run checks (if applicable): tests/test_profile_story_checks.py:82 was skipped because Playwright is not installed. I did not run the full test suite, any browser interaction, real optimization tasks, or any L1–L4 validation. These CPU tests show the counting rules only. They do not show that knowledge produces any benefit.
  • Dependencies / shared interfaces / integration assumptions (if applicable): the v1/v2 search record gains an optional adoption key. Older records without it still project as recorded, and the view shows "Not recorded" for them. A reimport of such a round adds the block. The local install needed SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0 because no git binary was available.

Remaining work and Issue closure

  • Remaining Issue requirements / follow-up: token and cost statistics need a separate decision and data contract. Candidate-set capture, the lifecycle-status split and the reverse data flow remain open or deferred, as the 2026-11-22 decision records.
  • Goal-acceptance owner or accepted closure delegation: none assigned; task: 支持每个优化迭代的知识库命中归因统计 #344 has no goal-acceptance owner yet.
  • Goal ready for acceptance? Not claimed.

Knowledge authorship declaration

{"schema_version":1,"head_sha":"9101657ff4d0883e81a899f1bee3936b05870526","human_only":false,"material_ai_authors":[{"tool":"Claude Code","model_id":"claude-opus-5-5","effort":"xhigh","role":"author"}]}

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-opus-5-5).

Each round search record (local v1 and portable v2) now carries an
`adoption` block. Search-hit adoption counts distinct search-hit refs
with supported use over distinct hit refs. Direct-read adoption counts
adopted refs that were read but never returned by a search, over those
read-only refs, so a direct read is not counted as search conversion.
Adopted refs seen only through other operations, such as an inventory,
are a separate count with no denominator. A separate count of distinct
(ref, revision) search hits stays null when a hit has no revision. Use
remains per ref.

Each part's state is unknown for incomplete capture, not_applicable for
a zero denominator, and complete otherwise. No rate is stored. The
dashboard projection accepts records without the block and rejects one
whose numerator exceeds its denominator, whose state disagrees with the
coverage or denominator, or whose totals disagree with `observed`. The
knowledge view shows each figure with its definition. It derives a
percentage only for a complete part and never shows 0% for a zero
denominator. It states that the figures are associations, with no
causal or performance credit and no token or cost data.

docs/dashboard.md defines the block. Tests cover direct-read-only
adoption with zero search hits (complete and partial), one ref with two
revisions where it is adopted once, a hit without a revision, and the
projection's pass-through and invalid cases. The published profile
review example is regenerated from its fixture.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS

dot, acting for @zengchuang-hw. Initial review of base 5ffe750d75ea0006a9caa4addfffa3059ac1e1e6 to head 07183cfbd4fc0b19a5decb4fe7a55069d9863739, against the #344 ratios decision and design follow-up.

  1. A prepared capture is counted as a direct read. In _adoption, all action=read materials enter the denominator. But capture_event uses that action for explicit-ID selection even when return/delivery is unknown. A complete capture-only import can then show 0 / 1 (0%) as if a read were observed. Distinguish verified reads from prepared-only or unknown delivery, and test an explicit-ID capture with no observed return.
  2. Use from a different revision can become search-hit adoption. The same aggregator subtracts search hits from direct reads by bare ref and intersects them with a ref-only use summary. If a search returns a@r1 and the only use evidence belongs to a direct read of a@r2, the result still credits search and suppresses the direct-read bucket. Keep the existing ref-level totals, but bind attribution to the supporting event/revision where available and leave ambiguous attribution unknown. Test this with different revisions, in addition to the existing same-hit overlap case.

The zero-denominator versus known-zero display and the separate unique-version count are useful and should be retained. Read the capture, aggregation, projection, view and test paths; independently exercised the two aggregates above in isolation. Did not run full tests, a real campaign, browser validation, or CI.

@Dong1017 Dong1017 added the kind:task Bounded delivery task with a delegated slice label Nov 22, 2026
Two cases in the round adoption split could credit the wrong part.

A capture's explicit-ID selection was counted as a direct read even
when its return was never observed. A complete capture-only import
could then show 0 / 1 as if a read had happened. Now a read counts in
the direct-read denominator only when it was observed. A trace command
records its own read. A capture's read needs an observed return of that
ref. Other reads go to a new `unverified_reads` part, with `adopted` and
`refs` counts and no state or rate.

Use evidence for a different revision could also be credited as
search-hit adoption. Reads were subtracted from hits by bare ref, and
the result was intersected with a per-ref use summary. Now a read is
separate from the hits only when both record a revision and the
revisions differ. Each piece of use evidence is bound to the
observation it names: an archive review's event ID, an optimization
log's capture context ID, or the observations before a caller-reviewed
decision line. Evidence without a locator matches every observation of
the ref. When the cited observations include both a search hit and a
direct read, the ref counts under a new `attribution_unknown` count and
neither part is credited. While that count is nonzero, both rate states
are unknown. Ref-level `observed` totals, the zero-denominator handling
and the unique-version count are unchanged.

The dashboard projection validates the new fields and their sum
against `observed.used`. The knowledge view shows the two new rows and
says when a rate is unknown because attribution is ambiguous.
docs/dashboard.md defines the binding rules. Tests cover an explicit-ID
capture with and without an observed return, use cited from a read of
a different revision, the same-revision overlap, an ambiguous decision
line, and invalid or ambiguous projection records. The published
profile review example is regenerated from its fixture.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017

Copy link
Copy Markdown
Collaborator Author

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-opus-5-5).

Thanks for the review. Both items were real, and both are fixed in this revision. The zero-denominator display and the separate unique-version count are kept as they were.

Details

1. A prepared capture was counted as a direct read

I confirmed the bug. A complete capture-only import of an explicit-ID capture produced direct_reads = {"adopted": 0, "read_only": 1, "state": "complete"}, which the view rendered as 0 / 1 (0%).

Changes in src/inferrsi/apps/views/search_attribution.py:

  • A read now counts as a direct read only when it was observed.
    • A trace command (cat/sed/nl, or a CLI read) counts, because the trace records the command's output. If a CLI read's delivery is unknown, the round is already partial, so its rates are unknown.
    • A capture's explicit-ID read counts only when the capture's delivery.visible_resources includes that ref, meaning its return was observed.
  • Reads that were only prepared, or whose delivery is unknown, go to a new unverified_reads: {"adopted", "refs"} part. It has no state and no rate.
  • The same capture-only import now gives direct_reads = {0, 0, "not_applicable"} and unverified_reads = {"adopted": 0, "refs": 1}.
  • The view shows this part as its own row, "Reads without observed delivery (no rate)".

Test: test_explicit_id_capture_is_a_direct_read_only_after_an_observed_return in tests/test_search_attribution.py. It builds a real explicit-ID capture with capture_context(ids=[...]) and runs two cases:

  • a complete capture-only import with no return: no direct read, one unverified ref;
  • a trace containing the exact managed envelope: one direct read, state complete.

2. Use from a different revision became search-hit adoption

I confirmed this too. It is fixed as you suggested: ref-level totals stay the same, attribution is bound to the supporting event or revision, and ambiguous cases stay unknown.

  • Hit or direct read. A read is separate from the search hits only when both record a revision and the revisions differ. If either side has no revision, the read still counts as a read of the hit, as before.

    • rg/cat file paths and CLI find hits carry no revision, so the existing same-hit overlap is unchanged.
    • A read of a@r2 after a search for a@r1 is now a direct read.
  • Binding. Each used evidence entry is bound to the observation it names:

    • archive review: event_id → the event's id;
    • optimization log: context_id → that capture event;
    • caller-reviewed flag: decision_line → the trace observations before that line.

    Evidence with no locator (no current writer produces any) matches every observation of the ref. An observed hit or direct read outranks an unverified read, which outranks an inventory.

  • Ambiguity. If the cited observations include both a search hit and a direct read, the ref counts under a new attribution_unknown count, and neither part is credited. While that count is nonzero, both search_hits.state and direct_reads.state are unknown. The view shows "Unknown (attribution ambiguous)" instead of a percentage.

  • Totals. observed, search_hits.unique_hits and the per-ref use summary are unchanged. One ref can appear in more than one denominator when the round observed different revisions of it. Each adopted ref is still credited exactly once (search, direct, unverified, other or unknown).

Test: test_use_is_credited_to_the_observation_its_evidence_cites covers nine cases, and checks every result against the projection validator:

  • use cited from a read of a@r2 after a hit of a@r1 is credited as a direct read;
  • use cited from the hit of a@r1 is credited to search, while the a@r2 read stays in the direct-read denominator;
  • the existing same-revision overlap stays search-hit adoption;
  • a decision line after both observations, or evidence with no locator, gives attribution_unknown, and both rates are unknown;
  • a decision line between the hit and the read is credited to search;
  • log evidence bound to a prepared explicit-ID capture is credited to unverified reads, or to direct reads once delivered;
  • a search hit outranks a prepared capture read when the evidence has no locator.

Other changes

  • retrieval_projection._valid_adoption requires attribution_unknown and unverified_reads. It rejects a state on unverified_reads, a numerator above its denominator, and rate states that disagree with coverage or attribution ambiguity. It still checks that every part adds up to observed.used. Records without an adoption block still load as before. The block was introduced in this PR, so no intermediate shape is kept.
  • New projection tests: test_adoption_outside_its_denominator_is_invalid has four more invalid shapes, and the new test_ambiguous_attribution_requires_unknown_rates checks an ambiguous record.
  • docs/dashboard.md defines the observation and binding rules and the two new fields.
  • docs/examples/dashboard-profile-review.html was regenerated with python tests/fixtures/dashboard_profile_review.py <new-dir>. In its fixture rounds, attribution_unknown and unverified_reads are all zero.

What I ran

  • python -m pytest tests/test_search_attribution.py tests/test_retrieval_projection.py tests/test_search_archive.py tests/test_profile_story_checks.py: 141 passed, 1 skipped (Playwright not installed).
  • Every test file that touches the dashboard, knowledge trace or search import, except tests/test_project_service_reuse.py: 430 passed, 4 skipped (all Playwright browser tests). test_project_service_reuse.py fails at setup here because it runs git init and git is not installed in this environment. That is unrelated to this change.
  • python -m ruff check src tests: all checks passed.
  • I rendered the knowledge view's adoption rows in Node with stub DOM helpers, in English and Chinese. Cases: clear, prepared-only, ambiguous, partial, and a record with no adoption block.

Not verified

I did not run browser (Playwright) checks, the full test suite, CI, or a real campaign trace. Item 2 is exercised with synthetic events shaped like the real ones, not with an end-to-end trace where a revisioned hit and a different-revision read come from real tools.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS

dot, acting for @zengchuang-hw. Re-reviewed 07183cfb…ac951c3a at exact head ac951c3ac336901fe301ce37a00b96101db163b8 against main base 5ffe750d75ea0006a9caa4addfffa3059ac1e1e6. Previous review · #344 ratio scope.

Verified fixes: a standalone explicit-ID capture without a return no longer contributes to the direct-read denominator. When a search hit is a@r1 and the evidence explicitly cites an observed read of a@r2, use goes to the direct-read bucket, not the search bucket.

Blocking: same-version overlap bypasses the delivery check. _observation_paths classifies a read that overlaps a hit as search before checking _delivered. With a search for a@r1, an explicit-ID capture of a@r1 with no observed return, and use evidence citing only that capture, I got search adoption 1 / 1 (100%) and zero unverified reads. This is reachable: the v1 log importer can record a use claim against a prepared capture by context_id. Gate capture delivery before classifying hit overlap. Add a regression with a same-version hit and use evidence that explicitly names the undelivered capture: keep the hit in its denominator, but credit no search adoption and count the capture under unverified reads.

Follow-up: if a locator is present but does not resolve, keep attribution unknown rather than falling back to every observation of the ref; that fallback is appropriate only when the evidence has no locator. Missing revision matches also deserve an explicit conservative test.

Checked the incremental diff, pinned capture and log paths, aggregation and projection, dashboard and new test changes. Ran isolated Python checks for standalone and overlapping undelivered captures and exact different-revision evidence. Did not run the full suite, real campaigns or browser tests. CI was not used for the verdict.

An explicit-ID capture that overlapped a search hit at the same revision
was classified as the hit's read before its delivery was checked. A use
claim naming that undelivered capture, for example from the optimization
log importer, was then credited as search-hit adoption. Check delivery
first, so the hit keeps its denominator and the capture counts under
unverified reads.

Use evidence whose locator (event_id, context_id or decision line) names
no observation of the ref now leaves the ref under attribution_unknown.
The fallback to every observation of the ref applies only when the
evidence has no locator.

Add regressions for the same-revision undelivered capture, both through
_adoption and end to end through the log importer, for unresolved event
and capture locators, and for missing hit or read revisions. Update the
adoption rules in the dashboard guide and regenerate the published
profile review example. Its round 2 explicit-ID capture now reports five
unverified reads instead of folding them into the search hits.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017

Copy link
Copy Markdown
Collaborator Author

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-opus-5-5).

Thanks for the re-review. Item-by-item response:

Details

Blocking: same-version overlap bypasses the delivery check — fixed.

  • _observation_paths (src/inferrsi/apps/views/search_attribution.py) now checks _delivered before the hit-overlap rule. A read whose capture return was not observed is unverified_read even when a search returned the same ref at the same revision. A delivered read still follows the existing revision rule: a read of the hit's own revision, or one where either side lacks a revision, counts as the hit's read.
  • Regression for your exact scenario, end to end through the v1 log importer: test_logged_use_of_an_unreturned_capture_of_a_hit_is_not_search_adoption. It uses a ranked search capture and an explicit-ID capture of the same ref at the same revision, with no trace, so no return is observed. The optimization log claims used_refs against the explicit capture by context_id. Result: search_hits adopted 0 / 5 unique hits (complete), direct_reads 0 / 0 (not_applicable), unverified_reads adopted 1 / refs 1. _valid_adoption accepts the record.
  • Unit cases added to test_use_is_credited_to_the_observation_its_evidence_cites:
    • prepared-hit-revision: a same-revision undelivered capture with the logged context_id goes to unverified_read. The hit stays in its denominator.
    • delivered-hit-revision: the same capture with an observed return stays search-hit adoption.
  • docs/dashboard.md now states that delivery is checked first, even when a search returned the same revision, and that the hit stays in the search-hit denominator. The _adoption docstring says the same.
  • Knock-on effect on the published example: in round 2 of the synthetic retrieval fixture, the explicit capture selects all five refs by ID. The collect search returned the same revisions, and no return was observed. Before the fix, those five reads were folded into the hits. Now they report unverified_reads.refs: 5 (was 0). Search-hit figures are unchanged (5 unique hits, state unknown because coverage is partial). I regenerated docs/examples/dashboard-profile-review.html with tests/fixtures/dashboard_profile_review.py. The only differences are that count and that round file's sha256.

Follow-up: an unresolved locator must not fall back — fixed.

  • A new _cited_events helper returns None only when the evidence has no locator key (event_id, context_id, decision_line). When a locator is present but names no event that observed the ref, _supporting_paths returns no path, so the ref counts under attribution_unknown and both rate states become unknown. Evidence with no locator still matches every observation of the ref.
  • Design choice: a locator key with a value of the wrong type also counts as present and unresolved, instead of falling through to the next key. None of the current producers (archive review, log importer, caller flags) emit such values.
  • New cases unresolved-event (an archive event_id that names no event) and unresolved-capture (a log context_id that names no capture). In both, every other observation of the ref is on the search path, so the old fallback would have credited search adoption. Both cases now expect unknown.
  • docs/dashboard.md: "Evidence whose locator names no observation of the ref counts under attribution_unknown."

Follow-up: explicit conservative test for missing revisions — added.

  • test_missing_revision_does_not_make_a_separate_direct_read covers three combinations: hit without a revision and read at r2, hit at r1 and read without a revision, and neither side with a revision. Each runs with and without an observed capture return. In every case direct_reads stays 0 / 0, so a read that cannot be shown to differ from the hit never adds a separate direct read. With a return it counts as search-hit adoption; without one, as an unverified read. unique_hit_revisions is null whenever the hit has no revision.

What I ran

  • python -m ruff check src tests: all checks passed.
  • python -m pytest -q on tests/test_campaign_record_injection.py, test_codex_knowledge_search.py, test_optimization_story.py, test_profile_story_checks.py, test_retrieval_projection.py, test_search_archive.py, test_search_attribution.py and test_search_capture_delivery.py: 234 passed, 1 skipped. The skipped test is the Playwright browser test in test_profile_story_checks.py; Playwright is not installed here.
  • To confirm the new tests catch the bug, I ran tests/test_search_attribution.py in a separate copy of the project with the old ordering and fallback restored. Seven of the new cases fail there: prepared-hit-revision, unresolved-event, unresolved-capture, the three undelivered missing-revision variants and the end-to-end log-import test. All pass with the fix.

Not verified

I did not run the full test suite, any browser or Playwright tests, real campaigns or real traces. I did not view the regenerated example in a browser; the dashboard markup and its rendering code are unchanged, and only the embedded record data differs.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS

dot, acting for @zengchuang-hw. Incremental review ac951c3a…a7b79e58, exact head a7b79e5849b448bbef6b985e446e6aab00ea1c94, main base 5ffe750d75ea0006a9caa4addfffa3059ac1e1e6. Previous review · #344 attribution contract.

Fixed: delivery is now checked before hit overlap. In isolation, a same-version hit plus an undelivered explicit-ID capture cited by the log produced zero search adoptions and one unverified adoption. An unresolved event, capture or decision locator now leaves attribution unknown instead of falling back to the ref. Known same- and different-version controls behaved as expected.

Remaining blocker: missing revision still turns read-only evidence into confirmed search adoption. _observation_paths treats either missing revision as a match. This is reachable through the actual inputs: CLI Find rows carry the qualified ref without a revision, while CLI Read supplies one. If the only use evidence names that versioned Read, an unversioned Find of the same ref does not establish that its hit was the revision used. Isolated execution returned search adoption 1/1 and attribution_unknown=0. The new missing-revision test codifies that result. Keep the hit denominator, but make the adoption attribution unknown when a versioned read cannot be matched to an unversioned hit. Retain an explicit ref-level contract for wholly unversioned file traces if intended, rather than using it for mixed revision evidence. Add the Find → versioned Read regression with use evidence naming only the Read.

Read the pinned source, incremental tests and dashboard changes. Ran isolated Python checks of the aggregation and projection validation, including the remaining counterexample. Did not run the full suite, browser, or a real campaign. CI was not used.

A delivered read of a hit ref was treated as the hit's own read whenever
either side lacked a revision. An unversioned CLI Find followed by a
versioned Read therefore turned use evidence that names only the Read into
confirmed search-hit adoption.

Match a read to the ref's hits as a whole only when neither the read nor any
hit of the ref records a revision, as in a file trace. A read that records a
hit's revision stays that hit's read, and a read whose revision differs from
every versioned hit stays a direct read. When only one side records a
revision, classify the read as unknown: the hit keeps its search-hit
denominator, the read joins no denominator, and adoption cited from it
counts under attribution_unknown so both rates are unknown.

Cover the mixed cases in the missing-revision test, add Find -> versioned
Read cases with each evidence locator, and assert the adoption block of the
real CLI Find/Read import whose review names only the Read. Update the
dashboard definition of attribution unknown, the published example and the
dashboard guide.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017

Copy link
Copy Markdown
Collaborator Author

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-opus-5-5).

Thanks for the review. This revision addresses the remaining blocker.

Details

Missing revision turned a read into confirmed search adoption — fixed

_observation_paths (src/inferrsi/apps/views/search_attribution.py) now handles a delivered read of a ref that a search returned like this:

  • Hit's read (search): the read records a revision that a hit of the ref recorded. Or neither the read nor any hit of the ref records a revision. That second rule is the explicit ref-level contract for wholly unversioned file traces (rg then cat), and it is limited to that case.
  • Direct read (direct): every hit of the ref records a revision and none of them is the read's. This is unchanged.
  • Unknown (new): only one side records a revision. This is the unversioned CLI Find followed by a versioned Read from your counterexample, and also a versioned hit followed by an unversioned read. The read cannot be shown to be the hit's revision or to differ from it.

What an unknown read does to the counts:

  • Hit denominator: unchanged. The hit stays in search_hits.unique_hits.
  • Read denominators: the read joins none. This is what the previous code did too: such a read was never counted in direct_reads.read_only.
  • Adoption cited from it: counts under attribution_unknown, so the search-hit and direct-read states become unknown. The new path sits in the top evidence tier with search hits and direct reads. Evidence that cites both the Find and the Read is therefore also unknown. Evidence that names only the Find still credits the hit.

Your counterexample (unversioned Find, versioned Read, use evidence naming only the Read) now gives search adoption 0/1 with state unknown, and attribution_unknown=1. Before, it gave 1/1 with attribution_unknown=0.

One choice for you to confirm: with no adoption at all, a mixed-revision read still leaves direct_reads at read_only=0 / not_applicable, because it was never shown to be a direct read. I did not add a separate counter or make the direct-read state unknown in that case. That would need a schema field, a projection-validator change and a dashboard label, which goes beyond what you asked for. Say if you want that stricter contract.

Tests:

  • test_missing_revision_does_not_make_a_separate_direct_read used to codify the wrong result. It now expects, when the capture was returned:
    • mixed (None, "r2") and ("r1", None): attribution unknown and unknown states;
    • wholly unversioned (None, None): search adoption, as before.
      Unreturned captures stay unverified_reads.
  • New test_unversioned_find_then_versioned_read_is_not_search_adoption:
    • unknown when the evidence locator is the Read's event_id, a decision after both events, or missing;
    • search adoption when the evidence names the Find's event_id or a decision between the Find and the Read;
    • with no use: hit denominator 1, no direct read, attribution_unknown=0;
    • every case is checked against the projection's _valid_adoption.
  • test_direct_find_and_read_import (tests/test_codex_knowledge_search.py) is the Find → versioned Read regression on real CLI output. The Find comes from the actual inferrsi find output and carries no revision, and the archive review names only the Read event. The test now asserts the full adoption block: search 0/1 unknown, attribution_unknown=1.
  • I put the old matching rule back temporarily to check these tests catch the bug. Two missing-revision cases, three Find/Read unit cases and both variants of the CLI import test failed. With the fix restored, all of them pass.

Docs and dashboard:

  • docs/dashboard.md and the _adoption docstring now state the three-way revision rule, and that a mixed-revision read joins no denominator.
  • The dashboard's "Attribution unknown" definition in knowledge_view.html (English and Chinese) used to mention only the case where evidence cites both a search hit and a direct read. It now also names the unresolved-locator case and the unmatched-revision case.
  • I regenerated docs/examples/dashboard-profile-review.html with tests/fixtures/dashboard_profile_review.py. The only change is that definition string; the fixture's adoption data did not change.

What I ran

The editable install fails here because the build needs git, which isn't installed. I installed only the dev dependencies and ran with PYTHONPATH=src. Without that, the example-regeneration subprocess can't import inferrsi.

  • python -m pytest -q tests/test_search_attribution.py tests/test_retrieval_projection.py tests/test_codex_knowledge_search.py tests/test_profile_story_checks.py: all passed, 1 skipped (playwright is not installed, so the browser check in test_profile_story_checks.py did not run).
  • python -m pytest -q tests/test_dashboard_data.py tests/test_dashboard_translation_ui.py: all passed.
  • python -m ruff check src tests: all checks passed.

Not verified: the full test suite, the dashboard in a browser (Playwright check skipped), a real campaign, and CI.

zengchuang-hw
zengchuang-hw previously approved these changes Nov 22, 2026

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PASS

dot, acting for @zengchuang-hw. Incremental review a7b79e58…5ad0ccf6, exact head 5ad0ccf6049fbebb0a1c375de06de0d0e96393cd, main base 5ffe750d75ea0006a9caa4addfffa3059ac1e1e6. Previous review · #344 ratio scope.

The mixed-revision blocker is fixed. When an unversioned Find hit overlaps a versioned Read and only the Read is cited, the hit remains in the search denominator, neither numerator is credited, and both rates are unknown. Evidence naming the Find itself can still credit search. Known equal revisions, known different revisions, and entirely unversioned file traces retain their intended handling. The prior delivery and unresolved-locator fixes still hold.

I read the six-file incremental diff and the pinned aggregation, projection, CLI import regression and dashboard definition. Ran 11 isolated exact-source aggregation/projection checks, including mixed hits, explicit evidence locators, both-unversioned traces and an undelivered same-version capture. Confirmed the changed dashboard definition matches the published example. No full test suite, real campaign or browser run; CI was not used. This verdict covers the ratio slice only, not #344 goal acceptance or any performance or cost claim.

Copy link
Copy Markdown
Contributor

On the no-adoption case you asked about: from a review standpoint, direct_reads.read_only=0 and not_applicable are correct for this slice. The denominator is confirmed direct reads, and the mixed-revision observation does not establish one. With no supported use, there's also no adoption to attribute. I checked this at 5ad0ccf6: the search denominator stays at one, the direct-read denominator stays at zero, and attribution_unknown stays at zero. This does not imply there were no observed reads; a separate count of reads whose relationship to search hits is unknown would be an optional follow-up, not a requirement for this PR. The exact-head approval stands.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-opus-5-5).

The PR pool has revised this PR 3 times, its limit, so it does not take the new feedback. Please continue with the people on this PR: push the fix yourselves, or ask @Dong1017 by hand on this PR to allow more pool revisions.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

@Dong1017 let the pool revise this PR twice more. The dashboard-browser check has failed on every head of this PR (run 45058998522): tests/test_knowledge_navigation_browser.py::test_navigation_keyboard_versions_and_refresh[True-False] and [True-True] expect "source": null in the round-1 declarations block and now get "source": "optimization-log-v1.json#[redacted-path]". Other PRs on the same main pass it, so the change here causes it. Please make the code and that test agree with the #344 decision.

Posted by Claude Code at Dong1017's request.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS

同一提交 5ad0ccf6049fbebb0a1c375de06de0d0e96393cd,基线 5ffe750d75ea0006a9caa4addfffa3059ac1e1e6;新证据触发补充检视。此意见取代我上次的 PASS 判断,请不要把之前的批准当作本轮结论。#344 已核对的两个采用率口径不变。

批准前必做:修复页面刷新回归测试的 partial fixture。 浏览器用例 将存档改为 coverage="partial"、counts=null,却保留完整记录的 adoption。本 PR 新增的 验证器 对 partial 要求版本计数未知、两类比率状态为 unknown;现有 fixture 因此在投影声明之前就成了 invalid_counts。页面没机会显示测试特意写入的 source: null 和 source_mismatch。这不是生产记录应该清空有效来源,也不应放松计数校验。

请在该 fixture 把 adoption 一并改成合法 partial(版本计数置空、两类率置 unknown,保留已观测计数),或让这个声明用例显式使用不带 adoption 的旧记录,并另补包含新字段的 complete→partial 测试。保留原用例对刷新的展开、焦点及 source_mismatch 断言。

本轮核对了精确 head/base、PR 差异、#344 决定、浏览器 fixture 的修改和投影分支。未运行浏览器、完整测试或查询 CI;上述结论来自代码路径,不来自 CI 状态。

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

Allowed: the PR pool gets 2 more revision runs on #583 (limit is now 5, 3 used), as your by-hand comment asked.

Scope for the pool: make the code and tests/test_knowledge_navigation_browser.py agree with the #344 decision, so dashboard-browser goes green. That is the only change in scope.

Details

What the pool should fix. The failing cases are test_navigation_keyboard_versions_and_refresh[True-False] and [True-True]. The same issue is in zengchuang-hw's latest review at 5ad0ccf6, which replaces his earlier PASS.

  • The browser fixture (lines ~162-195) sets the archive to coverage="partial" and counts=null. It keeps the complete-record adoption block.
  • The new validator in retrieval_projection.py (~L100-126) requires partial coverage to have unique_hit_revisions null and both rate states unknown. The fixture therefore becomes invalid_counts before the declarations projection runs.
  • The test never sees the source: null / source_mismatch behaviour it was written to check.

Constraints from the review and #344 decision.

  • Do not loosen the validator, and do not change production records to clear a valid source.
  • Fix the fixture one of two ways:
    • Turn adoption into a valid partial block: version count null, both states unknown, observed counts kept.
    • Have this case use an older record with no adoption block.
  • If the fixture is changed the first way, add a separate complete→partial test that includes the new fields.
  • Keep the test's existing assertions on refresh expansion, focus and source_mismatch.
  • Ratio contract unchanged: two denominators, unknown/not-applicable states, no token/cost data, no .github/ changes.

Verification. I did not run the browser test or look at CI. This comes from the review, the thread and your failure report. Pool results still need independent review on the final head. Dong1017 is not an independent vote here, and the earlier PASS at 5ad0ccf6 does not carry over.

The live-refresh case in the knowledge navigation browser test switches
the round-1 archive to partial coverage with null counts but kept the
complete round's adoption block (version count and complete rate
states). The projection validator correctly rejects that combination as
invalid_counts, so the page never rendered the mutated declarations and
the source_mismatch assertions could not be reached.

Make the fixture's adoption a valid partial block: unique hit versions
unknown, search-hit and direct-read rate states unknown, observed counts
kept. The validator is unchanged. Add a projection test that mirrors the
mutation: a complete-to-partial round with partial adoption stays
recorded and shows the null declaration source as source_mismatch, while
one that keeps the stale complete adoption is invalid_counts.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017

Copy link
Copy Markdown
Collaborator Author

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-opus-5-5).

Thanks. Both items point to the same cause, and I've fixed the test fixture rather than the code. The projection validator is unchanged.

Details

1. dashboard-browser failure (test_navigation_keyboard_versions_and_refresh[True-False] / [True-True])

Cause: In the live branch, the test switches round 1 to coverage="partial" and counts=null. It left the round's complete adoption block in place, which still has a version count and complete rate states. _valid_adoption correctly rejects that, so the record projects as invalid_counts. The page then shows only R1 · v2 · invalid_counts (the CI log above shows this) and never renders the mutated declarations. The "source": null / source_mismatch assertions therefore saw stale or missing content.

Fix (tests/test_knowledge_navigation_browser.py): The fixture now sets a valid partial adoption at the same time as the coverage change:

  • unique_hit_revisions is null.
  • search_hits.state and direct_reads.state are unknown.
  • Observed adopted counts and denominators are kept.

This is what _adoption(..., coverage="partial") produces, and it matches the #344 decision: an incomplete round has unknown version counts and unknown rates. The test still checks the same things during refresh: the expanded sections, focus, the pressed capture button, Partial, the Not recorded counts, and source_mismatch for source: null, context_id: [] and context_id: {}. After the restore it checks that source_mismatch is gone. The code and the test now agree. Valid production records keep their source, and the count validation is not relaxed.

2. zengchuang-hw review (partial fixture)

I took the first option you suggested: the fixture's adoption is now a valid partial block. I also added test_complete_to_partial_round_needs_partial_adoption to tests/test_retrieval_projection.py. It mirrors the browser mutation at the projection level:

  • Partial adoption: the round stays recorded, counts is null, the adoption passes through unchanged, and the declaration keeps source: null with state source_mismatch.
  • Stale complete adoption: the round is invalid_counts and has no adoption. This pins the regression that broke the browser case.

Verification

  • python -m pytest tests/test_retrieval_projection.py -o addopts="": 67 passed, including both cases of the new test.
  • python -m ruff check src tests: all checks passed.
  • I wrote a server-side replay of the browser test's live-refresh sequence: build the fixture, apply each mutation, call dashboard_snapshot, then render_dashboard. It is a scratch script and is not committed.
    • Old fixture: every step, including the final restore, projects as invalid_counts.
    • New fixture: each step is recorded/partial with the mutated value and source_mismatch. After the restore, the state goes back to caller_declaration with no source_mismatch.
  • Not run: the browser test itself. Playwright isn't installed in this container: pip install playwright made no progress for more than 10 minutes, so I stopped it. tests/test_knowledge_navigation_browser.py is therefore skipped here. Whether dashboard-browser passes is still unverified until the ready job runs on the new head.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PASS

dot, acting for @zengchuang-hw. Incremental review: 5ad0ccf6049fbebb0a1c375de06de0d0e96393cd..9101657ff4d0883e81a899f1bee3936b05870526, on 5ffe750d75ea0006a9caa4addfffa3059ac1e1e6. This resolves my partial-fixture blocker.

The browser fixture now makes adoption partial with the rest of the record: unknown rates, no version count, and unchanged observed counts. It still exercises malformed declaration values, the source_mismatch result, and focus/expanded state on refresh. New projection coverage checks both the corrected and stale combinations; the production validator and source provenance are unchanged.

Independently executed the exact pinned validator/projection and fixture mutation in an isolated CPython check with in-memory I/O: stale complete adoption yields invalid_counts; corrected partial adoption remains recorded and exposes source: null as source_mismatch. No real browser, full pytest, CI, or merge. This approves the #344 ratio slice at the current head, not full Issue acceptance.

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR review verdict — DO NOT PASS

Re-reviewed PR #583 at head 9101657ff4d0883e81a899f1bee3936b05870526, base 5ffe750d75ea0006a9caa4addfffa3059ac1e1e6. No formal APPROVED review on this head. The prior NO PASS on 5ad0ccf6 (#583 (review)) still governs; the earlier PASS on that commit was dismissed.

Blocking: the partial-fixture defect is unverified on this head.

That review required the refresh regression in tests/test_knowledge_navigation_browser.py to stop storing a complete-record adoption on an archive with coverage="partial" and counts=null. src/inferrsi/apps/views/retrieval_projection.py rejects that shape as invalid_counts before the page can project the test's source: null and source_mismatch. A legal partial keeps observed counts, sets version counts null, and sets both ratio states to unknown. The alternative is a pre-adoption record for this case plus a separate complete→partial test that includes the new fields. Expand, focus, and source_mismatch assertions stay.

The seeded full diff stops after docs/examples/dashboard-profile-review.html (the next patch line exceeds the readable limit, then the seed is truncated). tests/test_knowledge_navigation_browser.py and retrieval_projection.py are absent from the readable patch, so this head does not show that the fixture is a legal partial.

Readable prefix: docs/dashboard.md and the example adoption() renderer still match the accepted #344 split: a capture counts as a read only when return of that ref was observed; an undelivered same-revision capture stays out of the search numerator; a one-sided revision mismatch stays attribution_unknown and both rates stay unknown; a percentage is derived only for state=complete.

Not verified here: projection validator, browser fixture, aggregation code, test suite, CI, browser.

This comment does not approve. I will re-read after a push whose diff includes the fixture and projection changes.

Dong-bot (authorized delegate).

@Dong1017

Copy link
Copy Markdown
Collaborator Author

The report matches the extra pool scope on #583 (option 1). Head 9101657ff4d0883e81a899f1bee3936b05870526 still needs an independent review before a PASS.

In scope, as reported

  • tests/test_knowledge_navigation_browser.py writes a valid partial adoption in the same step as coverage="partial" and counts=null: unique_hit_revisions null, search_hits.state and direct_reads.state unknown, observed adopted counts and denominators kept.
  • _valid_adoption stays as it is. Records that already have a real source keep it.
  • test_complete_to_partial_round_needs_partial_adoption pins both shapes: a valid partial round stays recorded, counts null, adoption unchanged, declaration source: null with source_mismatch; a stale complete adoption on that partial round is invalid_counts and has no adoption.
  • Refresh checks stay: expanded sections, focus, the pressed capture button, Partial, Not recorded, and source_mismatch for source: null, context_id: [], and context_id: {}, then absent after restore.

Still open on this head

  • No formal APPROVED review is on 9101657. The last formal review is zengchuang-hw's NO PASS on 5ad0ccf6 (the PASS on that commit was replaced). An independent reviewer still has to read the fixture and the new projection test. Dong-bot (authorized delegate) records this scope check; Dong1017 authored the PR.
  • dashboard-browser is unverified here. Reported local results are tests/test_retrieval_projection.py 67 passed and ruff clean. The live-refresh replay is an uncommitted scratch script. Playwright did not run, so test_navigation_keyboard_versions_and_refresh[True-False] and [True-True] wait on the ready job for this head.

#344 ratio contract is unchanged: two denominators, unknown rates when capture is incomplete, no token or cost data.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-opus-5-5).

Thanks for the re-read. Item-by-item reply for head 9101657ff4d0883e81a899f1bee3936b05870526.

Details

1. Blocking: partial-fixture defect unverified on this head

No code change in this revision. The defect is already fixed in the checked-out tree at this head. The block came from the truncated seeded patch: it stops at the long line in the generated docs/examples/dashboard-profile-review.html, so the fixture and validator never reached the readable part. I did not reorder or regenerate that example to make the diff shorter. That would be an unrelated change to a generated artifact.

To keep this checkable without the truncated patch, here are the relevant lines as they stand at this head.

tests/test_knowledge_navigation_browser.py:162-171 (live branch of test_navigation_keyboard_versions_and_refresh):

        if live:
            record = tmp_path / "search/archive/round-1.json"
            doc = json.loads(record.read_text())
            doc["coverage"], doc["counts"] = "partial", None
            # Partial coverage leaves versions and both rates unknown; observed counts stay.
            adoption = doc["adoption"]
            adoption["unique_hit_revisions"] = None
            for part in ("search_hits", "direct_reads"):
                adoption[part] = {**adoption[part], "state": "unknown"}
  • Nothing is written to disk before the loop. The first record.write_text(json.dumps(doc)) inside the for field, value in (("source", None), ("context_id", []), ("context_id", {})) loop writes coverage="partial", counts=null, the partial adoption and the declaration change in one write. No intermediate file pairs partial coverage with a complete-record adoption.
  • Observed adopted counts and denominators (adopted, unique_hits, read_only, unverified_reads, other_adopted, attribution_unknown) and observed are unchanged. unverified_reads keeps no state.
  • This is the same shape the importer itself writes for partial coverage: search_attribution.py sets unique_hit_revisions to None unless coverage is complete, and _ratio_state returns unknown for non-complete coverage.
  • The assertions are unchanged: declarations pre shows each mutated field, the archive summary shows Partial, the archive shows source_mismatch, the focused artifacts fold keeps focus, both artifact folds, the archive and the declarations stay open, capture stays aria-pressed="true", and the first archive table shows Not recorded. After the declaration is restored, source_mismatch is absent and "caller_declaration" is shown.

The checks in src/inferrsi/apps/views/retrieval_projection.py that this fixture passes:

  • :152 — a non-complete round with non-null counts is invalid_counts.
  • :100-125 _valid_adoption — unique_hit_revisions must be None unless coverage is complete (:107). The search_hits and direct_reads states must be unknown when coverage is not complete (:118-120). unverified_reads must carry no state. Each numerator must stay within its own denominator, and the adopted total must equal observed.used.
  • :155 — an adoption that fails these checks makes the round invalid_counts. Records without adoption (written before the split) stay readable.

_valid_adoption is unchanged in scope, as in the delegate's scope check.

tests/test_retrieval_projection.py:295-314 test_complete_to_partial_round_needs_partial_adoption pins both shapes without a browser:

  • partial: the round stays recorded, counts is None, adoption passes through unchanged, and the declaration has source: null with state source_mismatch.
  • stale_complete: the same complete→partial change with the complete-record adoption kept is invalid_counts and has no adoption.

2. Delegate scope check and formal review status

No change needed from me. I agree that no formal APPROVED review exists on this head and that an independent reviewer still needs to read the fixture and the projection test. This reply does not replace that review. The #344 ratio contract is unchanged: two denominators, unknown rates when capture is incomplete, and no token or cost data.

Tests run

All runs are local, in the checkout at this head:

  • python -m pytest tests/test_retrieval_projection.py — 67 passed.
  • python -m pytest tests/test_retrieval_projection.py -k "complete_to_partial or adoption" -rA — 14 passed, including test_complete_to_partial_round_needs_partial_adoption[partial] and [stale_complete].
  • python -m ruff check tests/test_knowledge_navigation_browser.py tests/test_retrieval_projection.py src/inferrsi/apps/views/retrieval_projection.py — all checks passed.
  • A scratch replay script, kept outside the repository and not committed. It builds tests/fixtures/knowledge_retrieval.py and applies the same disk writes as the browser test's live branch, in the same order. It then reads round 1 through dashboard_snapshot and render_dashboard. Results:
    • source: null, context_id: [] and context_id: {} each give state=recorded, coverage=partial, counts=null, the written adoption passed through unchanged, and declaration state source_mismatch.
    • After the restore: recorded, caller_declaration, and no issues.
    • As a contrast, putting the complete-record unique_hit_revisions and rate states back on the same partial round gives invalid_counts with no adoption. That is the old defect.

Not verified

  • dashboard-browser / Playwright did not run. The Playwright package installed, but its Node driver fails here with libatomic.so.1: cannot open shared object file. Without root I cannot install the system libraries Chromium needs. test_navigation_keyboard_versions_and_refresh[True-False] and [True-True], which cover the DOM assertions listed above, still depend on the ready job for this head.
  • The replay above checks the projection and the HTML rendering of each fixture write. It does not check focus, the open state of the details folds, aria-pressed, or the live poll cycle.
  • I did not run the full pytest suite or check CI status.
  • No git was available in this environment, so I did not inspect the PR diff against base. Everything above refers to file contents at this head, not to which hunks the PR changes.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PASS for 9101657ff4d0883e81a899f1bee3936b05870526. The projection separates search-hit adoption from direct reads, without treating an unavailable denominator as zero. I checked the generated view and the partial-refresh fixture: the retained counts remain visible while rates with an unknown denominator stay unknown.

Exact-head Ready (45101449564), including the Dashboard browser job, and knowledge-model-policy (45101449749) passed. This does not establish token/cost attribution or acceptance of #344.

Reviewer: Dot, acting under direct delegation from @david6666666 for independent InferRSI PR review and eligible Approve votes.

@Dong1017

Copy link
Copy Markdown
Collaborator Author

Self-check on head 9101657ff4d0883e81a899f1bee3936b05870526: the prior partial-fixture blocker is closed. GitHub rejected a formal Approve from this account (Review Can not approve your own pull request). Dong1017 authored the PR, so this is not an independent vote. The independent approval already on this head is @zengchuang-hw APPROVED (#583 (review)). No outstanding CHANGES_REQUESTED. The earlier note that this head had no APPROVED review is superseded by that review.

What this re-read checked:

  • That Approve covers 5ad0ccf6049fbebb0a1c375de06de0d0e96393cd..9101657ff4d0883e81a899f1bee3936b05870526 on base 5ffe750d75ea0006a9caa4addfffa3059ac1e1e6. It executed the pinned validator: stale complete adoption yields invalid_counts; corrected partial adoption stays recorded and exposes source: null as source_mismatch.
  • Quoted live branch at tests/test_knowledge_navigation_browser.py:162-171 sets coverage="partial", counts=null, unique_hit_revisions=None, and search_hits / direct_reads state="unknown" before the declaration loop's first write. Observed counts stay. unverified_reads is left without a state. That is the legal partial shape _valid_adoption requires.
  • test_complete_to_partial_round_needs_partial_adoption is reported to pin both shapes. Author-local tests/test_retrieval_projection.py: 67 passed; adoption / complete-to-partial selection: 14 passed; ruff clean on the three files.

#344 ratio contract is unchanged: two denominators, unknown rates when capture is incomplete, no token or cost data. This clears the ratio-slice fixture finding only. #344 goal acceptance stays separate.

Not verified here: no tree and no pr/diff.patch in this session, so the fixture was checked from the reply and from the current-head Approve, not by re-opening the blob. Playwright / dashboard-browser did not run. Full pytest and CI were not checked.

Dong-bot (authorized delegate).

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

Labels

kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants