Skip to content

feat(console): named sessions — explicit, switchable active scan workspace - #61

Merged
henleda merged 2 commits into
feat-session-inventoryfrom
feat-console-sessions
Aug 19, 2026
Merged

feat(console): named sessions — explicit, switchable active scan workspace#61
henleda merged 2 commits into
feat-session-inventoryfrom
feat-console-sessions

Conversation

@henleda

@henleda henleda commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Stacked on #60 (feat-session-inventory) → which is stacked on #59. Merge order: #59#60 → this. It retargets to main as each parent lands.

The final piece of the session/inventory split (PR 2). PR #60 separated per-session scan artifacts from the global live-band-aid inventory; this makes the active session a first-class, visible thing so the session-scoped tabs can never silently show two runs.

What it adds

  • A session = an out* dir. GET /api/sessions lists every workspace (findings count, friendly name, active flag). POST /api/session opens an existing one or creates a fresh new named one (out-<slug> + a session.json holding the display name + created-at), setting the OUT the read/scan endpoints use.
  • Header session selector + "+ New". Switching hard-reloads so every session-scoped tab repopulates from the chosen session; a scan defaults its output dir to the active session.
  • Guarded: open only accepts a dir the discovery lists (no path traversal); new slugifies the name and won't clobber an existing session.json.

Agent-native parity

The console's session switcher is a new user capability, so an agent gets equivalents via MCP:

Verification

  • New test_console_sessions.py (list/open/new/traversal-guard/slug) + test_mcp.py additions (the sessions tool + retire lb schema, read-only hint).
  • Full suite: 1206 passed, 15 skipped. Header selector verified live (screenshot).

🤖 Generated with Claude Code

Daniel Henley and others added 2 commits August 18, 2026 20:56
…space

The final piece of the session/inventory split: make the active scan session a first-class,
visible thing so the session-scoped tabs can never silently show two runs.

- A session is an out* dir. GET /api/sessions lists every workspace (findings count, friendly name,
  active flag); POST /api/session opens an existing one or creates a fresh named one (out-<slug> +
  session.json), setting the OUT the read/scan endpoints use.
- Header gains a session selector + "+ New"; switching hard-reloads so every tab repopulates from
  the chosen session, and a scan defaults its output dir to the active session.
- open is guarded to an allowlist of discovered dirs (no path traversal); new slugifies the name.

Agent-native parity: a read-only MCP `sessions` tool lists the same workspaces (an agent targets a
session via the `out` param every tool already takes), and the MCP `retire` tool now exposes the
`lb` selector the CLI/console gained, so an agent can disambiguate a finding live on two LBs.

Full suite: 1206 passed, 15 skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… create-session gap

Adversarial review of the named-sessions feature (2 finders found nothing — traversal guard and
XSS escaping held):

- A summary.json/session.json that is valid JSON but NOT an object (null / 42 / a list) made
  {}.update(loaded) raise TypeError/ValueError, uncaught — 500-ing all of /api/sessions and the MCP
  `sessions` tool over ONE damaged file. New shared `sessions.read_meta` returns {} for a missing,
  unparseable, OR non-object sidecar; both surfaces use it.
- Agent-native parity gap: the console's 'New session' writes a friendly session.json name, but no
  MCP tool could create a named session — an agent could read the name it can't set. New WRITES_OUT
  `session_new` tool creates out-<slug> + session.json via the SAME shared helper the console now
  uses (`sessions.create_session` / `slugify`), so the slug rules and metadata shape can't drift.

Full suite: 1209 passed, 15 skipped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@henleda
henleda force-pushed the feat-console-sessions branch from 272653a to 705ab75 Compare August 19, 2026 01:57
@henleda
henleda merged commit b00282a into feat-session-inventory Aug 19, 2026
4 checks passed
henleda added a commit that referenced this pull request Aug 19, 2026
chore: land the session/inventory + named-sessions work into main (recovery for #60/#61)
@henleda
henleda deleted the feat-console-sessions branch August 19, 2026 02:06
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