Skip to content
This repository was archived by the owner on Nov 20, 2026. It is now read-only.

[AI] feat(staging): encrypted-budget verifier (CHE-882, stacked on #8) - #54

Draft
congvc-bot-x99[bot] wants to merge 5 commits into
agent/x99-codex-terra/fe0ff3ee3db6from
agent/x99-claude-sonnet/che-882-verifier
Draft

congvc-bot-x99[bot] wants to merge 5 commits into
agent/x99-codex-terra/fe0ff3ee3db6from
agent/x99-claude-sonnet/che-882-verifier

Conversation

@congvc-bot-x99

@congvc-bot-x99 congvc-bot-x99 Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🤖 Status: Parked — CHE-3439, 2026-11-04 ICT. Head 8f83aea71f01e3afbcc48e52cf1483cad441b21d. Preserve the private staging chain #8 -> #54. Staging infrastructure acceptance/deployment is not established by this triage. The staging owner must verify the root and dependent layer on their current heads before revival. This task does not authorize deployment.

Description

Related issue(s)

Testing

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I have read every line of this diff and can explain what each change does and why it is needed

@github-actions github-actions Bot added the AI generated PR authored with AI assistance label Sep 29, 2026
@congvc-bot-x99
congvc-bot-x99 Bot marked this pull request as ready for review September 29, 2026 03:32
@congvc-dev

Copy link
Copy Markdown
Collaborator

ocr receipt — #54 @ a38422f126b4 (range: stacked base 8453c857..head)

Tool: ocr v1.12.10, rule file: none (system built-in). Review model: claude-sonnet-5 via sub2api (fallback lane: claude-opus-5 returns 404 "not available for this group" for the key; claude-opus-4-5 returns "no available accounts").

Files reviewed: 1 (ops/verify-encrypted-budget). Findings: 6 (all P2; no P0/P1).

  • P2 ops/verify-encrypted-budget:55-58 — candidate.json parsed without ownership/mode check, unlike PASSWORD_FILE/KEY_FILE.
  • P2 ops/verify-encrypted-budget:42-45 — private_text() checks then reads separately (TOCTOU); suggests open fd + O_NOFOLLOW + fstat.
  • P2 ops/verify-encrypted-budget:22 — ROOT hardcoded to /home/congvc/..., duplicated from actual-staging.py.
  • P2 ops/verify-encrypted-budget:69 — sqlite file:{path}?mode=ro URI built without percent-encoding.
  • P2 ops/verify-encrypted-budget:66-68 — data.parents containment check too loose; compare data.parent.
  • P2 (low) ops/verify-encrypted-budget:145 — PBKDF2 parameters duplicated from loot-core; add coupling comment.

Low recall: a clean or partial run is not evidence of correctness. Instrument output — the reviewer seat must confirm or reject each finding in its verdict.

@congvc-dev

Copy link
Copy Markdown
Collaborator

OCR receipt — #54 @ 98712c4e2eeaa8ef2e6f119a5c38614e50abdfc7 (range vs stacked base 8453c857)
ocr v1.12.10, review model claude-opus-5-5 via sub2api (configured claude-opus-5 returns 404 on gateway; per-run override), rule file: none in repo (system built-in)
Reviewed 1 file (ops/verify-encrypted-budget); ops/README.md, ops/test_verify_encrypted_budget.py not selected. 8 candidate findings, all rated low by ocr — no P0/P1.

P2

  • ops/verify-encrypted-budget:~158 on-disk compare: is_symlink()/is_file() then read_bytes() is check-then-use and unbounded; suggest single O_NOFOLLOW open + fstat size check.
  • ops/verify-encrypted-budget:~46 FIFO hang: os.open without O_NONBLOCK blocks on a FIFO until helper's 120s kill; S_ISREG check runs too late.
  • ops/verify-encrypted-budget (HTTP read): socket timeout is per-recv, so a trickling server outlives DEADLINE_SECONDS; read in chunks checking the deadline, reject oversize Content-Length early.
  • ops/verify-encrypted-budget (sqlite): with sqlite3.connect doesn't close the handle (use contextlib.closing); mode=ro on a WAL DB may raise OperationalError if -shm/-wal not accessible, surfaced only as "unexpected OperationalError".
  • ops/verify-encrypted-budget (secret read): only one trailing \n stripped (CRLF/trailing space breaks login/key derivation with misleading error); os.fdopen uses locale encoding — pass encoding='utf-8'.

Low / maintainability

  • :24 ROOT hard-coded to /home/congvc/projects/oss/actual-staging; derive from script location.
  • :120-121 cryptography imported lazily, so a missing dep fails after login as "unexpected ModuleNotFoundError"; check up front.
  • :127 encrypted + tag copy + decrypt buffer + blob + on-disk read → up to ~1 GiB peak at MAX_BYTES 256 MiB.

Instrument output — the reviewer seat must confirm or reject each finding in its verdict.

@congvc-dev

Copy link
Copy Markdown
Collaborator

OCR receipt (delegation lane; keyed lane unavailable) — head 691fb9edb76fb0a84db331da1b21c58cb86466cc: no confirmed P0/P1/P2 findings. Details on CHE-882.

Instrument output — the reviewer seat must confirm or reject each finding in its verdict.

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

Labels

AI generated PR authored with AI assistance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant