Skip to content

prism-cli 1.19.1: the setup gate's 10 s re-check reads only what steps 1 and 2 need - #119

Merged
Enclavet merged 1 commit into
mainfrom
fix/security-gate-light-recheck
Nov 15, 2026
Merged

Enclavet merged 1 commit into
mainfrom
fix/security-gate-light-recheck

Conversation

@Enclavet

Copy link
Copy Markdown
Contributor

prism-cli 1.19.1. Follow-up to #118: the setup gate's 10 s re-check no longer scans every repo.

What changes

While step 1 or 2 is on screen, the card checked again every 10 s with the full GET /api/security-agent. That runs git rev-parse HEAD and git ls-files and reads every repo's result files, for every discovered repo. On a machine with about 43 repos, that is real work every 10 s.

Before After
10 s re-check full GET /api/security-agent (all repos, git, result files) GET /api/security-agent/gate?repo=<id>: the picked repo only, from the AWS and aws connect files, AWS_PROFILE and the setup records. No git, no result files, no repo scan
Hidden tab re-checked waits, fetches nothing
Redraws by other loads (the heatmap's 3 s polls) pushed the re-check back each time keep the pending re-check
Step passes (same request) one full answer, then step 3 as before
  • Which repo ids it accepts: only ids the last full answer listed. An unknown id gets a 404, and the page then loads the full answer.
  • The git check it skips: the light path skips the check that ignores a repo override git tracks. A committed override can therefore count as "set up" for at most one 10 s check. The full answer the page then loads applies the tracked-file rule and decides.

Same action allowlist, listener, token and CSP. The endpoint is read-only, makes no AWS call, and returns masked account ids only.

Tests

  • npm test (aws guard): 875/875.
    • New: the light endpoint spawns no git process (a recorder git placed first on PATH), lists no repos, and makes no AWS call.
    • The page polls the light endpoint, not the full answer. A hidden tab fetches nothing. A redraw keeps the timer. The full answer loads only once the step passes.
  • npm run docs:check: 0 problems.
  • Full e2e: 63/63. GATE6 checks that while the setup card waits, it requests /api/security-agent/gate, and full answers come only with page loads.

Docs: USER_GUIDE (what the re-check reads); CLI-REFERENCE version.

…s 1 and 2 need

- GET /api/security-agent/gate?repo=<id>: one repo from the last full answer,
  from the AWS and aws connect files, AWS_PROFILE and the setup records.
  No git, no result files, no repo scan.
- The page polls it while step 1 or 2 is on screen and the tab is visible,
  redraws only on change, and loads the full answer once the step passes.
- A redraw keeps the pending re-check (the heatmap's 3 s loads used to push it back).
- Unit test: the re-check spawns no git process; e2e GATE6: the wait uses the light endpoint.
@github-actions

Copy link
Copy Markdown

✅ PRISM Eval Gate -- PASS

Score: 0.93 | Findings: 4 (0 high, 0 medium)

Summary: The change is sound. It adds a light gate re-check endpoint with strict id validation against a known-repo allowlist and 404 handling. It has no blocking issues, only low-severity notes on the git-tra

File Line Severity Category Issue
cli/src/dashboard/security-agent.ts 25 low correctness The light gate skips git, so a repo override file that git tracks is honored. The full answer ignores such a file. While the card is polling, the gate can show a setup or region that the full answer t
cli/src/dashboard/security-agent.ts 66 low reliability KNOWN is only filled by securityAgentView. After a server restart or a deps change, the gate endpoint returns 404 until the full answer has loaded once. The page handles this by falling back to the fu
cli/src/dashboard/security-page.ts 111 low maintainability The catch block discards the error without logging it. The fallback to renderSecurity() is intentional, but a short comment saying so would help. Also, saRecheck and renderSecurity can run at the same
cli/src/dashboard/security-page.ts 114 low performance The change check compares JSON.stringify output on every 10 s poll. The gate object is small, so this is fine. If the gate grows, a cheaper comparison would be better.

Powered by kiro-cli headless - Model: auto - Threshold: 0.82


✅ Secret scan -- no credentials found in this PR's commits.

@Enclavet
Enclavet merged commit ef8cb0f into main Nov 15, 2026
6 checks 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.

2 participants