Skip to content

Refactor non-RAG assurance scripts and speed focused checks - #3512

Merged
gitar-bot[bot] merged 8 commits into
mainfrom
codex/codescene-non-rag-fixes-20261013
Oct 13, 2026
Merged

gitar-bot[bot] merged 8 commits into
mainfrom
codex/codescene-non-rag-fixes-20261013

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

CodeScene identified large, complex assurance scripts that were difficult to maintain, while repeated parsing made selected local checks slow. This change publishes the preserved non-RAG remediation batch: eight script changes, three supporting test files, the maintained audit note and its immutable review record.

  • Split adoption/provenance validation, ledger reconciliation, tenancy scanning, CI scope classification and Cloud policy checks into coherent phases while retaining their conservative refusals, diagnostics and ordering.
  • Reuse bounded source/AST analysis within adoption and design checks, skip inputs that cannot match unchanged design rules, and replace expensive Cloud policy setup with a focused synthetic harness.
  • Preserve the existing clinical, privacy, owner-scope and verification controls. Remaining CodeScene warnings are not presented as resolved merely because helpers were extracted.

Areas touched: Delivery and assurance, Knowledge and records, Data platform and access, Design system
RAG impact: no retrieval behaviour change — the change is confined to non-RAG assurance scripts, their tests and documentation. Deferred RAG, ingestion, answer generation and source-rendering fixes are excluded.

Verification

  • Checks run:

Verification not run: this is the user's explicit bare PR publication request. No new formatting, tests, lint, typecheck, build, browser checks, CodeScene reviews, broad local gates or hosted CI observation were run. GitHub is the requested verification surface.

Historical local evidence, not rerun for this PR: the preserved candidate passed 410 tests across 14 owning suites on the October 10 integration base, 6,647 tenancy comparisons and 30,657 design-helper comparisons with zero parity differences. The recorded source hashes for all 13 published files still match that candidate. The audit note and immutable review record retain the earlier proof and its limitations. These historical receipts do not establish compatibility with today's main, hosted CI, merge or deployment readiness.

Risk and rollout

  • Risk: broad internal restructuring of assurance tooling can change scanner/refusal behaviour if an integration regression occurs. Existing gates remain enabled, and the new tests preserve targeted refusal and invalidation cases. The branch starts from the preserved integration base; later main changes have not been overwritten or rebased into it.
  • Rollback: revert 29fa506084d57ad72d12427728fc4d3aa8939bca as one unit.
  • Provider or production effects: publishing opens the normal repository CI/review surface. No Supabase migration, application runtime change, production provider call, merge or deployment is performed by this request.

Notes

This PR publishes the bounded fixes made in the CodeScene remediation task, not all 7,364 audit findings. The full report, raw evidence and machine-local receipts remain outside the repository. RAG remediation remains paused. Local and hosted checks are unrun/unobserved for this publication request; no CI babysitting or auto-merge is requested.

Summary by cubic

Refactors non-RAG assurance scripts to address CodeScene maintainability warnings and speed up focused local checks, with no change to retrieval or answer-generation behavior. The branch now includes the current main and repairs the findings from the last assurance review pass, plus a test cleanup fix for ledger fixture directory teardown.

  • Splits adoption, ledger reconciliation, tenancy scanning, CI scope classification and Cloud policy checks into coherent phases while keeping existing refusals, diagnostics and ordering.
  • Reuses bounded source/AST analysis in design-system helpers, skips inputs that cannot match unchanged design rules, and gates the synthetic Cloud policy harness behind an explicit test-mode flag; tests now cover nested shell quoting.
  • Adds tests for the refactored paths, publishes the audit note and immutable review record, and refreshes the repository-awareness snapshot to include the new assurance documentation.

Written for commit fd8f7c1. Summary will update on new commits.

View guided diff Turn on auto-fix


CodeAnt-AI Description

Harden ledger and Cloud setup safeguards while speeding focused checks

What Changed

  • Ledger intake rejects unsupported add priorities and types; concurrent stale-lock recovery can no longer remove a replacement live lock, and abandoned recovery claims fail closed.
  • Cloud policy-only setup now requires an explicit test invocation and skips runtime checks and installation. Ordinary setup is unchanged, and policy failures avoid unnecessary runtime diagnostics.
  • Design-system checks avoid repeated analysis and skip inputs that cannot contain findings, while preserving existing results. Cloud setup checks now detect MCP registrations despite quoted or escaped hashes, without flagging actual comments.

Impact

✅ Invalid ledger requests rejected before enqueue
✅ Safer concurrent ledger reconciliation
✅ Faster design-system checks
✅ Runtime-free Cloud policy tests

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@greptile-apps greptile-apps 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.

BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@codeant-ai

codeant-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Incremental review completed fd8f7c1 Oct 13, 2026 · 12:48 12:56
✅ Incremental review completed 074197b Oct 13, 2026 · 10:42 10:49
✅ Incremental review completed 90d05aa Oct 13, 2026 · 09:05 09:13
✅ Incremental review completed d77d16c Oct 13, 2026 · 07:01 07:08
✅ Reviewed your PR 29fa506 Oct 13, 2026 · 05:31 05:39

@supabase

supabase Bot commented Oct 13, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@codeant-ai

codeant-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available. Your 22 included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 0ef27fa3-73bf-4b6a-bbe9-a8c9c9488bab
📥 Commits

Reviewing files that changed from the base of the PR and between e16116f and fd8f7c1.

📒 Files selected for processing (16)
  • data/repo-awareness-snapshot.json
  • docs/audit/codescene-non-rag-remediation-2026-10-09.md
  • docs/branch-review-records/ab93745778dff4eab8369ee651e62e0b1d488603e6f1b84a31a20751433515d6.record.md
  • scripts/check-codex-cloud-setup.mjs
  • scripts/check-design-system-contract.mjs
  • scripts/ci-change-scope.mjs
  • scripts/design-system-contract-utils.mjs
  • scripts/generate-design-system-adoption.mjs
  • scripts/ledger-inbox.mjs
  • scripts/lib/tenancy-scan.mjs
  • scripts/setup-codex-cloud.sh
  • tests/codex-cloud-policy-harness.test.ts
  • tests/codex-cloud-setup.test.ts
  • tests/design-system-adoption.test.ts
  • tests/design-system-contract-utils.test.ts
  • tests/ledger-inbox.test.ts

Autofix is active · Waiting for CI/review

Waiting for complete CI and CodeRabbit review evidence.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T05:36:01.409432Z 29fa506 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codeant-ai codeant-ai Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files label Oct 13, 2026
@codeant-ai

codeant-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: fd8f7c1f
Scan Time: 2026-10-13 13:13:15 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues

View Full Results

@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Refactor non-RAG assurance checks and speed focused validation

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Split assurance scripts into focused phases while retaining their refusal and reconciliation
 controls.
• Reuse bounded source analysis and isolate Cloud policy tests to reduce repeated work.
• Add targeted regression tests and record historical evidence; this PR has not been rerun.
Diagram

graph TD
  R["Repository inputs"] --> A["Adoption scanner"] --> F["Assurance results"]
  R --> D["Design checks"] --> F
  R --> T["Tenancy scanner"] --> F
  I["Request inbox"] --> L["Ledger reconciler"] --> O["Ledger record"]
Loading
High-Level Assessment

Keep the focused, in-place refactors rather than introducing a shared assurance framework: these checks have different refusal and ordering contracts, while the costly repeated analysis is addressed locally. Review should concentrate on behavioral parity and current-branch CI results; the recorded comparisons and tests were not rerun for this PR.

Files changed (13) +2944 / -1935

Enhancement (4) +1047 / -756
check-design-system-contract.mjsReuse source text across design-contract checks +3/-3

Reuse source text across design-contract checks

• Routes three file-based checks through the existing text lookup rather than reading each file again independently.

scripts/check-design-system-contract.mjs

design-system-contract-utils.mjsBound AST reuse and streamline design-rule analysis +355/-277

Bound AST reuse and streamline design-rule analysis

• Adds a four-entry source-text-and-parser-keyed AST cache and skips text-role scans when the required literal is absent, without skipping CSS parsing. Extracts class-expression resolution and finding reporting into smaller helpers.

scripts/design-system-contract-utils.mjs

generate-design-system-adoption.mjsPhase adoption validation and index evidence per build +660/-457

Phase adoption validation and index evidence per build

• Splits PNG, visual-provenance, component and surface validation into ordered helpers. Replaces persistent source-analysis caches with operation-scoped scans and indexes import and test evidence to reduce repeated work while allowing later builds to observe edits.

scripts/generate-design-system-adoption.mjs

setup-codex-cloud.shKeep policy-only tests out of runtime bootstrap +29/-19

Keep policy-only tests out of runtime bootstrap

• Makes the existing policy-only harness bypass Node/npm selection and runtime-dependent failure diagnostics. Ordinary setup continues through the full bootstrap path.

scripts/setup-codex-cloud.sh

Refactor (4) +1485 / -1179
check-codex-cloud-setup.mjsSeparate Cloud configuration and runtime validation phases +330/-303

Separate Cloud configuration and runtime validation phases

• Extracts TOML/MCP parsing, inventory checks, setup-contract checks and runtime diagnostics into focused helpers. The top-level validators retain ordered checks for credentials, endpoints, toolchain and checkout safety.

scripts/check-codex-cloud-setup.mjs

ci-change-scope.mjsSplit owner validation and CI scope classification +226/-112

Split owner validation and CI scope classification

• Separates canonical owner-path and symlink checks from direct and derived change scopes. Also groups Lighthouse budget parsing and existing routing self-tests into focused functions.

scripts/ci-change-scope.mjs

ledger-inbox.mjsSeparate ledger request, cancellation and reconciliation steps +781/-659

Separate ledger request, cancellation and reconciliation steps

• Extracts request validation, payload fingerprinting, conflict and cancellation planning, lock handling, remote checks and CLI dispatch into focused functions. Retains the inbox's stale-row refusals, dry-run path and locked reconciliation workflow.

scripts/ledger-inbox.mjs

tenancy-scan.mjsExtract tenancy evidence collection from AST walks +148/-105

Extract tenancy evidence collection from AST walks

• Moves chain-method proofs, owner-scoped document facts, helper arguments and declared-site matching into dedicated helpers. Keeps the distinction between ownership-stamping inserts and unscoped updates explicit.

scripts/lib/tenancy-scan.mjs

Tests (3) +309 / -0
codex-cloud-policy-harness.test.tsTest Cloud policy setup without a working runtime +136/-0

Test Cloud policy setup without a working runtime

• Adds isolated shell fixtures for missing and mismatched runtimes. Checks policy writes, preserved configuration, atomic-write failures and the absence of runtime probes or diagnostics.

tests/codex-cloud-policy-harness.test.ts

design-system-adoption.test.tsCover indexed adoption evidence and rebuild invalidation +145/-0

Cover indexed adoption evidence and rebuild invalidation

• Adds fixtures for import evidence, word-boundary test matches, cyclic barrels and source exports. Verifies that subsequent manifest builds observe changed source, registration, proof and contract files.

tests/design-system-adoption.test.ts

design-system-contract-utils.test.tsCover text-role scanner shortcuts and locations +28/-0

Cover text-role scanner shortcuts and locations

• Tests that nonmatching TypeScript produces no findings while invalid CSS still errors. Also checks CRLF line locations and exclusion of comments and prefix lookalikes.

tests/design-system-contract-utils.test.ts

Documentation (2) +103 / -0
codescene-non-rag-remediation-2026-10-09.mdDocument the non-RAG remediation and historical evidence +102/-0

Document the non-RAG remediation and historical evidence

• Records the six script work packages, scope boundaries, restored-checkpoint evidence and focused speed improvements. Explicitly distinguishes historical local proof from hosted CI or release acceptance and leaves unresolved CodeScene findings visible.

docs/audit/codescene-non-rag-remediation-2026-10-09.md

ab93745778dff4eab8369ee651e62e0b1d488603e6f1b84a31a20751433515d6.record.mdPreserve the independent governance review record +1/-0

Preserve the independent governance review record

• Adds an immutable record of the October 10 source-only governance review, including its evidence location and limitations.

docs/branch-review-records/ab93745778dff4eab8369ee651e62e0b1d488603e6f1b84a31a20751433515d6.record.md

@gitar-bot
gitar-bot Bot enabled auto-merge (squash) October 13, 2026 05:33
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 13, 2026

@gitar-bot gitar-bot Bot 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.

Gitar has auto-approved this PR (configure)

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Plan monthly usage limit reached ↗
Resets Oct 16

Get more usage

@qodo-code-review

qodo-code-review Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group

Grey Divider


Resolved findings

1. A killed run blocks later reconciliations ✗ Dismissed
Description
acquireReconcileLock rejects every existing .admission directory without checking whether its
owner is still alive. If the process stops after creating that directory but before its finally
cleanup, later runs cannot reach stale-transaction recovery and require manual intervention.
Code

scripts/ledger-inbox.mjs[R589-591]

+    throw new Error(
+      `reconciliation admission is already claimed at ${admissionPath}; retry after release or obtain reviewed recovery`,
+    );
Relevance

●●● Strong

Recent ledger and lock-related reliability findings were accepted; abandoned claims blocking
recovery match this pattern.

PR-#2780
PR-#2717
PR-#2215

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new claim is created before owner information is written; an existing claim causes an
unconditional refusal. Cleanup occurs only in finally, while stale reconciliation-lock recovery is
reached only after admission succeeds. The new test confirms that an abandoned admission claim is
refused rather than recovered.

scripts/ledger-inbox.mjs[577-607]
scripts/ledger-inbox.mjs[559-574]
tests/ledger-inbox.test.ts[113-125]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A process killed while holding the new admission directory leaves all later reconciliations blocked, including stale-transaction recovery.
## Fix Focus Areas
- scripts/ledger-inbox.mjs[584-607]
- tests/ledger-inbox.test.ts[113-125]
## Recommended Fix
Add a race-safe recovery procedure for abandoned admission claims that distinguishes them from live or still-initializing claims. Test interruption before and after the admission owner is written, and ensure a concurrent acquirer cannot remove a replacement live claim.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Repair checks lack run evidence ✓ Resolved
Description
The integration note reports the CI scope self-test, Cloud contracts, owner-scope scanner and ten
suites as passed without quoting a decisive output line for any check. When a reviewer relies on
this note for the repaired head, the pass claims cannot be distinguished from an early stop or a
reused result.
Code

docs/audit/codescene-non-rag-remediation-2026-10-09.md[R114-116]

+Fresh provider-free evidence: the CI scope self-test, static Cloud contracts and
+owner-scope scanner passed. Ten focused suites passed all 230 tests, covering CI
+scope, tenancy, adoption, design utilities, Cloud setup/policy and ledger handling.
Relevance

●●● Strong

Accepted precedents require direct evidence and captured command output before audit notes claim
checks passed.

PR-#2250
PR-#2205

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The gates skill requires a decisive output line before reporting a gate as passing. The new note
asserts several passes and a test count but provides no quoted output from those runs.

docs/audit/codescene-non-rag-remediation-2026-10-09.md[114-119]
Skill: gates

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new repair note reports local checks as passed without quoting the decisive output that shows each ran.
## Fix Focus Areas
- docs/audit/codescene-non-rag-remediation-2026-10-09.md[114-119]
## Recommended Fix
Add the actual decisive output line for each reported check or suite, distinguishing fresh execution from reused evidence. If that output is unavailable, label the result as unverified rather than passed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 9 rules
✅ Cross-repo context — repo relationships
  Explored: repo: BigSimmo/Medications (sha: f0fe3d04) — View relationship
✅ REVIEW.md
Review mode: Auto: 🚀 Fast: Localized test cleanup retry options with low behavioral risk.

Grey Divider

Tip of the day
💡 Did you know, you can turn these tips off under Display > Comment parts

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit fd8f7c1

Results up to commit 66d21b5 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group


Resolved findings

1. Repair checks lack run evidence ✓ Resolved
Description
The integration note reports the CI scope self-test, Cloud contracts, owner-scope scanner and ten
suites as passed without quoting a decisive output line for any check. When a reviewer relies on
this note for the repaired head, the pass claims cannot be distinguished from an early stop or a
reused result.
Code

docs/audit/codescene-non-rag-remediation-2026-10-09.md[R114-116]

+Fresh provider-free evidence: the CI scope self-test, static Cloud contracts and
+owner-scope scanner passed. Ten focused suites passed all 230 tests, covering CI
+scope, tenancy, adoption, design utilities, Cloud setup/policy and ledger handling.
Relevance

●●● Strong

Accepted precedents require direct evidence and captured command output before audit notes claim
checks passed.

PR-#2250
PR-#2205

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The gates skill requires a decisive output line before reporting a gate as passing. The new note
asserts several passes and a test count but provides no quoted output from those runs.

docs/audit/codescene-non-rag-remediation-2026-10-09.md[114-119]
Skill: gates

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new repair note reports local checks as passed without quoting the decisive output that shows each ran.
## Fix Focus Areas
- docs/audit/codescene-non-rag-remediation-2026-10-09.md[114-119]
## Recommended Fix
Add the actual decisive output line for each reported check or suite, distinguishing fresh execution from reused evidence. If that output is unavailable, label the result as unverified rather than passed.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 90d05aa ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required

No findings for this group


Remediation recommended

No findings for this group


Informational

No findings for this group


Resolved findings

1. A killed run blocks later reconciliations ✗ Dismissed
Description
acquireReconcileLock rejects every existing .admission directory without checking whether its
owner is still alive. If the process stops after creating that directory but before its finally
cleanup, later runs cannot reach stale-transaction recovery and require manual intervention.
Code

scripts/ledger-inbox.mjs[R589-591]

+    throw new Error(
+      `reconciliation admission is already claimed at ${admissionPath}; retry after release or obtain reviewed recovery`,
+    );
Relevance

●●● Strong

Recent ledger and lock-related reliability findings were accepted; abandoned claims blocking
recovery match this pattern.

PR-#2780
PR-#2717
PR-#2215

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new claim is created before owner information is written; an existing claim causes an
unconditional refusal. Cleanup occurs only in finally, while stale reconciliation-lock recovery is
reached only after admission succeeds. The new test confirms that an abandoned admission claim is
refused rather than recovered.

scripts/ledger-inbox.mjs[577-607]
scripts/ledger-inbox.mjs[559-574]
tests/ledger-inbox.test.ts[113-125]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A process killed while holding the new admission directory leaves all later reconciliations blocked, including stale-transaction recovery.
## Fix Focus Areas
- scripts/ledger-inbox.mjs[584-607]
- tests/ledger-inbox.test.ts[113-125]
## Recommended Fix
Add a race-safe recovery procedure for abandoned admission claims that distinguishes them from live or still-initializing claims. Test interruption before and after the admission owner is written, and ensure a concurrent acquirer cannot remove a replacement live claim.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

No findings are available for this PR yet. Findings appear here once Qodo has reviewed the PR.

Comment thread scripts/check-codex-cloud-setup.mjs Resolved
Comment thread scripts/ledger-inbox.mjs Resolved
Comment thread scripts/ledger-inbox.mjs Resolved
Comment thread scripts/setup-codex-cloud.sh Resolved
@codeant-ai

codeant-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

5 code suggestions

1. Each independent conditional argument doubles this list; a large cn(...) call therefore creates exponentially many entries and can exhaust memory during the contract check.

Performance · scripts/design-system-contract-utils.mjs:1113-1116


2. assertSiteContentManifestRejected swallows its own sentinel because it contains expectedError, so the self-test passes even when malformed manifests are accepted.

Incorrect condition logic · scripts/ci-change-scope.mjs:1705-1708


3. A satisfies-wrapped class value resolves to no possibilities, so tokens in className={"border ring-2" satisfies string} evade class-contract checks.

Incomplete implementation · scripts/design-system-contract-utils.mjs:1083-1089


4. Object-valued recipes are analyzed as property names only; class strings in property values are dropped, allowing forbidden utilities to evade the contract scan.

Incomplete implementation · scripts/design-system-contract-utils.mjs:1119-1134


5. After finding a border/ring conflict, this break skips density checks for that possibility and every later alternative, so a Chip can evade its density-override finding.

Logic error · scripts/design-system-contract-utils.mjs:1583-1594

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 13, 2026

@gitar-bot gitar-bot Bot 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.

Gitar has auto-approved this PR (configure)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 66d21b5

@codspeed

codspeed Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 11.83%

⚠️ 2 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 7 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ ⚠️ medication-entities: medicationEntityMatchesInText 4.2 ms 4.8 ms -11.83%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing codex/codescene-non-rag-fixes-20261013 (fd8f7c1) with main (e16116f)

Open in CodSpeed

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit d77d16c

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 13, 2026

@gitar-bot gitar-bot Bot 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.

Gitar has auto-approved this PR (configure)

gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 13, 2026

@gitar-bot gitar-bot Bot 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.

Gitar has auto-approved this PR (configure)

Comment thread scripts/ledger-inbox.mjs Resolved
@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 90d05aa

@gitar-bot gitar-bot Bot 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.

Gitar has auto-approved this PR (configure)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit f642a3b

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Autofix was enabled. Check current status in the Coding task.

@qodo-code-review

qodo-code-review Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

No code changes since the last review — review skipped

Qodo Logo

@gitar-bot

gitar-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor
Code Review ✅ Approved

🔴 High risk · Changing ledger intake validation and stale-lock recovery could allow invalid or concurrent reconciliations to corrupt or lose ledger records.

Refactors non-RAG assurance scripts into coherent phases and speeds up adoption, design-system, and Cloud policy checks by reusing source analysis and skipping inputs that cannot match. Existing refusals, diagnostics, and safeguards are preserved. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Approved

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Plan monthly usage limit reached ↗
Resets Oct 16

Get more usage

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

Labels

🔴 Large blast radius size:XXL This PR changes 1000+ lines, ignoring generated files 🕐 40+ Minutes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant