Skip to content

fix: agent bypass, curate test isolation, build separation#192

Merged
kangig94 merged 6 commits intomainfrom
dev
Apr 15, 2026
Merged

fix: agent bypass, curate test isolation, build separation#192
kangig94 merged 6 commits intomainfrom
dev

Conversation

@kangig94
Copy link
Copy Markdown
Owner

Summary

  • fix(execution): CLI-invoked agents (e.g. codex scanner) now default bypassPermissions to true, matching the coralDispatch() path — fixes sandbox errors for read-only agents
  • fix(test): Curate scheduler tests isolated from real ~/.claude/hud/.coral-cache.json by extracting isUsageBudgetExhausted into a mockable module; backend-lifecycle unhandled rejection fixed by attaching rejection handler before timer advancement
  • fix(scheduler): queuedRun cleared before budget check so isRunning() accurately reports idle when budget is exhausted
  • refactor(build): Separate build output from bridge, add CI verification

Test plan

  • npm run build passes clean
  • npm test — 1541 tests pass, 0 failures, 0 errors
  • Regression tests for bypassPermissions default: agent=true, no-agent=false, explicit override respected

🤖 Generated with Claude Code

kangig94 and others added 6 commits April 15, 2026 12:56
Comparative analysis of 4 AI knowledge systems (Coral KB, QMD,
GBrain, MemPalace) — original scans, cross-cutting enhancements,
and integrated quantitative/qualitative evaluation. 213 verified
findings across 9 documents. Informed the KB wiki system design.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Build output now goes to build/ (git-ignored) instead of bridge/ directly.
bridge/ is updated only via `npm run build:release` which builds then copies.
This separates dev iteration artifacts from committed release bundles.

- Integrate verify-simulation-sealing into build-server.mjs (runs on every build)
- Add --release flag to build-server.mjs for build/ → bridge/ copy with permissions
- Remove build:server script (redundant)
- Add .github/workflows/verify-bridge.yml for PR hash verification
- Fix coral-claude-appserver.cjs permission (755 → 644, not directly executed)
- Update docs to reflect new build commands

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLI-invoked agents (e.g. `coral-cli codex scanner`) were hitting Codex
sandbox errors because start() defaulted bypassPermissions to false
regardless of whether an agent was resolved. coralDispatch() already
defaulted to true for agents — this aligns start() to the same behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dled rejection

Three independent test issues:

1. Curate tests: isUsageBudgetExhausted() reads ~/.claude/hud/
   .coral-cache.json via homedir() at runtime. When weekly usage >= 100%
   the scheduler silently skips curate runs, leaving isRunning() stuck.
   Fix: extract isUsageBudgetExhausted into usage-budget.ts so tests
   can vi.mock the module without production code changes. Also move
   queuedRun=false before the budget check so isRunning() accurately
   reports idle when budget is exhausted (production bug).

2. Backend-lifecycle: ensureBackend() rejection fires during
   advanceTimersByTimeAsync before the .rejects.toThrow() handler is
   attached, causing an unhandled rejection. Fix: attach the rejection
   expectation before advancing timers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kangig94 kangig94 merged commit 37940a1 into main Apr 15, 2026
1 check passed
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