Skip to content

fix: 5 bugs (B53-B57), CI SAST/attribution, tmux tests verified#32

Merged
e6qu merged 3 commits intodevfrom
qa/tmux-testing
Mar 22, 2026
Merged

fix: 5 bugs (B53-B57), CI SAST/attribution, tmux tests verified#32
e6qu merged 3 commits intodevfrom
qa/tmux-testing

Conversation

@e6qu
Copy link
Copy Markdown
Owner

@e6qu e6qu commented Mar 22, 2026

QA Deep Dive: Bug Hunt + tmux Testing + CI Hardening

5 Bugs Fixed (B53-B57)

Found via deep code analysis of Frankencode modules (CAS, EditGraph, filterEdited):

Bug Severity Fix
B53: CAS.deleteBySession() race condition High Wrapped SELECT + DELETE in Database.transaction()
B54: CAS.deleteOrphans() deletes shared entries High Added EditGraphNodeTable reference check before deleting
B55: EditGraph.checkout() partial failure High Wrapped undo loop + head update in Database.transaction()
B56: EditGraph.deleteBySession() not atomic Med Wrapped in Database.transaction()
B57: filterEdited() synthetic placeholder ID collision Med Changed firstPart.id to PartID.ascending() for unique ID

5 False Positives Verified (E2-E6)

Issue Verdict
getHead() returns undefined vs null Correct TS idiom — all callers use !head
First commit self-referential branch Intentional DAG initialization — main → first_node
Objective.extract() concurrent race Prompt loop serializes calls — concurrency impossible
SideThread.create() duplicate ID Identifier.ascending() is unique; DB error on collision is correct (fail loudly)
SHA-256 collision in CAS Intentional — onConflictDoNothing() was explicitly chosen in B43 fix

CI Restored

.github/workflows/test.yml updated with:

  • SAST check — no eval(), no Function(), no hardcoded secrets
  • AI attribution check — blocks merge if Co-authored-by trailers from Cursor/Claude/Aider/Copilot found
  • fetch-depth: 0 for full commit history in attribution check

tmux TUI Tests

All 3 provider-independent flows verified:

  • Home screen: logo, prompt, agent name, status bar, tips ✓
  • Command palette: Ctrl+P, session/skills/prompt options ✓
  • Agent cycling: Tab cycles through Build/Plan agents ✓

Edge Case Kept Open (E1)

sweep() clock skew (turnWhenSet > currentTurn) — negative elapsed means part is never swept. Only possible from an upstream bug (turn counter is monotonic). Documented, not fixed.

Test plan

  • bun run typecheck (tsgo) — 0 errors
  • bun test — 1512 pass, 0 fail
  • tmux home/command-palette/agent-cycle — all pass
  • scripts/sast-check.sh — passes

Adrian Mârza added 3 commits March 22, 2026 03:48
The merge of PR #31 lost the CI workflow updates and kept stale hook
patterns. This commit restores:

- CI workflow: SAST check + AI attribution check steps (with fetch-depth: 0)
- commit-msg hook: verified real patterns (Cursor, Claude, Aider, Copilot)
- pre-push hook: same verified patterns + PR body stripping
- pre-commit hook: removed staged file stripping (commit-msg only)
Bug fixes (found via deep code analysis):
- B53: CAS.deleteBySession() race → Database.transaction()
- B54: CAS.deleteOrphans() shared entry deletion → EditGraphNode ref check
- B55: EditGraph.checkout() partial failure → Database.transaction()
- B56: EditGraph.deleteBySession() not atomic → Database.transaction()
- B57: filterEdited() synthetic ID collision → PartID.ascending()

False positives verified and documented (E2-E6):
- getHead() undefined vs null → correct TS idiom
- First commit branch init → intentional DAG initialization
- Objective.extract() concurrency → prompt loop serializes
- SideThread duplicate ID → fail loudly is correct
- SHA-256 collision → intentional (B43 fix)

CI workflow restored with SAST + AI attribution checks.
tmux TUI tests: all 3 flows pass (home, command-palette, agent-cycle).
@e6qu e6qu merged commit ff1b3ea into dev Mar 22, 2026
1 check passed
@e6qu e6qu deleted the qa/tmux-testing branch March 22, 2026 02:14
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