Full codebase analysis: fail-loud pass + low-hanging correctness fixes#86
Merged
Conversation
Silent last-wins/skip behaviors become errors at the earliest layer that can see them: - Collector::enter is typed (TypeId per Argo name): two different fns mapping to one template name panic at emit instead of silently dispatching both call sites to whichever body registered. - BuildCtx::collect rejects same-named #[fragment]s / PVC types with differing contents (bare-name registries silently last-won). - resolved_secrets: required-wins optionality merge, and distinct (name, key) pairs that flatten to one ATHENA_SEC_* env var panic instead of one silently shadowing the other (host mounts are immune — they key by hash; secrets weren't). munge doc updated to state the lossy-flattening limitation. - artifact_ident collisions (a.b vs a-b) panic instead of emitting duplicate artifact names on one template. - pvc_volumes panics on an unregistered PVC name (was: silently emit a template missing its mount, failing far away in-pod). - #[inject] misuse is a spanned compile error: malformed attr bodies (previously silently demoted the arg to a normal parameter), #[inject] on Artifact args (silently dropped), and non-trailing inject args (positional wiring handed the caller's values to the wrong inputs — compiled clean, broke at submit). CONTAINER.md updated to match. - host!/load_artifact*! reject surplus args via the compile_error gate (secret! already did via two_str_lits arity). - CLI: missing/malformed athena.toml is a clean one-line error (exit 2) instead of a panic on every consumer command; doctor reports a TOML parse error as a red check instead of panicking; cargo metadata failures pass through cargo's stderr; emit --out I/O errors die cleanly; --node-selector parses before any cluster write; forced --update re-applies are labeled 'forced' and live-spec parse failures are logged instead of silently read as drift. - Removed dead Collector::add_builder and doctor's unused 'missing' vec; host_nested_in_macro fixture no longer pins toolchain-dependent rustc notes. New unit tests in core (enter/secret/artifact guards) and six new trybuild UI fixtures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzynLVNz1o2QJY14PkTGCq
- emulate: never upload output artifacts (or print the return value)
from a FAILED container run — the S3 keys are the same ones deployed
workflows read, so a crash's partial outputs clobbered live data.
- emulate: truncate arg previews on a char boundary; a multi-byte char
straddling byte 40 panicked mid-error-report.
- init: the scaffold's 'Next:' hint suggested
'submit <name>-pipeline -y', which passes the template name as the
BINARY positional and can't work; use 'submit -y' (source build,
root template).
- macros: retry(limit = N) parsed as u32 then cast to i32, so large
literals silently wrapped to negative limits — parse straight to the
wire type for a spanned out-of-range error.
- macros: char literal args JSON-encode their value ('a' shipped as
"'a'", quotes included, and failed the in-pod decode); byte /
byte-string / C-string literals get a spanned error instead of
stringified token text.
- macros: mid-body 'return' in a #[workflow] is a spanned error — the
body lowers to a DAG, so trailing statements still ran as tasks in
Argo and a later 'return' overwrote the output task (last-wins, the
opposite of Rust). New UI fixture pins the diagnostic.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AzynLVNz1o2QJY14PkTGCq
mostlymaxi
force-pushed
the
claude/cargo-athena-analysis-de968h
branch
from
July 15, 2026 03:40
a979af9 to
323c2f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two commits from a full review of all four crates, CI, and release plumbing. The complete findings document lives in #91 (kept out of the tree per review); the actionable remainder is tracked in #87 (fan-out re-tagging), #88 (hook type-checking), #89 (release hardening), #90 (validation/cleanup batch).
1. Fail loud on silent collision and misuse paths:
Collector::enter(TypeId per Argo name): two different fns mapping to one template name panic at emit — previously one template silently won and both call sites dispatched to it.#[fragment]s / PVC types with differing contents panic inBuildCtx::collect(bare-name registries silently last-won; fragments carrysecret!declarations, so this was not just "extra mounts").resolved_secrets: required-wins optionality merge, plus a panic when distinct(name, key)pairs flatten to oneATHENA_SEC_*env var — reproduced with("a.b","k")vs("a-b","k")both emittingATHENA_SEC_A_B__K, one silently shadowing the other in-pod. (Host mounts are immune — they key by hash.)mungedoc updated to state the lossy-flattening limitation.artifact_identcollisions (a.bvsa-b) and unregistered-PVC lookups panic at emit instead of emitting broken templates that fail far away in-pod.#[inject]misuse is a spanned compile error: malformed bodies (previously silently demoted the arg to a normal parameter),Artifact<..>args (silently dropped), and non-trailing inject args — positional wiring handed the caller's values to the wrong inputs; compiled clean, broke at submit.CONTAINER.mdupdated ("allowed anywhere" → trailing-only).host!/load_artifact*!surplus args hit thecompile_error!gate instead of being silently dropped.athena.tomlis a clean exit-2 error on every consumer command instead of a panic — includingdoctor, which used to panic on the very config it diagnoses (now a red check).cargo metadatafailures pass through cargo's stderr;emit --outI/O errors die cleanly;--node-selectorvalidates before any cluster write; forced--updatere-applies are labeledforced; live-spec parse failures are logged instead of silently reading as drift.Collector::add_builder, doctor'smissingvec); thehost_nested_in_macrofixture no longer pins toolchain-dependent rustc notes (it drifted on stable 1.97).2. Low-hanging correctness bugs:
emulateno longer uploads output artifacts (or prints the return) from a failed container run — the S3 keys are the same ones deployed workflows read, so a crash's partial outputs clobbered live data.init's "Next:" hint suggestedsubmit <name>-pipeline -y, which passes the template name as theBINARYpositional and can't work.retry(limit = N)no longer wraps u32→i32 to a negative limit; char literals JSON-encode their value ('a'shipped as"'a'"and failed the in-pod decode); byte/byte-string literals get a spanned error.returnin a#[workflow]is a spanned error — trailing statements still ran as DAG tasks and a laterreturnoverwrote the output task (last-wins, the opposite of Rust).Testing
Five new core unit tests (enter/secret/artifact guards), eight new trybuild fixtures, full
cargo test --workspace+ clippy clean. The importing-example golden caught (and I fixed) a regression in my first cut of the surplus-arg check — the layered test architecture works.🤖 Generated with Claude Code
https://claude.ai/code/session_01AzynLVNz1o2QJY14PkTGCq