Skip to content

feat(agents): repo-local Symposium, error-Display gate, CLAUDE.md - #186

Merged
athvin merged 1 commit into
mainfrom
chore/symposium-error-display-gate
Oct 20, 2026
Merged

athvin merged 1 commit into
mainfrom
chore/symposium-error-display-gate

Conversation

@athvin

@athvin athvin commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Installs Symposium entirely inside the repo rather than the developer's home directory, then acts on the first thing its skills surfaced.

Symposium, repo-local

make symposium is the dev-install entry point (verified from a clean slate):

What Where Committed?
cargo-agents binary .tools/bin no — 15MB, per-platform, fetched
config / cache / logs .symposium (SYMPOSIUM_HOME) config only
dependency-matched skills rust/.claude/skills no — generated

Nothing is written to ~/.symposium, ~/.cargo/bin, or ~/.claude.

Two wrinkles worth knowing, both handled:

  • Symposium locates its project with cargo metadata, and this repo's cargo workspace root is rust/, not the repo root. scripts/symposium sets SYMPOSIUM_HOME and runs from rust/.
  • That also means the hooks it writes to rust/.claude/settings.json are inert — Claude Code's settings stack has no nested level and reads only the repository-root file. So .claude/settings.json carries one bridging hook. Only SessionStart: the hook costs ~1.3s warm, and Symposium registers on PreToolUse/PostToolUse with matcher *, which would tax every tool call.

Errors must not interpolate their own source

#[error("reading {path:?}: {source}")]   // double-prints
#[error("reading {path:?}")]             // right

Reporters walk .source() separately. Ten variants across five crates did this.

Fixing the messages alone would have been a regression: er-server flattens errors into Result<_, String> for job-failure text and printed them with plain {e}, so dropping the cause from Display would have deleted the serde line/column detail from a production path. Hence er_server::errfmt::chain, and 11 call sites updated — {e:#} for anyhow, chain() for thiserror types.

That incidentally fixes a pre-existing bug: e.to_string() on an anyhow error was already discarding every .context() in the dispatcher.

Rendered output now, each chain link exactly once:

er-entity: loading entities from …/entities: parsing "…/broken/entity.yaml":
columns[0]: unknown field `this is`, expected one of `name`, `type`, … at line 3 column 5

The gate

er-errors/tests/display_no_source.rs, beside the existing posterity gates in er-schema/tests and following their shape. It rides cargo test --workspace, so no Makefile change — make check already runs it. Kept in Rust rather than wiring a Python script into scripts/ci/, since the repo deliberately removed its Python.

Covers all three spellings thiserror accepts, each verified by reintroducing the violation:

Spelling Caught
tuple #[from] → {0} ✅
bare source: field → {source} ✅
named #[source] (± pub) ✅

The ad-hoc scanner this started from could not see the third shape; the gate is strictly stronger. It also asserts it saw >30 #[error] attributes, so a parser matching nothing fails loudly instead of passing forever.

Also

  • RUST_BACKTRACE=1 / RUST_LIB_BACKTRACE=0 in rust/Dockerfile — panic backtraces without anyhow capturing one per constructed Error. In the Dockerfile rather than the chart so it covers all three binaries.
  • CLAUDE.md — the repo had none, and the rust-best-practice skill Symposium installs prescribes a bare cargo fmt/clippy/test finish line that omits entities-check. It now states that the gate is make check.
  • .claude/settings.local.json gitignored, now that a committed settings.json sits beside it.

Verification

make check passes (fmt + lint + entities-check + test). Audit re-runs at 0 findings. Nothing asserts on the changed error strings and there are no snapshot tests.

🤖 Generated with Claude Code

Install Symposium (https://github.com/symposium-dev/symposium) entirely inside
the repo rather than the developer's home directory, then act on the first
thing its skills surfaced.

Symposium, via `make symposium`:
  - cargo-agents binary -> .tools/bin (fetched, gitignored: 15MB, per-platform)
  - config/cache/logs   -> .symposium  (SYMPOSIUM_HOME; only config committed)
  - matched skills      -> rust/.claude/skills (generated, gitignored)
Nothing is written to ~/.symposium, ~/.cargo/bin or ~/.claude. scripts/symposium
is the wrapper that sets SYMPOSIUM_HOME and runs from rust/, since Symposium
locates its project with `cargo metadata` and the cargo workspace root is rust/,
not the repo root. That also makes the hooks it writes to rust/.claude/
settings.json inert — Claude Code reads settings only from the repository root
— so .claude/settings.json carries one bridging SessionStart hook. Only
SessionStart: the hook costs ~1.3s warm, and Symposium registers on
PreToolUse/PostToolUse with matcher "*", which would tax every tool call.

Errors must not interpolate their own source:

  #[error("reading {path:?}: {source}")]   // double-prints
  #[error("reading {path:?}")]             // right

Reporters walk .source() separately, so interpolating prints the cause twice.
Ten variants across five crates did this. Fixing the messages alone would have
been a regression: er-server flattens errors into Result<_, String> for job
failure text and printed them with plain {e}, so dropping the cause from Display
would have deleted the serde line/column detail from a production path. Hence
er_server::errfmt::chain, and 11 call sites updated — {e:#} for anyhow, chain()
for thiserror types. That also fixes a pre-existing bug: e.to_string() on an
anyhow error was already discarding every .context() in the dispatcher.

er-errors/tests/display_no_source.rs makes it structural, beside the existing
posterity gates in er-schema/tests. It scans every product source and covers all
three spellings thiserror accepts: #[from]/#[source] on a tuple field, the same
markers on a named field, and the implicit case of a field merely named `source`
(the scanner this started from missed the middle one). Verified by reintroducing
each violation; it asserts it saw >30 attributes so a parser matching nothing
fails loudly rather than passing forever.

Also: RUST_BACKTRACE=1 / RUST_LIB_BACKTRACE=0 in rust/Dockerfile (panic
backtraces without anyhow capturing one per constructed Error), and a CLAUDE.md
— the repo had none, and the rust-best-practice skill Symposium installs
prescribes a bare cargo fmt/clippy/test finish line that omits entities-check.

Co-Authored-By: Claude Fable 5 <[email protected]>
@athvin
athvin merged commit 7abf6f6 into main Oct 20, 2026
8 checks passed
@athvin
athvin deleted the chore/symposium-error-display-gate branch October 20, 2026 03:47
athvin added a commit that referenced this pull request Oct 20, 2026
…187)

* ci(frontend): make the gate blocking, and add the supply-chain half

The frontend has had a real CI workflow since #97, but it never gated
anything: branch protection on main requires four contexts and all four
are rust.yml's. `lint + types + unit` and `playwright functional tier`
ran and were then ignored at merge time. On top of that the `paths:`
filter meant #184, #185 and #186 did not run the frontend tier at all.

Making those jobs required needs the filter gone first: a workflow a
path filter skips never reports, so a required check would sit pending
forever on every backend-only PR. rust.yml already solved this for its
`.claude/**` skip — a `detect` job and an `if:` on each real job, since
a job skipped by `if:` reports "skipped", which branch protection
accepts. This mirrors that, filtering on `^frontend/` instead.

Then the half that was missing entirely. The Rust side runs cargo-deny
(advisories + licenses + bans) on every PR; the frontend ran nothing —
no `pnpm audit`, no license check, no SAST — and Dependabot covered only
`github-actions`, so npm dependencies were never bumped. The repo's own
notes flagged it (skills/security/references/secrets-iac.md: "Dependabot
does not cover cargo or npm").

Switching the gate on showed what that cost: 4 HIGH advisories, six of
them against `next` itself, including a HIGH SSRF in image optimization
fixed four patch releases earlier. So this also bumps next 16.3.6 →
16.3.8 (and the two eslint packages in lockstep), sharp → 0.35.5 and
source-map-js → 1.2.2, taking the tree from 4 high / 5 moderate / 1 low
to 1 high / 1 moderate. 16.3.8 rather than 16.4.2 deliberately: it is
the minimum that clears the advisories and stays inside the pinned
minor, which keeps the committed visual baselines in play.

The one remaining HIGH is allowlisted with its reasoning, following
deny.toml's convention of a prose justification per entry: [email protected]
is the newest published version and the advisory records no patched
release, it is reached only through @next/eslint-plugin-next at lint
time, and the only glob patterns it ever sees are our own eslint config.

New gates, each verified to fail as well as pass:

- `pnpm audit:check` — HIGH/CRITICAL fail, moderate and below reported.
  Reports stale allowlist entries so exceptions cannot accumulate.
- `pnpm licenses:check` — an allowlist, not a denylist, so an unseen
  license fails and gets looked at. deny.toml's 12 ids verbatim plus the
  npm tree's additions, each carrying why it is permissive enough.
- `pnpm authz:check` — every tenant route calls requireOrgAccess and
  every admin route requireSuperAdmin (54 handlers, all compliant).
  This was written as a semgrep rule first; semgrep rejected the pattern
  as invalid TypeScript while still reporting the rule as run with zero
  findings, so two deliberately unauthorized handlers passed. It is now
  code with tests that plant violations and require them to be caught.
- semgrep keeps the three sink rules confirmed to fire: HTML injection,
  dynamic eval, and NEXT_PUBLIC_* leakage.
- the `pnpm gen:api` drift gate frontend/README.md has claimed since #38
  but which never existed — the only related step was rust.yml's
  er-openapi-check, suffixed `|| true`.

Also restores the five `make frontend-*` targets dropped by 9a55504,
whose message says the frontend targets were retained. Their scripts
were never deleted, and frontend/dev/run.sh:97 has been calling
`make frontend-seed` since. `frontend-seed` itself is NOT restored: its
implementation went in 7cc444f with no replacement, which is why the
full-stack e2e tier is dormant.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* fix(web): pin the GCM auth-tag length in the credential vault

The first run of the new semgrep gate found this
(javascript.node-crypto.security.gcm-no-tag-length), and it is a real if
modest hardening.

GCM accepts 4-16 byte authentication tags. `open()` slices the last
TAG_BYTES off the stored ciphertext, so a row whose ciphertext is
SHORTER than 16 bytes slices to a short tag — and without an explicit
authTagLength, Node accepts it. A short tag is correspondingly cheaper
to forge. The vault's whole premise is surviving someone who can write
the row (that is what the org+role AAD binding is for), so this is
exactly the threat model to care about.

Pinning authTagLength on both ends makes Node reject any tag that is not
16 bytes. The new test truncates a sealed ciphertext to 0/1/8/15 bytes
and requires each to throw.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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