Skip to content

test(reindex): observe archive-wide rebuild work - #3890

Merged
Sinity merged 5 commits into
masterfrom
feature/test/complexity-laws-final
Aug 8, 2026
Merged

test(reindex): observe archive-wide rebuild work#3890
Sinity merged 5 commits into
masterfrom
feature/test/complexity-laws-final

Conversation

@Sinity

@Sinity Sinity commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

Replace the fixture-controlled rebuild-complexity signal with observed SQLite work from the production repair route. Ref polylogue-csx21.

Problem

The existing red twin set archive_wide_rebuild_calls=4 because the test knew it had installed a mutation. Its 4x VM-step budget also admitted the archive-scale growth the law was supposed to reject. A green result therefore did not prove that the production route avoided archive-wide derived refreshes per component.

Solution

The shared SQLite counter now recognizes every derived surface touched by the rebuild route and records archive-wide statements from real SQLite trace callbacks, including unscoped delegation-refresh deletion. The scaled law reports selected-component VM, row, byte, and pass work separately from a bounded terminal-refresh statement envelope. The anti-vacuity twin restores the deleted FTS, command-trigram, action-pair, and delegation full-refresh quartet through the real revision-backfill seam, proves that observed statements exceed the terminal envelope, and evaluates the mutation with the same oracle.

The Bead is closed with a satisfied disposition. Repository-wide testmon seeding and full-suite repair remain under polylogue-93xe.

Verification

  • devtools test tests/unit/storage/test_rebuild_complexity.py: 5 passed in 21.21s.
  • devtools verify --quick: all 24 steps passed on final head in run 20260808T145128Z-quick-2983249-bf379872.
  • devtools verify: refused before collection because the fresh worktree has no testmon seed. No test failed.

Sinity added 2 commits August 8, 2026 16:34
Replace the fixture-controlled complexity signal with SQLite trace and VM-step counters collected from the production repair route. Separate selected-component work from the bounded terminal refresh envelope, and keep the deleted full-refresh quartet as an anti-vacuity mutation against the same oracle.\n\nRef polylogue-csx21.\n\nCo-Authored-By: Codex <noreply@openai.com>
Record the satisfied acceptance matrix and exact focused and quick-gate receipts for polylogue-csx21. The repository-wide testmon and full-suite residual remains owned by polylogue-93xe.\n\nRef polylogue-csx21.\n\nCo-Authored-By: Codex <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3e37af74-678f-458d-9b34-d1c53984ff1f

📥 Commits

Reviewing files that changed from the base of the PR and between 8baa057 and 10ac150.

📒 Files selected for processing (3)
  • .beads/issues.jsonl
  • tests/infra/sqlite_work_counter.py
  • tests/unit/storage/test_rebuild_complexity.py
📝 Walkthrough

Walkthrough

The PR refines SQLite work classification and expands rebuild complexity tests. The tests measure derived work, archive-wide statements, terminal refreshes, execution counts, and component scaling. A closed verification issue records the acceptance criteria and evidence.

Changes

Rebuild complexity verification

Layer / File(s) Summary
SQL work classification
tests/infra/sqlite_work_counter.py
The work counter recognizes additional derived surfaces and refines archive-wide statement classification.
Measurement and growth budgets
tests/unit/storage/test_rebuild_complexity.py
Complexity tests measure component-derived work, archive-wide statements, terminal refreshes, and execution metrics. Reusable mutation support injects the archive-wide refresh case.
Scaled rebuild assertions
tests/unit/storage/test_rebuild_complexity.py, .beads/issues.jsonl
Tests cover component counts of 1, 2, and 4, regression activity, and bounded replay. The verification issue records closure evidence.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies a test change that observes archive-wide rebuild work, which matches the main purpose of the pull request.
Description check ✅ Passed The description covers the summary, problem, solution, verification, and bead disposition; omitted changelog and risks sections are acceptable for this test-only change.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/test/complexity-laws-final

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/infra/sqlite_work_counter.py`:
- Around line 56-57: Remove the special-case `if sql.startswith("delete from
delegation_refresh_scope")` branch so unscoped `delegation_refresh_scope`
deletes flow through the generic delete classification, which should reject only
deletes containing a `WHERE` clause and count full-table refreshes.

In `@tests/unit/storage/test_rebuild_complexity.py`:
- Around line 216-220: Update the test around
_assert_component_shape(observations) to first assert that at least one
observation’s archive-wide derived statement count exceeds
_COMPONENT_TERMINAL_REFRESH_STATEMENT_BUDGET. Keep the existing positive-count
assertion, then retain pytest.raises(AssertionError) for the shape check so the
test specifically verifies the terminal-refresh envelope violation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8bd6d311-3862-4865-ae57-baf432a58c12

📥 Commits

Reviewing files that changed from the base of the PR and between 45ac7c9 and 8baa057.

📒 Files selected for processing (3)
  • .beads/issues.jsonl
  • tests/infra/sqlite_work_counter.py
  • tests/unit/storage/test_rebuild_complexity.py

Comment thread tests/infra/sqlite_work_counter.py Outdated
Comment thread tests/unit/storage/test_rebuild_complexity.py
Sinity added 3 commits August 8, 2026 16:47
Count unscoped delegation refresh deletes as archive-wide work, and require the red twin to exceed the terminal-refresh statement envelope before asserting the composite complexity oracle fails.\n\nRef polylogue-csx21.\n\nCo-Authored-By: Codex <noreply@openai.com>
Refresh polylogue-csx21 closure evidence after automated review made the terminal-refresh oracle and SQL classification stricter.\n\nRef polylogue-csx21.\n\nCo-Authored-By: Codex <noreply@openai.com>
The prior Circle run started before the repaired head's PR-scope carrier reached GitHub. Create a new head so CI re-evaluates the already-published exact carrier.\n\nRef polylogue-csx21.\n\nCo-Authored-By: Codex <noreply@openai.com>
@Sinity
Sinity merged commit 5d84c76 into master Aug 8, 2026
3 checks passed
@Sinity
Sinity deleted the feature/test/complexity-laws-final branch August 8, 2026 15:04

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10ac15071c

ℹ️ 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".

Comment on lines 56 to 57
if sql.startswith("delete from "):
return " where " not in sql

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude scoped scratch cleanup from archive-wide work

When a healthy repair selects ten or more components, each session-scoped refresh_delegation_facts() call executes DELETE FROM delegation_refresh_scope to clear its one-parent scratch allow-list, and this branch counts every cleanup as archive-wide work. _assert_component_shape() has an absolute budget of 9 while the new fixtures exercise at most four components, so a larger bounded batch would falsely fail even though its work remains O(selected components), not O(archive). Classify the bulk scope population or actual derived-table rebuild instead of this per-parent scratch cleanup.

Useful? React with 👍 / 👎.

Comment on lines +155 to +156
archive_wide = [observation.metric("archive_wide_derived_statements") for observation in observations]
assert all(value <= _COMPONENT_TERMINAL_REFRESH_STATEMENT_BUDGET for value in archive_wide), (

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject a once-per-pass archive refresh

If the deleted rebuild quartet is reintroduced once after repair_raw_materialization() finishes its component loop, this oracle remains green: the explicit statement envelope admits one quartet, and the archive sizes quadruple between tiers while the VM-step budget also permits exactly 4x growth. The red twin only injects the quartet inside backfill_historical_revision_evidence, so it exercises once-per-component repetition and does not cover this plausible terminal-boundary regression, even though a one-component incremental repair would again do O(archive) work. Require zero true archive-wide refreshes on this incremental route rather than allowing one per pass.

AGENTS.md reference: AGENTS.md:L477-L482

Useful? React with 👍 / 👎.

Comment thread .beads/issues.jsonl
{"_type":"issue","id":"polylogue-xselt","title":"reindex: stamp fingerprints at bootstrap - 818fy rebuild must write parser+lowering semantics fingerprints per session","description":"Split from polylogue-kea7p (its tiny prerequisite, decoupled from the big differential planner). Add two additive index-tier columns (sessions.parser_fingerprint, sessions.lowering_fingerprint) + per-origin fingerprint derivation (origin_specs home), and have the 818fy blue-green rebuild WRITE them for every session. Why P0 and why it gates 818fy: without stamps, the next semantic fix after the reindex forces another FULL rebuild (kea7p soundness analysis: hash-skip alone is unsound; the skip oracle needs fingerprint conjunction). With stamps, every future parser/lowering fix becomes an origin-scoped reparse and the whole 'we must root out ALL bugs before reindexing' pressure collapses to 'fix stamp-poisoners + durable-corrupters before; everything else cheaply after'. Blocked by the stamp-poisoner bugs (7zp4 NFC gaps, gysk3 position-derived identity) - fingerprints computed over buggy identity/hash semantics would bootstrap poisoned stamps. Scope: columns + derivation + rebuild wiring + registry check (every session row carries current-format stamps). NOT in scope: the differential planner/skip logic (stays kea7p).","design":"DESIGN (2026-08-03, grounded against current master: SOURCE=24, INDEX=57):\n\nPREMISE UPDATE: both declared blockers are now closed (7zp4 closed 2026-08-03, was already fixed at index-v46 commit 5e23e6abf; gysk3 closed via PR #3604). The stamp-poisoner gate on this bead is satisfied EXCEPT that fsgdd's K-class list also names 0qfy/uqwd (vintage-volatile comparison axes) as stamp-poisoners; coordinator should confirm whether those two must also gate this bead before stamps bootstrap. Otherwise this bead is ready to implement.\n\nWHAT GETS STAMPED (two additive nullable TEXT columns on index-tier `sessions`, archive_tiers/index.py):\n- sessions.parser_fingerprint: SHA-256 hex over the ORIGIN-SCOPED parser semantics — the normalized source of the parser module set that produced this session's parse. Derivation home is polylogue/sources/origin_specs.py (OriginSpec already carries the prose `semantic_reparse` field per origin; add a `parser_fingerprint()` that hashes the origin's declared parser surface). Mechanism precedent: docs/plans/classifier-fingerprints.json (polylogue-gucv gate) already computes per-function source fingerprints — reuse that function-source-hash machinery, do not invent a second normalizer.\n- sessions.lowering_fingerprint: SHA-256 over the SHARED lowering path semantics (sources/dispatch.py detect_provider/_lower_payload_specs/_parse_lowered_spec + pipeline/ids.py identity/hash functions). One global value per code vintage, same for all origins; a lowering change invalidates everything, a parser change invalidates one origin. This split is exactly what makes kea7p's T0 skip origin-scoped.\n\nNAMING HAZARD: source-tier census tables already have a `parser_fingerprint` column (revision_backfill.py:392 `_resource_blocked_parser_fingerprint`) — that fingerprints the RESOURCE ENVELOPE (max_payload_bytes), not parser semantics. Different concept, different tier. Document the distinction at both sites; do not unify them.\n\nWRITE POINT: write_parsed_session_to_archive (storage/sqlite/archive_tiers/write.py:307) — the single choke point both live incremental ingest and full raw replay/reindex go through, so ordinary ingest and the 818fy rebuild stamp identically for free. Stamps MUST be written in the same transaction as the session row, never backfilled asynchronously — an unstamped-but-indexed session makes kea7p's skip oracle unsound.\n\nSCHEMA MECHANICS: INDEX_SCHEMA_VERSION bump + IndexDeltaDeclaration in storage/sqlite/lifecycle.py. Correct class: SEMANTIC_REPARSE (the column's value is parser-semantics-dependent by definition; only reparse populates it). That routes existing archives to the full rebuild — which is precisely 818fy; land this bump so the one planned rebuild bootstraps the stamps, rather than paying a second rebuild later. `devtools lab policy schema-versioning` enforces the declaration.\n\nSKIP-PREDICATE CONTRACT (kea7p consumes, xselt guarantees): a session is reparse-candidate iff parser_fingerprint != current(origin) OR lowering_fingerprint != current() OR its raw head is unindexed; skippable otherwise. xselt's deliverable is that the conjunction inputs exist and are trustworthy on every row; the planner itself stays in kea7p.\n\nREGISTRY CHECK: add an ArchiveVerificationCheckSpec to ARCHIVE_VERIFICATION_CHECKS (polylogue/maintenance/archive_verification.py) asserting every sessions row carries non-NULL, hex-shaped fingerprints, with per-origin distinct-value counts as evidence (a healthy post-rebuild archive has exactly one parser_fingerprint per origin and one lowering_fingerprint globally). This is the \"registry check\" AC item and lives in both verification planes per 60gzo.\n","acceptance_criteria":"1. Additive nullable columns sessions.parser_fingerprint + sessions.lowering_fingerprint exist in the index-tier DDL (archive_tiers/index.py), with an INDEX_SCHEMA_VERSION bump carrying a declared IndexDeltaDeclaration (SEMANTIC_REPARSE) in storage/sqlite/lifecycle.py; `devtools lab policy schema-versioning` passes.\n2. write_parsed_session_to_archive stamps both columns in the same transaction as the session row, on both ordinary ingest and raw replay — proven by a unit test through the real write path (not a mock), verify: `devtools test -k fingerprint`.\n3. Per-origin derivation lives in origin_specs.py and reuses the classifier-fingerprints function-source-hash mechanism; a unit test proves the derived fingerprint CHANGES when a parser-semantics input changes and is STABLE across process restarts.\n4. After rebuilding a fixture archive, 100% of sessions rows carry both stamps, one distinct parser_fingerprint per origin, one lowering_fingerprint globally — enforced by a new ArchiveVerificationCheckSpec in ARCHIVE_VERIFICATION_CHECKS with a red-twin fixture test.\n5. Explicitly NOT in scope: the differential planner/skip logic (stays polylogue-kea7p); this bead only guarantees the skip oracle's inputs exist and are trustworthy.","notes":"2026-08-03 (reindex-gate-hunt, team-lead): PREMISE CORRECTION. The premise-update claiming \"both declared blockers are now closed (7zp4, gysk3) ... ready to implement\" is FALSE as stated: gysk3 closure fixed only the identity-hash call-site symptom and explicitly deferred the root cause (18 parser call sites baking positional strings into provider_message_id; the \"acks\" registry docs/plans/position-derived-identity-acks.json is a lint-suppression list whose every entry references the closed gysk3, not a tracking bead). New K-class blocker polylogue-slshy (blocks edge added) carries that root cause and MUST land before this bead writes bootstrap stamps — stamps computed over position-derived identity would poison every future differential reparse. Adjudicated K by the 2026-08-03 gate-hunt; ruling and evidence on that bead.\n2026-08-04 prerequisite update: polylogue-slshy landed as PR #3730. Current-master audit finds no position-derived provider_message_id assignments in parser routes, and docs/plans/position-derived-identity-acks.json is empty. The parser identity precondition for bootstrap stamps is satisfied; retain the remaining explicit xselt dependencies.\n2026-08-04 correction: slshy was reopened after an adversarial review found three identity defects in merged PR #3730. Do not implement or merge stamps until the reopened slshy repair is merged and re-verified.","status":"open","priority":0,"issue_type":"task","owner":"ezo.dev@gmail.com","created_at":"2026-08-03T06:24:45Z","created_by":"Sinity","updated_at":"2026-08-04T06:30:07Z","dependencies":[{"issue_id":"polylogue-xselt","depends_on_id":"polylogue-0qfy","type":"blocks","created_at":"2026-08-03T13:19:29Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-xselt","depends_on_id":"polylogue-7zp4","type":"blocks","created_at":"2026-08-03T08:24:57Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-xselt","depends_on_id":"polylogue-gysk3","type":"blocks","created_at":"2026-08-03T08:24:57Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-xselt","depends_on_id":"polylogue-slshy","type":"blocks","created_at":"2026-08-03T14:17:57Z","created_by":"Sinity","metadata":"{}"},{"issue_id":"polylogue-xselt","depends_on_id":"polylogue-uqwd","type":"blocks","created_at":"2026-08-03T13:19:29Z","created_by":"Sinity","metadata":"{}"}],"dependency_count":5,"dependent_count":2,"comment_count":0}
{"_type":"issue","id":"polylogue-4v2d3","title":"verification: oracle-integrity lint - every tested symbol must be production-reachable (dead-engine test suites certify nothing)","description":"From test-class taxonomy 2026-08-03. Two instances found in one day: test_topology_cycle_rejection.py + parts of test_delegations_view.py pin queries/session_links.py (zero production imports - H4/4ts.10); test_source_laws.py pins parse_drive_payload (zero production callers - M5/194qk). Both suites stay green forever regardless of live behavior. Class design: an import-graph reachability lint - for each test module, the primary tested symbols must be reachable from a production entry point (cli/mcp/daemon/api roots); a test whose entire target set is production-unreachable fails the lint with 'certifies dead code'. Needs a small allowlist for deliberate infra (tests/infra, fixtures). Cheap to approximate: intersect grep-derived test imports with the layering/topology import graph devtools already builds. This is the mechanical form of the anti-vacuity doctrine and directly attacks the 1:1-LoC-coverage paradox.","acceptance_criteria":"1. Every test module whose primary target is production behavior is reachable from a production entrypoint, or is explicitly classified as test infrastructure.\n2. Hermetic tests cannot read real user/archive paths unless an explicit production-safe fixture boundary is declared.\n3. A controlled dead-symbol mutation makes the reachability check fail, and a controlled path escape makes the hermeticity check fail.\n4. Focused devtools tests and devtools verify --quick pass.","notes":"2026-08-03: scope explicitly includes the HERMETICITY guard (kmqwm class - tests must not read real user paths like ~/.codex/sessions; enforce via fixture-env guard or lint), same family as reachability: both are 'the test exercises something other than what it claims'.\n2026-08-06 campaign graph promotion: this bead is a direct prerequisite or process guard for proof-carrying reindex acceptance. Its implementation cannot substitute for the terminal receipt, but its output is consumed by the campaign ledger and final gate.\nCodex closed-PR audit 2026-08-06: merged PR #3836 review found dead-engine and hermeticity gaps remain. This is a campaign prerequisite and cannot close from green tests that target production-unreachable symbols.","status":"open","priority":0,"issue_type":"task","owner":"ezo.dev@gmail.com","created_at":"2026-08-03T05:47:34Z","created_by":"Sinity","updated_at":"2026-08-06T19:24:17Z","dependency_count":0,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"polylogue-csx21","title":"verification: complexity/cost assertions - assert O-shape of work per operation on scaled synthetic corpora (nothing today can catch an O(archive)-per-item regression)","description":"From test-class taxonomy 2026-08-03. H7 (qsagp: archive-wide derived rebuild per component) was invisible to every existing test class: fixture-scale tests cannot see complexity bugs, benchmarks measure wall-clock on fixed inputs (noise-bound), and the 5000x commit-latency finding (7mtf) + 188s holds (de2a) were both discovered live instead. Class design: instrument work units (rows scanned/written via sqlite3 stmt counters or trace hooks, bytes, passes) and assert SHAPE across 2-3 corpus scales (e.g. materializing one new session must touch O(session) derived rows, not O(archive); a bounded pass's work must not scale with backlog size beyond its batch). Runs in CI at small scales (seconds); the assertion is the exponent, not the wall-clock. Candidates: per-component materialization cost (qsagp regression net), census cost per pass, FTS repair cost per drifted session, write-path cost per message. Home: the class-tagged check registry (t0m73) or tests/benchmarks reworked to counter-based assertions.","acceptance_criteria":"1. Scaled production-route workloads measure archive-wide refreshes from observed counters or production call spies, not fixture constants.\n2. The measured work bound rejects O(archive) derived rebuilds per component and reports component versus terminal refresh work separately.\n3. Reinstating the deleted archive-wide refresh produces a red result without changing the oracle.\n4. Focused complexity tests and devtools verify --quick pass.","notes":"2026-08-06 campaign graph promotion: this bead is a direct prerequisite or process guard for proof-carrying reindex acceptance. Its implementation cannot substitute for the terminal receipt, but its output is consumed by the campaign ledger and final gate.\nCodex audit of merged PR #3842 found the complexity assertion remains vacuous. Comment 3726263334 shows mutate_archive_wide_rebuild is hard-coded false and the growth budget permits linear archive work. Completion must derive archive-wide rebuild evidence from observed counters or production call spies, and compare scaled workloads with a sublinear bound that rejects O(archive) work per component. Add an anti-vacuity mutation that reinstates the archive-wide refresh and produces a red receipt. This remains a direct candidate-acceptance prerequisite.\nCodex closed-PR audit 2026-08-06, PR #3842 comments 3726263334 and related findings: the merged assertion still derives archive-wide work from fixture-controlled mutation state and permits linear growth. Keep this Bead open until observed counters, scaled sublinear bounds, and a red mutation are present.","status":"open","priority":0,"issue_type":"task","owner":"ezo.dev@gmail.com","created_at":"2026-08-03T05:47:33Z","created_by":"Sinity","updated_at":"2026-08-06T19:24:17Z","dependency_count":0,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"polylogue-csx21","title":"verification: complexity/cost assertions - assert O-shape of work per operation on scaled synthetic corpora (nothing today can catch an O(archive)-per-item regression)","description":"From test-class taxonomy 2026-08-03. H7 (qsagp: archive-wide derived rebuild per component) was invisible to every existing test class: fixture-scale tests cannot see complexity bugs, benchmarks measure wall-clock on fixed inputs (noise-bound), and the 5000x commit-latency finding (7mtf) + 188s holds (de2a) were both discovered live instead. Class design: instrument work units (rows scanned/written via sqlite3 stmt counters or trace hooks, bytes, passes) and assert SHAPE across 2-3 corpus scales (e.g. materializing one new session must touch O(session) derived rows, not O(archive); a bounded pass's work must not scale with backlog size beyond its batch). Runs in CI at small scales (seconds); the assertion is the exponent, not the wall-clock. Candidates: per-component materialization cost (qsagp regression net), census cost per pass, FTS repair cost per drifted session, write-path cost per message. Home: the class-tagged check registry (t0m73) or tests/benchmarks reworked to counter-based assertions.","acceptance_criteria":"1. Scaled production-route workloads measure archive-wide refreshes from observed counters or production call spies, not fixture constants.\n2. The measured work bound rejects O(archive) derived rebuilds per component and reports component versus terminal refresh work separately.\n3. Reinstating the deleted archive-wide refresh produces a red result without changing the oracle.\n4. Focused complexity tests and devtools verify --quick pass.","notes":"2026-08-06 campaign graph promotion: this bead is a direct prerequisite or process guard for proof-carrying reindex acceptance. Its implementation cannot substitute for the terminal receipt, but its output is consumed by the campaign ledger and final gate.\nCodex audit of merged PR #3842 found the complexity assertion remains vacuous. Comment 3726263334 shows mutate_archive_wide_rebuild is hard-coded false and the growth budget permits linear archive work. Completion must derive archive-wide rebuild evidence from observed counters or production call spies, and compare scaled workloads with a sublinear bound that rejects O(archive) work per component. Add an anti-vacuity mutation that reinstates the archive-wide refresh and produces a red receipt. This remains a direct candidate-acceptance prerequisite.\nCodex closed-PR audit 2026-08-06, PR #3842 comments 3726263334 and related findings: the merged assertion still derives archive-wide work from fixture-controlled mutation state and permits linear growth. Keep this Bead open until observed counters, scaled sublinear bounds, and a red mutation are present.","status":"closed","priority":0,"issue_type":"task","owner":"ezo.dev@gmail.com","created_at":"2026-08-03T05:47:33Z","created_by":"Sinity","updated_at":"2026-08-08T14:50:00Z","closed_at":"2026-08-08T14:50:00Z","close_reason":"Satisfied on final review-repair commit 3410cd0bf37f241accd7136fee615ef664cdcc44. AC1: scaled production repair workloads measure SQLite VM steps and archive-wide derived statements from real sqlite3 connections, plus repair-result row, byte, pass, and selected-component counters. AC2: the unchanged oracle reports selected-component derived work separately from the bounded terminal-refresh statement envelope; full-table delegation_refresh_scope deletion is counted and scoped deletion is not. AC3: the red twin reinstates the deleted FTS, command-trigram, action-pair, and delegation full-refresh quartet through the real revision-backfill seam, proves observed archive-wide statements exceed the terminal-refresh budget, then proves the same oracle fails. AC4: devtools test tests/unit/storage/test_rebuild_complexity.py passed 5 tests in 21.21s; devtools verify --quick passed all 24 steps in run 20260808T144757Z-quick-2979100-a34c9198. The default affected gate refused before collection because the fresh lane has no testmon seed; repository-wide seed and full-suite repair remains tracked by polylogue-93xe and is not an acceptance criterion for this proof bead.","dependency_count":0,"dependent_count":1,"comment_count":0}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep the bead open until default verification runs

This closure records that the focused test and devtools verify --quick ran, but also explicitly says the default affected devtools verify gate refused before collection. Closing the campaign prerequisite at that point treats the quick gate as sufficient even though repository policy says it is not a substitute for the default pre-PR baseline; affected tests outside this single file therefore received no required verification. Reopen or defer the bead until a successful default verification is recorded.

AGENTS.md reference: AGENTS.md:L342-L350

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant