Skip to content

fix(harness-ops): say why the inventory extraction broke in a native-drift item - #17862

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-17837-44882494290-1
Nov 21, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-17837-44882494290-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #17837

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Cause, read from the code: the drift key native-drift:inventory-broken:unknown:inventory, together with facts that carried no advisory, means inventory.py --self-check exited 1 with no integrity block. That only happens when the binary source is unavailable (pick_binary found no claude executable, or read_bundle could not read or locate the bundle). With no binary there is no cli_version (hence unknown), and a broken extraction is never copied over the previous summary (native-drift.md, Run), so every run stays without a baseline until one passes. The filed item dropped the self-check's own reason. native_drift.py summarize now keeps the inventory's integrity.problems and adds binary source unavailable: <reason>. The inventory-broken and inventory-degraded items lead their facts with those problems, and a broken item adds a line saying that a broken extraction is not kept as the baseline. Older summaries without integrity.problems still load. Running the extraction against the current Claude Code needs a host that has a native Claude Code build installed. This lane has no such build and cannot run Python, so that run is listed as remaining.

Remaining work

  • Run /harness-ops:changelog apply Phase 5 (or inventory.py --self-check, then --binary-only --docs) on a host with a native Claude Code build, so the self-check passes and its summary is copied to <memory_dir>/claude-code-changelog/native-surface-summary.json as the next run's baseline

Not verified

  • The test suite was not executed here: scripts/test_native_drift.py (native_drift.test.sh) needs a Python interpreter, which this lane does not run. It is left to the PR's CI
  • The inventory extraction was not run against the current Claude Code: this lane has no native Claude Code build and cannot run Python, so no extraction summary was written. It is listed in remaining
  • tidy: the ai-slop pass ran as a manual rubric read only, because detect.sh is not a wrapper this lane may run. Proposal not applied, since tidy changes no test: assertEqual(..., None) could be assertIsNone in test_native_drift.py
  • Untracked home-directory dotfiles at the checkout root (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) came from the runner environment, not from this change. They were left untouched

Fix

  • plugins/harness-ops/skills/changelog/scripts/native_drift.py: summarize records integrity.problems (inventory problems plus the binary-source reason when the binary is unavailable); shape_error accepts an optional string-list integrity.problems; inventory_verdict returns problems; the inventory…
  • plugins/harness-ops/skills/changelog/scripts/test_native_drift.py: tests for the binary-unavailable summary and for the broken baseline item's facts and key
  • plugins/harness-ops/skills/changelog/context/native-drift.md: the inventory-degraded/inventory-broken row says its facts lead with the extraction's problems, including why the binary source was unavailable
  • .changes/harness-ops/work-resolve-issue-issue-17837-44882494290-1-957b4601.md: patch changelog fragment for harness-ops

Verification

The runner ran each check from the base copy against 74f9241:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 12 fragments valid
  • check-changed-skills: changelog skill PASS, 0 errors, 3 pre-existing warnings (no Gotchas surface, numbered procedures without completion criteria, body length)
  • check-affected: 15 passed, 8 skipped (typos not installed, comment-hygiene fetch blocked by the network sandbox, size-check script absent, checks that run the checked tree's own code)
  • fresh-context review subagent over the whole diff: no correctness bugs; traced both new tests and the existing facts[-1] test by hand as passing; one wording point (last kept summary) applied
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44882494290

Left out: the items under Not verified.

Related

#17837

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 74f92414aba2eef9ded697c8521a0a06b0b35b59: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found.

I read all four changed files in full: the changelog fragment, native-drift.md, native_drift.py and test_native_drift.py. None of them is on a trusted path, a trust control, a merge hold or a plugin manifest.

The change carries two more pieces of text into the native-drift summary and the items filed from it:

  • the inventory's own integrity.problems strings;
  • one line, binary source unavailable: <reason>, built from the local inventory's sources.binary.error or reason.

Both values come from inventory.py running on the operator's machine. No pull request, issue or comment author supplies them, and they never reach a credentialed lane as instructions. The new shape_error check only makes summary validation stricter. It rejects an integrity.problems value that is not a string list. No token, permission, trusted actor or gate changes.

The change deletes no standing instruction. The native-drift.md edit only adds to an item's description, so the instruction-surface lens found nothing.

No spend or cost change.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 74f92414aba2eef9ded697c8521a0a06b0b35b59: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

This PR makes native_drift.py summarize keep the inventory's integrity.problems. When the inventory's sources.binary is available: false, it also adds binary source unavailable: <reason>. The inventory-broken and inventory-degraded items now put those problems first in their facts, and a broken item also says that a broken extraction is not kept as the baseline.

What I traced, by reading the code (I ran nothing):

  • Producer shape matches. inventory.py writes sources.binary as {"available": False, "reason": how} when no binary is found, {available: False, **meta} with meta["error"] when the bundle can't be read, and {available: False, error: "parser reader broken: …"} on ReaderBroken. None of these paths writes an integrity block (inventory.py#L6591-L6642). So the new error-then-reason order matches the --self-check printer (inventory.py#L6795-L6801), and the message isn't added twice.
  • Older summaries still load. shape_error checks integrity.problems with _strs, which accepts None. inventory_verdict falls back to [] when the field is missing. A summary written before this change therefore still passes the shape check and produces the same facts.
  • The new fact is accurate. The "not kept as the baseline" line matches the Run rule in native-drift.md#L62-L65: the summary is not copied over <prev> when the self-check exits 1.
  • Existing tests still hold by inspection. test_baseline_files_no_candidates_and_flags_unknown_changes still holds: its fixture has no problems, and the "no previous summary" fact is still last. The new test_a_broken_baseline_item_says_why_it_broke pins the order: problems, then the baseline line, then the unknown-changes line. The drift key native-drift:inventory-broken:unknown:inventory is unchanged, so deduplication against an already-filed item still works.
  • Version bump fits. The changelog fragment's bump: patch fits a fix that adds an optional field and changes no contract.

The author's claimed checks (changelog-fragment and changed-skill checks, a hand trace of the tests) are unverified by this lane. No Python was run here, and the PR says the test suite has not run anywhere yet, so the new tests depend on CI.

Closing issue: none. The PR body says Refs: #17837 and closes no issue, so there are no acceptance criteria to check. The PR context had no embedded instructions aimed at this lane.

Path-scoped rules that matched (cost-claims.md, ruff-pin.md, skill-bodies-state-current-rules.md) found nothing. The edited native-drift.md table row describes current behaviour.

Loosened checks: none found. The shape_error change only adds a check. Loosened checks would be marked: fail (default; the prompt had no loosened_check_verdict: / loosened_check_patterns: lines); patterns: 0. The citation requirement was not checked because the prompt had no loosened_check_decision_record: line.

Spend: none beyond this review run.

Verifier dropped 0 of 0 candidates.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path is about to arm native auto-merge at head 74f92414aba2eef9ded697c8521a0a06b0b35b59, the head its arming checks judged. The arm fails if the head moves first.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=74f92414aba2eef9ded697c8521a0a06b0b35b59 rubric=10.4.4 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit a27f66f Nov 21, 2026
49 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-17837-44882494290-1 branch November 21, 2026 08:29
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit a27f66f6e6558c791b0a70bd38d74f23afd250d1; later checks count it verified from this comment.

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.

0 participants