test(activity): grade the DIVE-3419 PARTIAL banner at the presenter seam (DIVE-3421) - #649
Open
5dive-bot wants to merge 1 commit into
Open
Conversation
…eam (DIVE-3421) DIVE-3419 gave activity_collect a reporting contract — .partial names every level it could not read, and cmd_activity prints it above the counts. The collector harness (tests/usage_middle_wildcard_unit.sh, 23 arms) asserts the JSON field only. The banner is bash+jq behind require_root, so it had no arm at all: a .partial that is populated correctly and never rendered is the same silence DIVE-3419 exists to remove, and a jq typo in it would be caught by nothing. 19 arms against the REAL cmd_activity with only activity_collect stubbed (tests/usage_presenter_coverage_unit.sh is the precedent and the shape). Anchor first — a complete read renders its specific non-zero counts — so that every absence arm below is a statement about the banner and not about a dead renderer. Then: the banner exists, on STDOUT (a warning on the other stream is gone the moment anyone pipes the trail), carries the array's LENGTH, says SHORT of the truth rather than low, names EVERY level verbatim on its own indented line, and prints BEFORE the counts it qualifies (both line numbers must exist — an absent banner leaves an empty string, which bash reads as 0). Then the DIVE-3419 decision itself: a partial read still renders the whole trail and exits 0, because this reader owes a reporting contract and not the fail-closed one its spend-scanning sibling owes. Plus the idle case (an empty trail with an unread level still warns — 0 is what reads as "did nothing"), an over-fire control (no .partial field at all: no banner, no crash), --json (the field travels, the banner does not leak into the stream), and the --task view. GRADE, uid 1015 unprivileged, same harness both sides. 19/0 on this tree in 0.42s (core tier, no TIER marker). NEGATIVE CONTROL against the pre-banner cmd_usage.sh at origin/main (78b6a6a), which is byte-identical apart from the banner block: 10 passed, 9 failed — the anchor and trail arms stay GREEN there, so the control reaches its assertions rather than erroring out. Two mutations on the fixed tree, each reddening only its own arms: printing [0:1] of .partial reds "named levels" + "level layout" (17/2); moving the block below the counts reds "banner position" only (18/1). Siblings unmoved: usage_presenter_coverage 26/0, usage_middle_wildcard 23/0, usage_coverage 11/0, usage_dispatch_flag 15/0, usage_enumeration_completeness 9/0, heartbeat_usage_heal 27/0. Stacked on dive-3419-usage-middle-wildcard (PR #648, open): the banner it grades does not exist on main, so this cannot land before it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
The gap
DIVE-3419 (#648) gave
activity_collecta reporting contract:.partialnames every level itcould not read, and
cmd_activityprints a⚠ PARTIAL — N level(s) could not be readbanner abovethe counts, so a short trail can never be mistaken for a quiet one.
tests/usage_middle_wildcard_unit.sh(23 arms) grades that at the collector seam — the JSONfield, in python, from a fixture tree. It cannot see the presenter. The banner is bash+jq and
cmd_activitycallsrequire_root, so it was undrivable from the seat that wrote it and shippedwith no arm at all. A
.partialthat is populated correctly and never rendered is the samesilence DIVE-3419 exists to remove, and a jq typo in the banner would have been caught by nothing.
Named by the maker at delivery rather than left for a reader to find as an oversight (DIVE-3421).
What this adds
One file,
tests/activity_presenter_partial_unit.sh, 19 arms, core tier (no# TIER:marker),0.42s. It sources
src/cmd_usage.shand drives the realcmd_activitywith onlyactivity_collectstubbed —tests/usage_presenter_coverage_unit.sh(DIVE-1937) is the precedentand the shape.
require_rootis stubbed because it is the reason this seam was untested, not thesubject; stubbing it is what buys the arms any-uid coverage.
.partialfield at all: no banner, no crash, trail intact, rc=0 (grades the// []default)--json--taskTwo of those are load-bearing in a way worth naming. The stdout arm: a warning on the other
stream is gone the moment anyone pipes the trail it qualifies. The position arm: both line
numbers are required to exist, because an absent banner leaves an empty string, which bash reads
as 0 in an arithmetic test and would pass the ordering check vacuously.
Grade
uid 1015, unprivileged, same harness both sides.
Re-run the control:
The pre-banner
cmd_activityis byte-identical apart from the banner block, so the control does notmerely error out: the anchor and trail arms stay green there and only the banner arms red. A
control that dies on line one grades nothing, and 9/19 red with the anchor green is the difference.
Two mutations on the fixed tree, each reddening only its own arms — the arms are independently
graded, not co-satisfied:
(.partial // [])[0:1](first level only)named levels+level layoutred — 17/2banner positionred only — 18/1Verdict wiring:
HARNESS-RC=1whenever an arm reds (thechanged-harnessesprobe's property).shellcheck -S error— the required context — is clean; the three-S warninghits are the samethree the precedent harness carries (
SC2154/SC2164on the shared trap+cd preamble,SC2034).Siblings unmoved on this tree:
usage_presenter_coverage26/0,usage_middle_wildcard23/0,usage_coverage11/0,usage_dispatch_flag15/0,usage_enumeration_completeness9/0,heartbeat_usage_heal27/0.Not covered, named rather than hidden
activity_collect's own emission of.partialis not re-graded here — that is the collectorseam and fix(usage): the middle wildcard is a read too — usage_collect + activity_collect (DIVE-3419) #648's harness owns it. The two together close the round trip; neither alone does.
from any non-root seat, because
cmd_activitycallsrequire_rootfor real. Stubbing it buyspresenter coverage at any uid; it is not evidence that the root path resolves a real agent's home.
src/change. One CHANGELOG bullet under the existing DIVE-3419 Unreleased section.Ordering
Stacked on
dive-3419-usage-middle-wildcard(#648), and based on it here. The banner this gradesdoes not exist on
main, so this cannot land first — merged before #648 it would be 9 red armsagainst code that is not there.
5dive-clidoes not auto-deploy (deliberaterelease-cut), soneither merge is a ship.