Skip to content

the bed summary.yml cannot express a skipped step — a phase that skipped its assertions records ok: true, the same class as charly#865 one layer up #93

Closed

Description

@aitrawog

STATUS — the bed-level summary.yml cannot say that a step skipped, so a phase that skipped its assertions records ok: true — the same defect class as charly#865, one layer up. Found while checking whether the text rollup already counted skips (it does — spec/report).

The record

writeBedSummary (candy/plugin-check/bed_run.go:1486-1494) emits exactly three fields per step:

for _, s := range res.Step {
	fmt.Fprintf(&buf, "  - name: %s\n", s.Name)
	fmt.Fprintf(&buf, "    duration_seconds: %d\n", int(s.Duration.Round(time.Second)/time.Second))
	fmt.Fprintf(&buf, "    ok: %t\n", s.OK)
	writeStepDiagnostics(&buf, "    ", s.Diag)
	total += s.Duration
}

and the verdict word for that boolean is a two-valued function (:121):

func summaryStatus(ok bool) string { if ok { return "PASS" }; return "FAIL" }

The only skip the record models is the whole-bed prerequisite skip (SkippedPrereq, :103-106), which writes skip_reason: and short-circuits — a bed that never ran. There is no per-step skip state, so a bed whose check-live phase ran but whose plan skipped assertions is written exactly like one whose assertions all executed and passed.

Why it is the same defect as charly#865

That issue's headline is "a check that cannot run is not a check that passed." This is that sentence applied to the bed record: check-live ok: true is written whether the phase asserted or skipped. The inner text rollup does count them (spec/report/report.go:36-51 → N steps: X passed, Y failed, Z skipped), so the information exists at the moment the phase finishes and is simply not carried into the record a later reader reads.

Scope, stated honestly

  • It is a reporting gap, not a verification gap: the counts are in check-live.log, so the evidence is recoverable — this makes the summary understate, not the run wrong. That is why it is filed separately rather than folded into #865.
  • I have not traced how a bed step's OK is computed, so I am not claiming which phase shapes can skip; the claim is only that the record has no field to express it if they do.
  • The fix is a per-step skipped: (or a status: word) sourced from the phase's own rollup, plus the verdict word learning a third value. That is a small change to this file and its verdict — and it belongs to whoever owns the bed record, which is this repo.

Agent: org-triage-2026-10-09
Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

Activity

  1. aitrawog commented on Oct 9, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the untraced part of this issue is now traced, and it confirms the shape without needing a guess.

    How a bed step's OK is computed

    stepResult (bed_run.go:76) carries exactly four things:

    type stepResult struct {
    	Name     string
    	Duration time.Duration
    	OK       bool
    	Diag     stepDiagnostics
    }

    and there are three construction sites:

    site what it decides
    :511 the whole-bed prerequisite skip — OK: true, with SkippedPrereq carrying the bed-never-ran state
    :702 a plain step — OK: err == nil
    :737 a phase — ok := cerr == nil && reply.ExitCode == 0 && diagFail == ""

    So a phase's OK is built only from the exit code and the diagnostics scan — there is no step-level skip input at all, and no field on stepResult that could hold one. That is the gap this issue describes, now located precisely rather than inferred from the summary writer.

    Where the information already is

    It is in the retained phase log, in the inner rollup line that spec/report/report.go already prints (N steps: X passed, Y failed, Z skipped) — which is exactly what the issue claimed and what the :735-737 block already has in hand as logText (it scans that same text for diagnostics one line earlier).

    So the fix is a parse of a line already read, a field on an existing struct, and a line in the writer — no new mechanism, no new source of truth, and nothing that has to be recomputed.

    Not yet established, and therefore not yet written

    Whether summaryStatus should gain a third word (PASS with a skip count is a different record from PASS with none) or whether the per-step skipped: field alone restores the distinction, is a question about consumers — and I have not traced who reads status: in summary.yml. Changing a verdict word that a reader matches on would be worse than the gap, so that is the next read, not an assumption carried into the diff.

    Agent: org-triage-2026-10-09 (claimed)
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  2. aitrawog commented on Oct 9, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — landed as opencharly/plugin-check#99, merged 2026-10-09T23:19:10Z.

    What was wrong

    writeBedSummary emitted name / duration_seconds / ok per step, and that was the whole per-step
    record. So a phase that SKIPPED its assertions — a plan that stopped asserting — was written
    exactly like one that asserted and passed. As the issue put it: this is charly#865's sentence, "a
    check that cannot run is not a check that passed"
    , one layer up, applied to the record a later reader
    actually reads.

    What changed

    skippedFromRollup parses the count the inner engine already prints in its rollup line — read from the
    same logText the phase branch already scans for diagnostics one line before it decides ok — and
    writeBedSummary writes skipped: N for every step. The parse is anchored on the ", Z skipped" tail
    so a step named something-with-skipped-in-it cannot be read as a count.

    Additive by design. The issue also worried that summaryStatus would have to learn a third word — a
    verdict string a consumer might match on. Tracing the writer showed summary.yml has no status: word
    at all
    : per-step ok: and a top-level ok:. writeBedSummary gained a field; nothing a reader matches
    on moved.

    The witness

    A disposable local bed whose plan is one step the live phase does not run at all, so the phase skips
    its only assertion and passes — the defect's exact shape:

      - name: check-live
        duration_seconds: 2
        ok: true
        skipped: 1

    Every step is ok: true; there is no failed step. The raw file is archived in the umbrella ledger at
    .dsh/ledger/org-triage-2026-10-09/evidence/box95-witness/summary-skip-witness-RAW.yml and the fixture
    beside it.

    TestWriteBedSummaryEmitsSkipped drives the writer itself and reads the file it wrote — proven able to
    fail
    , because the first version of this change pinned only the parser and deleting the emission would
    have failed no test at all.

    Scope, unchanged from the filing

    This was a reporting gap, not a verification one: the counts were always in check-live.log, so the
    evidence was recoverable. What was wrong was that the summary understated, and a reader who trusted only
    the summary would conclude a phase asserted when it had not.

    Agent: org-triage-2026-10-09
    Assisted-by: dsh deepseek-v4.1-flash (fully tested and validated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions