@bugb-technologies/bravos 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +53 -219
  2. package/dist/account.js +2 -11
  3. package/dist/cli.js +77 -29
  4. package/dist/codegraph.js +25 -0
  5. package/dist/dashboard.js +242 -0
  6. package/dist/guardlink.js +4 -3
  7. package/dist/guide.js +2 -1
  8. package/dist/help.js +8 -0
  9. package/dist/hooks.js +27 -5
  10. package/dist/install-proof-tool.js +5 -7
  11. package/dist/install.js +2 -2
  12. package/dist/licence.js +11 -4
  13. package/dist/omp.js +2 -1
  14. package/dist/open.js +22 -0
  15. package/dist/opencode.js +2 -1
  16. package/dist/setup.js +11 -2
  17. package/dist/skills.js +8 -0
  18. package/dist/start/index.js +10 -2
  19. package/dist/watch.js +8 -24
  20. package/docs/GUIDE.md +7 -1
  21. package/docs/UPGRADING.md +50 -0
  22. package/hooks/lib/briefing.mjs +82 -27
  23. package/hooks/lib/licence.mjs +13 -0
  24. package/hooks/lib/nightly-tools.sh +8 -2
  25. package/hooks/lib/replay.mjs +18 -7
  26. package/hooks/lib/setup.mjs +1 -1
  27. package/package.json +3 -2
  28. package/skills/bravos/SKILL.md +3 -2
  29. package/skills/bravos-annotate/SKILL.md +1 -1
  30. package/skills/bravos-annotate/scripts/lib/pick.mjs +1 -1
  31. package/skills/bravos-annotate/scripts/slice.mjs +1 -1
  32. package/skills/bravos-context/SKILL.md +5 -4
  33. package/skills/bravos-env/SKILL.md +2 -2
  34. package/skills/bravos-env/scope.example.yaml +2 -2
  35. package/skills/bravos-prove/SKILL.md +5 -5
  36. package/skills/bravos-templatize/SKILL.md +3 -3
  37. package/skills/bravos-templatize/operator-guidance.md +4 -4
  38. package/templates/dashboard/codegraph-pages.css +279 -0
  39. package/templates/dashboard/codegraph-pages.js +6230 -0
  40. package/templates/dashboard/codegraph-pages.json +11 -0
  41. package/templates/dashboard/dashboard.html +252 -0
@@ -26,7 +26,7 @@ description: "Keep the GuardLink threat model correct and growing, in this sessi
26
26
  8. Gate: run `guardlink lint . --since <start> --json`. For each entry in `violations[]`, apply its `fix`. Repeat until `summary.errors` is 0. A violation on a line you did not write this session is not yours: leave the line as it is and report it to the user.
27
27
  9. Run `guardlink validate .` and fix what it reports in the lines you wrote.
28
28
  10. Run `guardlink ci -f json` again and report `+<files>, <p0>% → <p1>%, <errors> lint errors`. Deep only: repeat steps 4–10 once per round, and stop when `coverage` comes back empty or a round adds no claims.
29
- 11. On a normal coding turn keep annotations with the code change and preserve the user's staged and uncommitted edits. For a requested standalone coverage slice, commit the slice on its own: `git add` only the annotated files, message `annotate: <n> files, <playbook>`. Ship it as a small PR or on the feature branch, whichever the team does.
29
+ 11. On a normal coding turn keep annotations with the code change and preserve the user's staged and uncommitted edits. For a requested standalone coverage slice, with the person's go-ahead (ask once per session unless they already asked for commits), commit the slice on its own: `git add` only the annotated files, message `annotate: <n> files, <playbook>`. Ship it as a small PR or on the feature branch, whichever the team does.
30
30
  12. Read `guardlink hypothesis list --json`. Keep each changed exposure's stable key, source location, sidecar location when applicable, and tested state. Include untested claims with a declared mitigation. Hand new claims to bravos-templatize for a concrete kit; expired or previously tested claims go to bravos-recheck. Apply the recorded proving choice before execution: auto follows bravos-env and bravos-prove in its authorized scope; ask seeks a decision; schedule leaves the claim queued; none records that it was not tested. Evidence from a real run is required before marking a claim confirmed or refuted. Hand the change to bravos-ship before a PR.
31
31
 
32
32
  ## Never
@@ -1,4 +1,4 @@
1
- // @comment -- "Pure slice picker for bravos-annotate: ranks the worklist (entry points first, tests/generated/CI last), decides which files this session or its subagents annotate, skips files teammates have in open PRs, and splits the pick into disjoint directory-coherent batches; dependency-free, copied verbatim into target repos."
1
+ // @comment -- "Pure slice picker for bravos-annotate: ranks the worklist (entry points first, tests/generated/CI last), decides which files this session or its subagents annotate, skips files teammates have in open PRs, and splits the pick into disjoint directory-coherent batches; dependency-free, copied into target repos with this annotation turned into a plain comment."
2
2
 
3
3
  const arr = (v) => (Array.isArray(v) ? v : []);
4
4
  const dirOf = (p) => (p.includes('/') ? p.slice(0, p.lastIndexOf('/')) : '');
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // @comment -- "Entry for bravos-annotate: gathers git diff, guardlink worklist/coverage and open PRs via read-only spawnSync calls, runs pickSlice and prints bravos.slice/v2 JSON (coverage, coverage_detail, batches, tiers); dependency-free, copied verbatim into target repos."
2
+ // @comment -- "Entry for bravos-annotate: gathers git diff, guardlink worklist/coverage and open PRs via read-only spawnSync calls, runs pickSlice and prints bravos.slice/v2 JSON (coverage, coverage_detail, batches, tiers); dependency-free, copied into target repos with its annotations turned into plain comments."
3
3
  import { spawnSync } from 'node:child_process';
4
4
  import { closeSync, openSync, readSync } from 'node:fs';
5
5
  import { join } from 'node:path';
@@ -13,14 +13,14 @@ description: "Learn what the software intends before judging its code: for a pro
13
13
  ## Do
14
14
 
15
15
  1. Decide the perspective. **Researcher** (the default): the repo is software being studied, such as an open-source project or a vendor's code; its intent is upstream's to state. **Owner**: the repo is the user's own product; it is theirs. Use what the user said, the origin remote and the README; ask in one line only if it is unclear.
16
- 2. Read before you suggest. Researcher: upstream's security docs, deployment and hardening guides, SECURITY.md and docs/, each with its URL or path, then the auth and role code. Owner: the README, route table, auth and role code, data models, anything touching money or other users' data. Both: `.guardlink/definitions.*`, and `.guardlink/intent.md` if it exists (you are refreshing, not starting over). Build the code graph first when there is none or it is diverged: `bravos graph build . --scip no-exec` (no tokens, a few minutes; bravos-codegraph step 2). With the code graph (its MCP tools, or `bravos graph <question> --json` — same answers; see bravos-codegraph) (briefing `Code graph:` says `current`): `codegraph_routes`, `codegraph_attack_surface` and `codegraph_auth_boundary` give the real public surface — which routes answer unauthenticated callers, which need a tenant, which are admin-only; cite "code graph" as the source of each fact, suggestion and candidate INT item they produce ("these N APIs answer unauthenticated callers; upstream documents M of them"). Without it, say "code graph unavailable; surface read from the route table" and read the routes and auth code.
16
+ 2. Read before you suggest. Researcher: upstream's security docs, deployment and hardening guides, SECURITY.md and docs/, each with its URL or path, then the auth and role code. Owner: the README, route table, auth and role code, data models, anything touching money or other users' data. Both: `.guardlink/definitions.*`, and `.guardlink/intent.md` if it exists (you are refreshing, not starting over). On the Team plan (the briefing's `Plan:` line), build the code graph first when there is none or it is diverged: `bravos graph build . --scip no-exec` (no tokens, a few minutes; bravos-codegraph step 2). On the Free plan there is no code graph: read the route table and the auth code instead, and don't offer to build it. With the code graph (its MCP tools, or `bravos graph <question> --json` — same answers; see bravos-codegraph) (briefing `Code graph:` says `current`): `codegraph_routes`, `codegraph_attack_surface` and `codegraph_auth_boundary` give the real public surface — which routes answer unauthenticated callers, which need a tenant, which are admin-only; cite "code graph" as the source of each fact, suggestion and candidate INT item they produce ("these N APIs answer unauthenticated callers; upstream documents M of them"). Without it, say "code graph unavailable; surface read from the route table" and read the routes and auth code.
17
17
  3. Suggest every answer yourself. Researcher, the open decisions (5 to 8, each `mustTouch: true`): which configuration to rate against (shipped defaults, upstream's recommended hardened setup, or both); single organisation or multi-tenant; which attackers are in scope (`multi`: unauthenticated network, authenticated low-privilege tenant, malicious client or worker, compromised peer or replica, internal network, operator, suggesting the last two out unless upstream says otherwise); each intended-looking behaviour upstream does not clearly document ("upstream is silent"); which invariants to test first. Everything else is a fact with `folded: true` and its source: actors, crown jewels, boundaries, behaviours upstream documents as intended (cite where), and invariants worded as the properties upstream claims. Owner: purpose, users and roles, crown jewels, two to five must-never rules, intended-by-design powers and boundaries; open by default, the rule and intended items `mustTouch`. Give every question a `suggested` answer, a one-line `reason`, its `sources` and a `confidence`; mark `low` and `mustTouch` anything you are unsure of.
18
18
  4. Write it to `.guardlink/intent-draft.json` (schema `bravos.review/v1`, `perspective` set; question types `choice`, `multi`, `item`, `text`) and run `bravos review intent`. Tell the user: "the page that just opened has my suggestions filled in; change what is wrong, make the calls marked 'needs your call', then Confirm. Teammates run `bravos review intent` after pulling; say done when everyone has." If they prefer chat, or no browser can open, ask the same open decisions in one message. If they ask to share it on claude.ai and this is Claude Code, run `bravos review intent --share`, say first that their security intent will sit on claude.ai, publish the page it writes with the Artifact tool and `capabilities: {db: {}}`, and give them the link.
19
19
  5. Wait for "done". Run `bravos review intent --summary` (for a shared page, first copy each document in its `answers` collection to `.guardlink/intent-answers/<name>.json` with ArtifactData). Settle each DISAGREE with the people involved; take EDITED answers as given. If the user is away on an unattended campaign, record your suggestions marked `— draft` and carry on; never record a decision nobody made.
20
- 6. Write `.guardlink/intent.md` from `{{SKILL_DIR}}/intent.example.md`. Researcher: an `## Assumptions` section first, with the configuration baseline, deployment and attackers in scope, each ending `— set by <names>, <date>`. Then purpose, actors, crown jewels, invariants `INV-1`…, intended-by-design `INT-1`… (researcher items carry `(upstream: <url or path>)`, or `(upstream is silent)`), and boundaries. End each item with how it was decided: `— suggested by bravos, accepted by <names>`, `— edited by <names>`, `— chosen by <names>`, or `— draft`. Commit the draft and answers files with it.
21
- 7. Put the structured facts in the threat model. In `.guardlink/definitions.*`, reusing ids and never redefining one: `@actor` per role, `@asset` per crown jewel, and one `@threat` per invariant, e.g. `@threat Cross-tenant read (#inv-tenant-isolation) [high] -- "INV-2: a user reads only their own tenant's orders"`. Beside the code they describe: `@handles <class> on <Asset>` for each crown jewel's data and `@boundary` for each boundary.
20
+ 6. Write `.guardlink/intent.md` from `{{SKILL_DIR}}/intent.example.md`. Researcher: an `## Assumptions` section first, with the configuration baseline, deployment and attackers in scope, each ending `— set by <names>, <date>`. Then purpose, actors, crown jewels, invariants `INV-1`…, intended-by-design `INT-1`… (researcher items carry `(upstream: <url or path>)`, or `(upstream is silent)`), and boundaries. End each item with how it was decided: `— suggested by bravos, accepted by <names>`, `— edited by <names>`, `— chosen by <names>`, or `— draft`.
21
+ 7. Put the structured facts in the threat model. In `.guardlink/definitions.*`, reusing ids and never redefining one: `@actor` per role, `@asset` per crown jewel, and one `@threat` per invariant, e.g. `@threat Cross-tenant read (#inv-tenant-isolation) [high] -- "INV-2: a user reads only their own tenant's orders"`. Then `@handles <class> on <Asset>` for each crown jewel's data and `@boundary` for each boundary, placed where this repository keeps annotations (the briefing's `Annotations:` line, or `annotation_mode` in `.guardlink/config.json`): in external mode in the file's `.guardlink/annotations/<source-path>.gal` sidecar, never in the source file; in inline mode in a comment directly above the code (bravos-annotate step 7).
22
22
  8. Run `guardlink validate .` and fix what it reports in the lines you wrote.
23
- 9. Commit `.guardlink/intent.md` and the definitions together, message `context: intent and invariants`.
23
+ 9. Ask before you commit: "Commit the intent and the definitions now, or leave them for you to review?" Skip the question only when the person already asked for commits in this session (a campaign, a schedule). On yes, commit `.guardlink/intent.md`, the draft and answers files and the definitions together, message `context: intent and invariants`. Otherwise name the files and leave them uncommitted.
24
24
  10. Hand the invariant threat ids, the Assumptions and the intended-by-design list to bravos-annotate.
25
25
 
26
26
  ## Never
@@ -33,6 +33,7 @@ description: "Learn what the software intends before judging its code: for a pro
33
33
  - Rewrite a confirmed line in `.guardlink/intent.md`; append a dated change beneath it instead.
34
34
  - Treat an intended-by-design item as an accepted risk: write `@accepts`, `@entitles` or `@confirmed`, or remove an existing claim because of it.
35
35
  - Redefine an id that already exists in `.guardlink/definitions.*`.
36
+ - Commit, push or stash without the person's go-ahead, or write an annotation into a source file when the repository keeps them in sidecars.
36
37
 
37
38
  ## Done when
38
39
 
@@ -14,9 +14,9 @@ description: "Bring up a test target the user owns and prepare it for an authori
14
14
 
15
15
  1. Read the current proving choice before target contact, login or auth verification. Use the owned local app named in the standing authorization or the target explicitly authorized for this invocation. The default is a loopback address (`127.0.0.1`, `localhost`, `[::1]`). Start it with the repo's own tooling (its compose file, dev server script or desktop build) and wait until it answers. In a bravos workspace each service has its own target: take the URLs from `bravos workspace show` (set a missing one with `bravos workspace target <name> <service>=http://127.0.0.1:<port>`), bring up every service the test crosses, and list every service host in the reviewed scope's `host_allowlist`.
16
16
  2. On loopback, a recorded proving preference (`.guardlink/proving.md`, `choice: auto`) is the person's go-ahead for its target: use the recorded target and start command. If the setup wizard left them empty, inspect the repository’s documented development command and listening address. When these match the app the person authorized, record the actual target and start command alongside their original words. Commit the policy and scope before automatic replay. Ask only if the target or authority is ambiguous. If the user names a non-loopback target, stop and get two things before going on: the host listed in a committed `scope.yaml` that has been through a reviewed PR, and the human's authorization typed by them in this session in their own words. Without both, the target is out of scope; say so and stay on loopback.
17
- 3. Write the scope. Copy `{{SKILL_DIR}}/scope.example.yaml` to `.guardlink/scope.yaml`, or run `cxg pentest scope-init -o .guardlink/scope.yaml` for the full field reference, then narrow `url_allowlist` to the routes under test. `method_allowlist` is a strict bound: cxg refuses every method it does not list, even with `--destructive-ok`, so a test that needs PUT, PATCH or DELETE needs the target's owner to add them in the reviewed PR; never add them yourself. scope-init pre-fills `authorization_attestation` with an example sentence: blank it. Leave that field for the human to fill. Commit it and ship it as a PR for review before any non-loopback run.
17
+ 3. Write the scope. Copy `{{SKILL_DIR}}/scope.example.yaml` to `.guardlink/scope.yaml`, then narrow `url_allowlist` to the routes under test. `method_allowlist` is a strict bound: cxg refuses every method it does not list, even with `--destructive-ok`, so a test that needs PUT, PATCH or DELETE needs the target's owner to add them in the reviewed PR; never add them yourself. Leave that field for the human to fill. Commit it and ship it as a PR for review before any non-loopback run.
18
18
  4. Seed test data with the repo's own fixtures, seed scripts or admin endpoints: the roles and users the threats need, such as two users of different tenants for an ownership check. Name any test that needs production-like data as such, and run it only where that data is synthetic.
19
- 5. Get a session. On loopback, do it yourself: create the test accounts through the app's own signup, seed script or admin endpoint, write their email and password to a gitignored file under `.bravos/`, and log in with `cxg pentest auth --target <url> --profile <name> --creds-file <file> --login-path <login route>`, one profile per identity a check needs. If the app's login is not a JSON POST, drive the signup and login in your own browser tool and capture the session interactively with `cxg pentest auth --target <url> --profile <name>`. For an authorized non-loopback target, ask the human to capture the session in their own browser with the same command, or to paste a storage state you import with `cxg pentest auth import --storage-state <file> --profile <name> --target <url>`; CI uses the import with a session the human exported once.
19
+ 5. Get a session. On loopback, do it yourself: create the test accounts through the app's own signup, seed script or admin endpoint, write their login identity and secret to a gitignored file under `.bravos/`, and log in with `cxg pentest auth --target <url> --profile <name> --creds-file <file> --login-path <login route>`, one profile per identity a check needs. For a bearer-token API, check `cxg pentest auth --help` for dynamic-login support. Add `--login-user-field username` and `--login-pass-field password` when names differ (dotted paths support nested JSON), `--login-encoding form` for URL-encoded login, or `--login-body` for extra JSON fields; credential paths override those fields. Omit `--login-token-source` to discover the token by shape from the login response and save an `Authorization: Bearer` header profile; steer discovery only when needed with `--login-token-source json:/access_token` or `--login-token-source header:Authorization`. Capture each identity separately; probes use these profiles instead of minting their own tokens. For SSO, MFA or other browser-only login, drive signup and login in your own browser tool and capture the session interactively with `cxg pentest auth --target <url> --profile <name>`. For an authorized non-loopback target, ask the human to capture the session in their own browser with the same command, or to paste a storage state you import with `cxg pentest auth import --storage-state <file> --profile <name> --target <url>`; CI uses the import with a session the human exported once.
20
20
  6. Verify the target URL and scope against the current recorded policy before sending any request. For a fresh local build or launch from this repository, capture the matching worktree witness at that time with `bravos hook replay build <loopback-url>`. Pass that output to bravos-prove in BRAVOS_REPLAY_BUILD, recording the actual target and revision. A hash computed beside a previously running app does not establish which code it serves. If a remote or already-running service cannot be tied to this build, report observations without updating the current claim. Confirm each required session is live with `cxg pentest auth verify --profile <name>` before handing the target on, so a run never spends its budget unauthenticated.
21
21
  7. Record the target URL, the profile names, the scope path and whether the target is loopback, and hand them to bravos-prove.
22
22
 
@@ -1,7 +1,7 @@
1
- # bravos starter scope for cxg pentest — loopback only.
1
+ # bravos starter scope for cxg scan — loopback only.
2
2
  #
3
3
  # Copy to .guardlink/scope.yaml, commit it, and get it reviewed in a PR before any run.
4
- # Full field reference: `cxg pentest scope-init -o /tmp/reference-scope.yaml`.
4
+ # cxg reads it through `cxg scan --scope-file`; each field below is explained where it is set.
5
5
  #
6
6
  # This starter allows only the read-mostly methods, a small budget, and no disposable-host
7
7
  # grants, so destructive probe classes stay limited to a loopback target. Widening any of
@@ -13,17 +13,17 @@ description: "Prove a new or changed GuardLink claim, or replay it after a fix,
13
13
  ## Do
14
14
 
15
15
  1. Check the preconditions from bravos-env before any traffic: authorization for this run, a target that answers, `.guardlink/scope.yaml` committed, each profile passing `cxg pentest auth verify --profile <name>`, and for any non-loopback target both a reviewed scope and the human's authorization typed in this session. If one is missing, stop and hand back to bravos-env. Read the effort: the user's words ("at high"), else a `bravos effort: <level>` line in `AGENTS.md` / `CLAUDE.md`, else medium. It sets a starting budget, not a limit; go beyond it when the work needs it and say why in one line. Starting budget — low: replay a matching kit; medium: also author the first missing test in this session; high: include affected callers and controls; max: cover the testable in-scope queue. A higher effort does not authorize spending on an external model.
16
- 2. Order what to test, then read how the person wants proving handled. With the code graph (its MCP tools, or `bravos graph <question> --json` — same answers; see bravos-codegraph) (briefing `Code graph:` says `current`): `codegraph_untested_exposures` and `codegraph_untested_reach` rank untested exposures by reach; test the ones intent.md's Assumptions put in scope first, least privileged entry point first, and report exposures only an out-of-scope attacker reaches instead of running them. Without the graph, say "code graph unavailable; using guardlink hypothesis next order" and use that queue. Within that order, an exposure with a reachable SAST finding joined to it (`bravos sast candidates`) goes before one without, and its route goes into the run notes; with no SAST report or SAST unavailable, skip this. Then, for how the person wants proving handled: the briefing's `Proving:` line, from `.guardlink/proving.md`. If it is not set, ask them once, with a suggestion drawn from the repo (for example, "you have a docker-compose; I'd prove automatically on 127.0.0.1:8080"): prove automatically on their loopback target whenever new or changed exposures appear, ask each time, on a schedule (bravos-schedule's nightly), or not now; and whether cxg may generate probes through a model API, which spends money. Record their answer in `.guardlink/proving.md`: lines `choice: auto|ask|schedule|none`, `target: <loopback url>`, `start: <start command>`, `generation: yes|no`, their words quoted verbatim, and `— confirmed by <their name>, <date>`. Then follow it: `auto` proceeds on that target with their quoted words as the attestation and, with `generation: yes`, the spend approved; `ask` asks now; `schedule` hands to bravos-schedule; `none` stops here and says so. When they change their mind, rewrite the file with their new words.
16
+ 2. Order what to test, then read how the person wants proving handled. With the code graph (its MCP tools, or `bravos graph <question> --json` — same answers; see bravos-codegraph) (briefing `Code graph:` says `current`): `codegraph_untested_exposures` and `codegraph_untested_reach` rank untested exposures by reach; test the ones intent.md's Assumptions put in scope first, least privileged entry point first, and report exposures only an out-of-scope attacker reaches instead of running them. Without the graph, say "code graph unavailable; using guardlink hypothesis next order" and use that queue. Within that order, an exposure with a reachable SAST finding joined to it (`bravos sast candidates`) goes before one without, and its route goes into the run notes; with no SAST report or SAST unavailable, skip this. Then, for how the person wants proving handled: the briefing's `Proving:` line, from `.guardlink/proving.md`. If it is not set, ask them once, with a suggestion drawn from the repo (for example, "you have a docker-compose; I'd prove automatically on 127.0.0.1:8080"): prove automatically on their loopback target whenever new or changed exposures appear, ask each time, on a schedule (bravos-schedule's nightly), or not now; and whether cxg may generate probes through a model API, which spends money. Record their answer in `.guardlink/proving.md`: lines `choice: auto|ask|schedule|none`, `target: <loopback url>`, `start: <start command>`, `generation: yes|no`, their words quoted verbatim, and `— confirmed by <their name>, <date>`. Before offering or following `auto`, check that `git symbolic-ref --quiet refs/remotes/origin/HEAD` names an existing commit. If missing, warn: fetch the default branch, then `git remote set-head origin --auto` (or `git remote set-head origin <branch>`); use `ask` meanwhile. Then follow it: `auto` proceeds on that target with their quoted words as the attestation and, with `generation: yes`, the spend approved; `ask` asks now; `schedule` hands to bravos-schedule; `none` stops here and says so. When they change their mind, rewrite the file with their new words.
17
17
  3. Read the affected claim from `guardlink hypothesis list --json`. Include a declared mitigation awaiting its first test and a previously confirmed claim now marked retest. Match its key to the logical source location in `guardlink sarif . --profile pentest -o whitebox/findings.sarif`; external annotations also have a physical declaration in a .gal file. Keep both locations. Record the tested source revision or worktree, application build, identity roles and intended oracle.
18
- 4. For a web claim, use its bound JavaScript kit in .guardlink/cxg-replay/. For a missing or mismatched kit, follow bravos-templatize in this session. A matching kit exercises the intended operation and includes a positive control for a claimed defense. Validate the kit and review its scope. Honor the recorded kit policy and the person’s stated limits. An automatic reviewed-only policy requires identical bound test bytes on the default branch (the consent commit when Git has no local origin/HEAD). The earlier wizard’s “only replay tests I approved” choice retains that restriction.
18
+ 4. For a web claim, use its bound JavaScript kit in .guardlink/cxg-replay/. For a missing or mismatched kit, follow bravos-templatize in this session. A matching kit exercises the intended operation and includes a positive control for a claimed defense. Validate the kit and review its scope. Honor the recorded kit policy and the person’s stated limits. An automatic reviewed-only policy requires identical bound test bytes on the default branch. On a clone whose upstream has no testing policy, use `ask` with locally committed policy and scope and typed authorization for loopback `run-once`. The earlier wizard’s “only replay tests I approved” choice retains that restriction.
19
19
  5. Pass the build witness that bravos-env captured at launch in BRAVOS_REPLAY_BUILD. Without fresh build provenance, retain the observation and leave the current-code claim pending. Under a recorded automatic loopback policy, run `bravos hook replay run <kit.js>`. For a one-time approved run under an ask policy, use `bravos hook replay run-once <kit.js>` with the target in BRAVOS_SCAN_TARGET and the person's exact words in BRAVOS_REPLAY_ATTESTATION for that invocation. Keep private identity state outside Git. A scheduled-only policy hands the kit to bravos-schedule. A disabled policy leaves the claim pending. The helper selects one file through plain CXG scan with model authoring disabled. Only evidence tied to the exact claim, tested source and kit is eligible for writeback.
20
20
  6. Read the individual native CXG execution and ledger result. A reproduced exploit needs an engine-adjudicated confirmation. A held control needs observed denial and a working positive control. Missing roles, ambiguous tests, incomplete imports, a different target build or stale inputs stay pending with the reason. Exit 4 can include both a refusal and valid results from other probes. An ordinary scanner's template-reported match is a lead for a runtime test. Keep private HTTP and auth material out of reports and commits.
21
- 7. For workspaces, bind each hop to its own service URL and authorized scope. For Electron, use its configured launch and verified desktop profile. Ordinary network or local CLI scanner templates use the scanner contract and produce leads. Use explicit CXG orchestration only when the requested target or technique needs it, for example Tauri's in-process proof or operator-requested CXG model generation. Check the CXG pentest run help for the selected platform, method and authorization before execution. For generation require the recorded permission for the API spend, available provider credentials and a specific threat selector for fresh web probes. Use the reviewed scope, approved target and identities. Keep the resulting native evidence separate. For an independently stamped result, the GuardLink import is `guardlink hypothesis confirm --from-scan <native-report.json> --write`; check every intended claim key and tested anchor, import only an uncontested exact match, and reread the ledger. A missing key, changed build or failed write is unrecorded. Boundary outcomes use GuardLink's boundary ledger.
22
- 8. Report which claims were confirmed or refuted, which still need testing and which were actually recorded. Keep the run ID and the kit for bravos-recheck.
21
+ 7. For workspaces, bind each hop to its own service URL and authorized scope. Every run is plain `cxg scan`, through the replay helper or directly with the same scope, attestation and identities: for Electron add `--target-type electron` with `--app-cmd` or `--app-binary` and the verified desktop profile; for Tauri's in-process proof add `--tauri-prove`. Ordinary network or local CLI scanner templates use the scanner contract and produce leads. Probes are written in this session by bravos-templatize, never generated by cxg. Use the reviewed scope, approved target and identities, and keep the native evidence separate. For an independently stamped result, the GuardLink import is `guardlink hypothesis confirm --from-scan <native-report.json> --write`; check every intended claim key and tested anchor, import only an uncontested exact match, and reread the ledger. A missing key, changed build or failed write is unrecorded. Boundary outcomes use GuardLink's boundary ledger.
22
+ 8. Report which claims were confirmed or refuted, which still need testing and which were actually recorded. After a recorded engine confirmation, offer to promote the verified kit into `security/` (or `.guardlink/config.json`'s `security_tests_dir`) as a curated regression test. With the person's agreement, review its scope, stable oracle and runner, then retain only portable test code; keep credentials and raw run evidence outside Git. Confirmation alone never promotes a kit. Keep the run ID and replay kit for bravos-recheck.
23
23
 
24
24
  ## Never
25
25
 
26
- - Pass `--ai-provider claude`, `codex`, `gemini`, `crush` or `auto` to `cxg pentest run`; those launch another agent CLI. Only the API providers `anthropic` and `openai` generate probes, and only with the spend approved.
26
+ - Run `cxg pentest run`, `cxg scan --pentest` or any of cxg's model generation (its ai command, or an AI provider flag): Bravos tests only with `cxg scan`, and the probes it runs are the ones written and reviewed in this session.
27
27
  - Run against a host outside the committed scope, or without the human's typed authorization when the target is not loopback.
28
28
  - Write `--attestation` text the human did not type, here or in `.guardlink/proving.md`.
29
29
  - Record a proving preference the person did not state, or read one as covering more than it says: it never covers a non-loopback target or a destructive class.
@@ -17,10 +17,10 @@ description: "Turn the threat model's open exposures into correct, testable cxg
17
17
  3. Find the request that reaches each sink before you write its template. With the code graph (its MCP tools, or `bravos graph <question> --json` — same answers; see bravos-codegraph) (the briefing's `Code graph:` line says `current`, or `diverged` until a `no-exec` rebuild, bravos-codegraph step 2): `codegraph_call_chain` from the entry points (`codegraph_entry_points`, `codegraph_routes`) to the claim's symbol gives the route or RPC method, its handler and the parameters that flow into the sink; `codegraph_auth_boundary` on that route gives the identity the request needs (anonymous, a signed-in tenant, admin). Target that route with those parameters and the matching auth profile, put the chain (entry → … → sink) in the template's notes, and when several entry points reach the sink template the least privileged first. When `codegraph_entry_reach` says no entry point reaches it at high confidence, write no template: record "unreachable from any entry point per code graph" in the README and hand the claim to bravos-annotate to re-rate. Read `verdict` and `confidence` first; `unknown` or `insufficient_resolution` is not determined, never unreachable. Without the graph, trace the route from the handler by reading the code and say "code graph unavailable; traced by reading". A SAST finding joined to the claim (`bravos sast candidates`) gives its `route`, `entryPoint` and taint path too; use it alongside the graph's chain, and note it in the template. SAST findings not in the threat model go to bravos-annotate first, since templates come from claims. With no SAST report or SAST unavailable, carry on without it.
18
18
  4. Write the templates under `.guardlink/cxg-templates/`, one per threat, following the engine contract and evidence shape the method gives. Keep every check non-destructive and scoped to confirming its one threat. Scanner templates (YAML, Python, shell) go there; JavaScript probes (`async function cxgProbe(cxg)`, `--contract probe`) go under `.guardlink/cxg-replay/` instead, because `cxg scan --template-dir` runs any probe it finds under cxg's default scope, not `.guardlink/scope.yaml`. In a probe, reach the target only through `cxg.fetch*` with well-formed arguments: cxg refuses at run time a probe that uses WebSocket, XMLHttpRequest, EventSource, `navigator.sendBeacon`, dynamic `import()`, or script or `innerHTML` injection, and `cxg template validate` does not catch it.
19
19
  5. Validate: `cxg template validate .guardlink/cxg-templates/ --recursive --json`, and the same for `.guardlink/cxg-replay/`. It exits 1 when any template fails; a banner line can precede the JSON, so read from the first `{` or `[`. Fix each error and rerun until it reports none.
20
- 6. Record repo context for cxg's own generator. Copy `{{SKILL_DIR}}/operator-guidance.md` to `.guardlink/operator-guidance.md` if it is not there, and fill each section from the code: framework, auth shape, test identities, known false positives, out-of-bounds routes. bravos-prove passes it as `--skills-file` when cxg generates probes for exposures that have no kit.
20
+ 6. Record repo context for the probes you write. Copy `{{SKILL_DIR}}/operator-guidance.md` to `.guardlink/operator-guidance.md` if it is not there, and fill each section from the code: framework, auth shape, test identities, known false positives, out-of-bounds routes. Read it before writing each kit; cxg never generates probes for this repository.
21
21
  7. For a first test or regression kit, write a single JavaScript probe in .guardlink/cxg-replay/. Include an exact `// @guardlink_threat: threat@logical/file:line`, `// @attach_scheme: path`, the required identity names, and a precise test with a positive control. Run `bravos hook replay bind <kit.js>` before executing it. The binding command associates the kit with the key of the current GuardLink exposure. Review that mapping when the claim is edited or moved. Leave native CXG identity stamps to the engine.
22
22
  8. Apply the oracle rule: a vulnerability class cxg cannot judge from a response has no oracle. Record it in `.guardlink/cxg-templates/README.md` as unsupported, with the threat id and why, instead of writing a template that pretends to prove it. An invariant threat (`#inv-…`, from intent.md) maps to the cxg class that can judge it: another user's or tenant's data → `idor`; a role or permission gained → `privilege_escalation`; a field the caller should not set → `mass_assignment`; a check bypassed by concurrent requests → `race_condition`; a workflow step skipped or reordered → `business_logic`. Record each invariant's class in the README.
23
- 9. Commit the templates, the README and the filled guidance together, and hand the template ids and threat ids to bravos-prove.
23
+ 9. With the person's go-ahead (ask once per session unless they already asked for commits), commit the templates, the README and the filled guidance together, and hand the template ids and threat ids to bravos-prove.
24
24
 
25
25
  ## Never
26
26
 
@@ -45,4 +45,4 @@ description: "Turn the threat model's open exposures into correct, testable cxg
45
45
  ## Go deeper
46
46
 
47
47
  - `{{SKILLS_ROOT}}/guardlink-translate/SKILL.md` — the translate method and the engine contract.
48
- - `{{SKILL_DIR}}/operator-guidance.md` — what cxg's generator needs to know about this repo.
48
+ - `{{SKILL_DIR}}/operator-guidance.md` — what a probe for this repo needs to know: routing, auth shape, identities, false positives, bounds.
@@ -1,8 +1,8 @@
1
- # Operator guidance for cxg (this repository)
1
+ # Operator guidance for probes (this repository)
2
2
 
3
- Copy to `.guardlink/operator-guidance.md`, fill in each section from what the code actually does,
4
- and pass it to `cxg pentest run --skills-file .guardlink/operator-guidance.md`. cxg appends it to
5
- its template-generation prompt (12k characters at most), so keep it factual and short.
3
+ Copy to `.guardlink/operator-guidance.md` and fill in each section from what the code actually does.
4
+ The agent reads it before writing each JavaScript probe that `cxg scan` runs, so keep it factual and
5
+ short. cxg never generates probes for this repository.
6
6
 
7
7
  ## Framework and routing
8
8
  <!-- e.g. Express 4 with routers mounted in src/server.ts; Next.js app router under app/api -->
@@ -0,0 +1,279 @@
1
+ /* bravos (vendored by scripts/vendor-codegraph-pages.mjs; do not edit here): siete@4eab40738b98 clients/vscode/media/pages.css */
2
+ /*
3
+ * The code-graph pages (Map, Owners & History, Coupling, Trust).
4
+ *
5
+ * Layout and chrome only. Every colour is a VS Code theme token or a Workbench token that
6
+ * `src/webview/pages/palette.ts` writes onto :root from the VS Code theme — `--bg-panel`,
7
+ * `--sev-medium` and the rest — so the pages follow the reader's theme, light, dark or high
8
+ * contrast, and no colour is chosen here.
9
+ */
10
+ :root {
11
+ color-scheme: light dark;
12
+ }
13
+ body {
14
+ margin: 0;
15
+ padding: 0;
16
+ background: var(--vscode-editor-background);
17
+ color: var(--vscode-foreground);
18
+ font-family: var(--vscode-font-family);
19
+ font-size: var(--vscode-font-size, 13px);
20
+ }
21
+ button {
22
+ font: inherit;
23
+ color: inherit;
24
+ background: none;
25
+ border: 0;
26
+ padding: 0;
27
+ cursor: pointer;
28
+ }
29
+ button:focus-visible,
30
+ .map-host canvas:focus-visible {
31
+ outline: 1px solid var(--vscode-focusBorder);
32
+ outline-offset: 1px;
33
+ }
34
+ code,
35
+ .mono {
36
+ font-family: var(--vscode-editor-font-family);
37
+ font-size: 0.92em;
38
+ }
39
+ .quiet { color: var(--vscode-descriptionForeground); }
40
+ .ghost { color: var(--vscode-disabledForeground); }
41
+ .small { font-size: 0.85em; }
42
+ .big { font-size: 1.15em; }
43
+ .num { font-variant-numeric: tabular-nums; }
44
+ .warn-ink { color: var(--sev-medium); }
45
+ .sev { color: var(--sev-high); }
46
+ .link { text-decoration: underline; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
47
+ .stack { display: flex; flex-direction: column; gap: 8px; }
48
+ .stack.tight { gap: 3px; }
49
+ .indent { margin: 2px 0 0 12px; padding: 0; list-style: none; }
50
+
51
+ /* ── the strip, the title row ───────────────────────────────────────────── */
52
+ .page-strip {
53
+ display: flex;
54
+ flex-wrap: wrap;
55
+ gap: 2px;
56
+ padding: 0 12px;
57
+ border-bottom: 1px solid var(--vscode-panel-border);
58
+ position: sticky;
59
+ top: 0;
60
+ z-index: 5;
61
+ background: var(--vscode-editor-background);
62
+ }
63
+ .strip-tab {
64
+ padding: 7px 12px;
65
+ color: var(--vscode-descriptionForeground);
66
+ border-bottom: 2px solid transparent;
67
+ margin-bottom: -1px;
68
+ }
69
+ .strip-tab:hover { color: var(--vscode-foreground); }
70
+ .strip-tab.on { color: var(--vscode-foreground); border-bottom-color: var(--vscode-focusBorder); }
71
+ .page-head {
72
+ display: flex;
73
+ flex-wrap: wrap;
74
+ align-items: baseline;
75
+ gap: 4px 12px;
76
+ padding: 8px 12px;
77
+ border-bottom: 1px solid var(--vscode-panel-border);
78
+ background: var(--bg-panel);
79
+ }
80
+ .page-title { font-weight: 600; }
81
+ .page-question { color: var(--vscode-descriptionForeground); font-size: 0.9em; }
82
+ .icon-button { margin-left: auto; padding: 0 6px; border: 1px solid var(--border-2); border-radius: 3px; color: var(--vscode-descriptionForeground); }
83
+ .asked { flex-basis: 100%; font-size: 0.85em; color: var(--vscode-descriptionForeground); }
84
+ .asked summary { cursor: pointer; }
85
+ .asked code { display: block; margin-top: 2px; white-space: pre-wrap; word-break: break-all; }
86
+ .page-content { padding: 12px; }
87
+ .page-body { display: flex; flex-direction: column; gap: 12px; max-width: 1280px; margin: 0 auto; }
88
+ .page-subhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 8px; }
89
+ .page-subhead h2 { margin: 0; font-size: 1.05em; }
90
+ .loading, .refused { padding: 48px 12px; text-align: center; color: var(--vscode-descriptionForeground); }
91
+ .refused-title { color: var(--vscode-foreground); font-weight: 600; margin-bottom: 6px; }
92
+
93
+ /* ── grids and cards ────────────────────────────────────────────────────── */
94
+ .grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
95
+ @media (min-width: 900px) {
96
+ .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
97
+ .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
98
+ .grid.wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
99
+ .grid.wide-right { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
100
+ }
101
+ .grid.facts { display: grid; gap: 2px 24px; }
102
+ .card {
103
+ border: 1px solid var(--vscode-panel-border);
104
+ border-radius: 6px;
105
+ padding: 12px;
106
+ background: var(--bg-panel);
107
+ min-width: 0;
108
+ }
109
+ .card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
110
+ .card-head h3, .band-card h3 {
111
+ margin: 0;
112
+ font-size: 0.78em;
113
+ font-weight: 600;
114
+ letter-spacing: 0.05em;
115
+ text-transform: uppercase;
116
+ color: var(--vscode-descriptionForeground);
117
+ }
118
+ .aside { margin-left: auto; font-size: 0.8em; color: var(--vscode-disabledForeground); }
119
+ .subsection { margin-top: 12px; }
120
+ .subhead { display: flex; gap: 8px; font-size: 0.8em; color: var(--vscode-descriptionForeground); margin-bottom: 4px; text-transform: uppercase; }
121
+ .facts { display: flex; flex-direction: column; gap: 2px; }
122
+ .fact { display: flex; align-items: baseline; gap: 8px; font-size: 0.92em; }
123
+ .fact-label { color: var(--vscode-descriptionForeground); }
124
+ .fact-value { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
125
+ .warn { display: flex; gap: 6px; margin: 4px 0; font-size: 0.92em; color: var(--sev-medium); line-height: 1.45; }
126
+ .warn-mark { font-size: 0.7em; margin-top: 3px; }
127
+ .note { margin: 4px 0; font-size: 0.92em; color: var(--vscode-descriptionForeground); line-height: 1.45; }
128
+ .blank { border: 1px dashed var(--border-2); border-radius: 6px; padding: 28px 16px; text-align: center; }
129
+ .blank-title { font-weight: 500; color: var(--vscode-descriptionForeground); margin-bottom: 6px; }
130
+ .blank-body { max-width: 56em; margin: 0 auto; font-size: 0.92em; color: var(--vscode-disabledForeground); line-height: 1.45; }
131
+ .footer { border: 1px solid var(--vscode-panel-border); border-radius: 6px; padding: 8px 12px; background: var(--bg-panel); font-size: 0.9em; color: var(--vscode-descriptionForeground); line-height: 1.5; }
132
+ .headline { display: flex; flex-wrap: wrap; gap: 4px 20px; border: 1px solid var(--vscode-panel-border); border-radius: 6px; padding: 8px 12px; background: var(--bg-panel); font-size: 0.92em; color: var(--vscode-descriptionForeground); }
133
+ .headline .num { color: var(--vscode-foreground); }
134
+ .examples summary { cursor: pointer; font-size: 0.85em; color: var(--vscode-descriptionForeground); }
135
+ .examples ul, .card ul.mono { margin: 4px 0 0; padding: 0; list-style: none; font-size: 0.85em; color: var(--vscode-descriptionForeground); }
136
+ .card ul.mono li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
137
+ .drift { display: inline-block; width: 5em; color: var(--vscode-disabledForeground); }
138
+ .lens-row { display: flex; gap: 8px; font-size: 0.92em; }
139
+ .lens-name { width: 7em; color: var(--vscode-descriptionForeground); }
140
+
141
+ /* ── bars ───────────────────────────────────────────────────────────────── */
142
+ .bars { display: flex; flex-direction: column; gap: 4px; }
143
+ .bar-row { display: flex; align-items: center; gap: 8px; }
144
+ .bar-label { flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92em; color: var(--vscode-descriptionForeground); }
145
+ .bar { flex: 1; min-width: 0; }
146
+ .bar-track { fill: var(--bg-panel-2, var(--vscode-input-background)); }
147
+ .bar-value { width: 5em; flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; font-size: 0.92em; }
148
+ .bar-trailing { width: 1.2em; flex-shrink: 0; text-align: center; color: var(--vscode-descriptionForeground); }
149
+
150
+ /* ── chips, legends, plots ─────────────────────────────────────────────── */
151
+ .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 8px; }
152
+ .chip { border: 1px solid var(--border-2); border-radius: 3px; padding: 1px 7px; font-size: 0.85em; color: var(--vscode-descriptionForeground); }
153
+ .chip.on { border-color: var(--vscode-focusBorder); color: var(--vscode-foreground); }
154
+ .chip.ghost { color: var(--vscode-disabledForeground); }
155
+ .chip[disabled] { opacity: 0.5; cursor: not-allowed; }
156
+ .search { margin-left: 4px; padding: 1px 6px; border: 1px solid var(--border-2); border-radius: 3px; background: var(--vscode-input-background); color: var(--vscode-input-foreground); font: inherit; font-size: 0.85em; }
157
+ .plot { display: block; width: 100%; height: auto; }
158
+ .plot.ribbons, .plot.lanes { width: 100%; height: auto; }
159
+ .ribbons-host, .lanes-host { min-width: 0; }
160
+ .ribbon-name { font-family: var(--vscode-editor-font-family); font-size: 10.5px; }
161
+ .ribbon-layer { font-size: 10.5px; font-weight: 650; letter-spacing: 0.06em; }
162
+ .ribbon-count { font-weight: 400; letter-spacing: 0; }
163
+ .ribbon-pill { cursor: pointer; }
164
+ .ribbon-pill text { font-variant-numeric: tabular-nums; }
165
+ .ribbon-index { margin: 0; padding: 0; list-style: none; }
166
+ .chip-sep { margin: 0 2px 0 8px; font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.05em; color: var(--vscode-descriptionForeground); }
167
+ .mix-bar { display: flex; gap: 2px; height: 18px; width: 100%; max-width: 760px; }
168
+ .mix-bar > div { min-width: 2px; border-radius: 2px; }
169
+ .mix-labels { display: flex; gap: 2px; width: 100%; max-width: 760px; font-size: 0.8em; color: var(--vscode-foreground); }
170
+ .mix-labels > span { min-width: 2px; overflow: hidden; white-space: nowrap; }
171
+ .plot.pulse { width: 100%; height: auto; }
172
+ .plot .mark { cursor: pointer; }
173
+ .legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; font-size: 0.8em; color: var(--vscode-descriptionForeground); }
174
+ .legend span { display: inline-flex; align-items: center; gap: 4px; }
175
+ .swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
176
+ .spread { display: flex; height: 12px; width: 100%; overflow: hidden; border-radius: 2px; background: var(--bg-panel-2, var(--vscode-input-background)); }
177
+ .spread.thin { height: 9px; flex: 1; min-width: 0; }
178
+ .spread > div { border-right: 1px solid var(--bg-panel); }
179
+ .who { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
180
+ .category-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: 0.92em; min-width: 12em; }
181
+ .category-list li { display: flex; align-items: center; gap: 8px; color: var(--vscode-descriptionForeground); }
182
+ .category-name { width: 7em; flex-shrink: 0; }
183
+ .category-list .num { width: 3.5em; text-align: right; }
184
+ .spark-row { display: flex; align-items: center; gap: 8px; font-size: 0.92em; color: var(--vscode-descriptionForeground); }
185
+ .spark-row .num { width: 3em; text-align: right; color: var(--vscode-foreground); }
186
+ .author-row { display: flex; align-items: center; gap: 8px; font-size: 0.92em; }
187
+ .author-name { width: 12em; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
188
+ .author-row .num { width: 3em; text-align: right; }
189
+ .earned { width: 11em; flex-shrink: 0; text-align: center; border: 1px solid var(--border-2); border-radius: 3px; font-size: 0.8em; padding: 0 4px; }
190
+ .earned.none { border-color: transparent; color: var(--vscode-disabledForeground); }
191
+ table.pairs { width: 100%; border-collapse: collapse; font-size: 0.9em; }
192
+ table.pairs th { text-align: left; font-weight: 500; font-size: 0.8em; text-transform: uppercase; color: var(--vscode-descriptionForeground); padding: 3px 6px; }
193
+ table.pairs td { padding: 3px 6px; border-top: 1px solid var(--vscode-panel-border); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
194
+ table.pairs td.num { text-align: right; }
195
+ table.pairs tbody tr { cursor: pointer; }
196
+ table.pairs tbody tr:hover { background: var(--vscode-list-hoverBackground); }
197
+ table.pairs tbody tr.on td { box-shadow: inset 0 1px 0 var(--vscode-focusBorder), inset 0 -1px 0 var(--vscode-focusBorder); }
198
+
199
+ /* ── the Map ────────────────────────────────────────────────────────────── */
200
+ .map-page { display: flex; flex-direction: column; height: calc(100vh - 110px); min-height: 420px; }
201
+ .map-bar, .map-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 0; font-size: 0.9em; }
202
+ .bar-title { text-transform: uppercase; font-size: 0.78em; letter-spacing: 0.05em; color: var(--vscode-descriptionForeground); margin-right: 4px; }
203
+ .crumb { padding: 1px 4px; color: var(--vscode-descriptionForeground); }
204
+ .crumb.on { color: var(--vscode-focusBorder); }
205
+ .crumb-sep { color: var(--vscode-disabledForeground); }
206
+ .map-host { position: relative; flex: 1; min-height: 280px; overflow: hidden; border: 1px solid var(--vscode-panel-border); border-radius: 6px; }
207
+ .map-host canvas { position: absolute; inset: 0; touch-action: none; }
208
+ .map-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
209
+ /* Names sit in a slab's header strip (baseline clear of the 2 px gauge under it) or at a file's top. */
210
+ .card-label { position: absolute; overflow: hidden; display: flex; align-items: flex-end; gap: 6px; padding: 0 5px 3px; box-sizing: border-box; line-height: 1; white-space: nowrap; }
211
+ .card-label .card-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
212
+ .card-label .card-count { flex: none; font-variant-numeric: tabular-nums; font-size: 0.95em; }
213
+ .card-label.layer { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
214
+ .card-label.folder, .card-label.file { font-family: var(--vscode-editor-font-family); font-size: 10.5px; }
215
+ .card-label.file { align-items: flex-start; padding: 3px 4px 0; font-size: 10px; }
216
+ .map-hover { position: absolute; z-index: 10; display: none; max-width: 17rem; pointer-events: none; border: 1px solid var(--border-2); border-radius: 6px; padding: 6px 10px; background: var(--bg-elevated, var(--vscode-editorHoverWidget-background)); font-size: 0.8em; box-shadow: 0 4px 14px var(--vscode-widget-shadow); }
217
+ .hover-kind { text-transform: uppercase; letter-spacing: 0.04em; color: var(--vscode-disabledForeground); font-size: 0.9em; }
218
+ .hover-name { font-weight: 600; font-size: 1.1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
219
+ .hover-path { font-family: var(--vscode-editor-font-family); color: var(--vscode-descriptionForeground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
220
+ .hover-read { margin-top: 4px; color: var(--vscode-descriptionForeground); line-height: 1.4; }
221
+ .hover-read b { color: var(--vscode-focusBorder); margin-right: 4px; }
222
+ .hover-links { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--vscode-panel-border); color: var(--vscode-descriptionForeground); }
223
+ .hover-hint { margin-top: 2px; color: var(--vscode-disabledForeground); }
224
+ .map-foot { position: absolute; left: 8px; right: 8px; bottom: 6px; display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 0.78em; color: var(--vscode-descriptionForeground); pointer-events: none; }
225
+ .map-band { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
226
+ .band-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
227
+ .band-name { font-family: var(--vscode-editor-font-family); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
228
+ .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
229
+ .button { background: var(--vscode-button-background); color: var(--vscode-button-foreground); border-radius: 2px; padding: 3px 10px; font-size: 0.9em; }
230
+ .button:hover { background: var(--vscode-button-hoverBackground); }
231
+ .button.secondary { background: var(--vscode-button-secondaryBackground); color: var(--vscode-button-secondaryForeground); }
232
+ .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
233
+ .tile { border: 1px solid var(--vscode-panel-border); border-radius: 6px; padding: 6px 10px; background: var(--bg-panel); }
234
+ .tile-value { font-size: 1.3em; font-weight: 600; font-variant-numeric: tabular-nums; }
235
+ .tile-label { font-size: 0.85em; }
236
+ .tile-sub { font-size: 0.78em; color: var(--vscode-disabledForeground); }
237
+ .band-card { border: 1px solid var(--vscode-panel-border); border-radius: 6px; padding: 10px; background: var(--bg-panel); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
238
+ .band-card h3 { margin-bottom: 4px; }
239
+ .owner-row { display: flex; align-items: center; gap: 8px; font-size: 0.9em; }
240
+ .owner-name { width: 9em; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
241
+ .owner-bar { flex: 1; height: 6px; border-radius: 2px; background: var(--bg-panel-2, var(--vscode-input-background)); overflow: hidden; }
242
+ .owner-bar i { display: block; height: 100%; background: var(--vscode-focusBorder); }
243
+ .churn { margin-top: 6px; }
244
+
245
+ /* ── the plot readout (Owners & History) ────────────────────────────────── */
246
+ .readable { cursor: default; }
247
+ .plot .mark.readable { cursor: pointer; }
248
+ .readable:focus { outline: none; }
249
+ .readable:focus-visible { outline: 1px solid var(--vscode-focusBorder); outline-offset: 1px; }
250
+ .readable:hover { opacity: 0.85; }
251
+ .spark-hit { fill: transparent; }
252
+ .spark-hit:hover, .spark-hit:focus-visible { fill: var(--vscode-focusBorder); fill-opacity: 0.18; opacity: 1; outline: none; }
253
+ .plot-tip { position: fixed; z-index: 20; display: none; max-width: 22rem; pointer-events: none; border: 1px solid var(--border-2, var(--vscode-editorHoverWidget-border)); border-radius: 6px; padding: 6px 10px; background: var(--bg-elevated, var(--vscode-editorHoverWidget-background)); color: var(--vscode-editorHoverWidget-foreground, var(--vscode-foreground)); font-size: 0.8em; box-shadow: 0 4px 14px var(--vscode-widget-shadow); }
254
+ .tip-head { font-weight: 600; margin-bottom: 3px; overflow-wrap: anywhere; }
255
+ .tip-row { display: flex; justify-content: space-between; gap: 14px; line-height: 1.45; }
256
+ .tip-label { color: var(--vscode-descriptionForeground); }
257
+ .tip-value { font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
258
+
259
+ /* ── Attack surface, Entry points, Links (SAST reporting P6) ───────────── */
260
+ .verdict { display: flex; flex-direction: column; gap: 4px; }
261
+ .verdict-word { font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85em; }
262
+ .surface-plot { overflow-x: auto; }
263
+ .surface-plot svg { min-width: 640px; }
264
+ .plot-head { font-size: 11px; }
265
+ .plot-sub { font-size: 10px; }
266
+ .plot-row { font-size: 11.5px; }
267
+ .row-hit { cursor: pointer; }
268
+ .row-hit:focus { outline: none; }
269
+ .row-hit:focus-visible { stroke: var(--vscode-focusBorder); stroke-width: 1; }
270
+ .strip-host { overflow-x: auto; padding-bottom: 4px; }
271
+ .strip { display: block; margin: 4px 0; }
272
+ .strip-name { font-size: 11.5px; }
273
+ .strip-at { font-size: 10px; }
274
+ .sub-head { margin: 10px 0 4px; font-size: 0.8em; font-weight: 500; text-transform: uppercase; color: var(--vscode-descriptionForeground); }
275
+ .pins { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
276
+ .pins li { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
277
+ .pins .tier { flex-shrink: 0; color: var(--sev-high); }
278
+ table.pairs tbody tr.on td { background: var(--vscode-list-inactiveSelectionBackground); }
279
+ details.more summary { cursor: pointer; font-size: 0.85em; color: var(--vscode-descriptionForeground); }