eval-preflight failures drop the real nix assertion — clan.Readiness carries no Tail, excerpt() cannot keep an assertion body line #629
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#629
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
The eval-preflight path (
clan.Readiness/Adapter.evalReadinessininternal/clan/adapter.go) drops the rawnix evaloutput entirely once itclassifies a failure. Unlike the deploy-apply path (
clan.Failure.Tail,internal/clan/adapter.go'sclassify()), theclan.Readinessstruct(
internal/clan/clan.go:170) carries onlyKindandDetail— noTailfield — so the fuller raw log
classify()computes internally(
f.Tail = tail(res.Output)) is computed and then discarded before it everreaches
enrollment.go'spreflight(), which buildss.Failurestraight offReadiness.Detailalone.Detailitself isexcerpt(res.Output)— an 8-line token grep(
internal/clan/adapter.go'sexcerpt()). Its token list ("error:","failed assertions","attribute","does not evaluate", …) reliably keepsa
Failed assertions:HEADER line, but a Nix assertion's own body line (e.g.- services.kanidm.provision.systems.oauth2.gate-oidc.scopeMaps refers to unknown groups: idm_all_persons) carries none of those tokens unless theassertion message text happens to include one by coincidence — so the actual
assertion, the one thing an operator or on-call agent needs to fix the
config, is silently dropped.
Evidence
Rehearsal drive
20260821T015833Z(#628) redsdeploy-takeoveron exactlythis path.
founding-state.log's failure detail reads:— truncated with no assertion body at all. The real assertion was only
recoverable by re-running
nix evalby hand against the drive's own capturedstate/clan-configdirectory. No artifact the drive produces (legs.json,founding-state.log, the operator-facing UI) carried the real cause.Suggested shape
Tailfield toclan.Readiness(mirroringclan.Failure.Tail) andthread
classify()'s already-computed tail throughevalReadinessinto it.Readiness.Tailinto theclan.Failureenrollment.go'spreflight()builds, the same waydeploy.goalready carriesclan.Failure.TailintoDeployFailure.Tailfor the apply path.excerpt()'s token match (or adding a dedicated"keep every line after a
Failed assertions:/error:header, bounded")so a genuine assertion body survives the 8-line grep on its own, without
needing the full
Tailfallback.Found and scoped by the #628 session-runner drive; not fixed there — a
different subsystem (observability/evidence-capture, not the config bug
itself).
Triage: verified.
internal/clan/adapter.go'sclassify()computes a bounded raw-outputTail(f.Tail = tail(res.Output)) and stores it on*Failure, butevalReadinessonly readsf.Kind/f.Detailoff that*Failurebefore discarding it and returning aReadiness— whose struct (internal/clan/clan.go) has noTailfield at all.enrollment.go'spreflight()then buildss.Failurestraight fromReadiness.Kind/Readiness.Detail(noTail), so the eval-preflight failure path is the one place*Failure.Tail— populated everywhere else — never makes it onto the wire. Confirms the issue's read of the code exactly; the suggested shape (addTailtoReadiness, thread it through) is the natural fix along the same seam the apply-pathDeployFailure.Tailalready uses.Ruled by agent under ADR 0174 — veto anytime: classifying this
bug/ready-for-agentrather than routing to a human. This is a two-way door — a typed-field addition and one extra assignment, revertible by a follow-up commit, and provable by the existing eval-preflight test coverage (extend it to assertReadiness.Tail/Failure.Tailis non-empty on a classified failure) plus a rehearsal drive reproducing #628's assertion-failure shape. No UX flow or wireframe is referenced (this is an internal observability/evidence-capture change), so the missing-design gate doesn't apply, and there's no task manifest with aneeds_human_decisionentry.Agent Brief
Category: bug
Summary: Eval-preflight failures lose the raw Nix assertion body; only
Readiness/Failure.Detail's 8-line token-grepped excerpt reaches disk/operator, never the fullerTailthe classify path already computes.Current behavior:
When
Adapter.evalReadinessclassifies a failednix evalduring preflight,classify()internally computes a bounded raw-output tail and stores it asFailure.Tail, butevalReadinessdiscards that*Failureafter reading onlyKindandDetail, and returns aReadinessvalue whose type carries no tail field.enrollment.go'spreflight()copiesReadiness.Kind/Readiness.Detailintos.Failure, so the eval-preflight failure path'sFailure.Tailis always empty — unlike the deploy-apply path, whereFailure.Tailis populated and reachesDeployFailure.Tail.Detail's 8-line token grep (excerpt()) reliably keeps aFailed assertions:header line but drops the assertion's own body line unless it happens to contain one of the grep tokens, so a genuine Nix assertion message is silently absent from every artifact (legs.json,founding-state.log, the operator UI) a preflight failure produces.Desired behavior:
An eval-preflight failure carries the same bounded raw-output tail that a deploy-apply failure already carries, so the real assertion body (or any other evidence outside
excerpt()'s token list) survives intofounding-state.log/legs.jsonand is visible to an operator or on-call agent without having to re-runnix evalby hand against a capturedstate/clan-config.Key interfaces:
clan.Readiness(internal/clan/clan.go) — needs aTailfield,omitempty, mirroringFailure.Tail's shape and doc comment.Adapter.evalReadiness(internal/clan/adapter.go) — thread the*Failurereturned byclassify()through into the newReadiness.Tailfield, the same wayKind/Detailare threaded today.enrollment.go'spreflight()— carryReadiness.Tailinto theFailure.Tailit builds fors.Failure, matching howdeploy.goalready carriesFailure.TailintoDeployFailure.Tailfor the apply path.excerpt()'s token match (or add a "keep every line after aFailed assertions:/error:header, bounded" rule) so a genuine assertion body survives the short grep on its own — the issue calls this out as a nice-to-have, not a substitute for theTailfix.Acceptance criteria:
Readinesscarries aTailfield populated wheneverevalReadinessclassifies a failure, containing the same bounded tailclassify()already computes.preflight()'ss.Failurefor an eval-preflight failure has a non-emptyTailwhenever the underlyingnix evaloutput is non-empty, matching the deploy-apply path's existing behavior.excerpt()'s grep tokens) shows the assertion body present in the resultingFailure.Tail, not just theFailed assertions:header inDetail.Readiness/Failure, not a reshaping ofDetail's existing grep behavior.Out of scope:
excerpt()'s token-grepDetailcomputation —Tailis a supplement, not a replacement, exactly as it already is for the deploy-apply path.classify()'s classification order/tokens (connectivity before secrets, masked_exit handling) — untouched by this fix.missing_var/sops.defaultGroupsroot cause (#628) — this ticket only fixes the evidence capture that #628's drive exposed, not the underlying config-eval failure itself.swarm-claim host=matou-dev-server-01 run=8270
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #629 — status
success✅ close-report gates passed — every claim verified against main; closing.
envelope