Skip to content

refactor(lib): simplify context-zone.sh and docs-cache.sh - #14382

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14328-42569994818-1
Nov 9, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14328-42569994818-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14328

Summary

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

Simplified two of the three listed shared lib sources without changing behavior. context-zone.sh's jq pass now ranks each shape 0/1/2 and takes the max to pick the worse zone, in place of mapping zone names to numbers and back, and its comments lose duplicated and history-narrating passages. docs-cache.sh gains a dc_skip_bad helper that replaces two identical bad-file warning loops, dc_utc picks its format once, and the env-var name in dc_config is built in one line. docs-fetcher-gate.mjs was reviewed against the four /simplify checks and left unchanged: no simplification was found that keeps its exported names and deny messages byte-identical. Shared copies were regenerated with scripts/sync-shared-copies.sh, and each carrying plugin got a patch changelog fragment.

Not verified

  • context-zone.test.sh and docs-cache.test.sh were not executed: this lane runs no interpreter or test runner; left to the PR's CI
  • ci-status green: a PR CI check, left to the PR's CI
  • tidy skipped: the change touches lib/, a listed shared path, so it is not tidied
  • lib/docs-fetcher-gate.mjs left unchanged after review: no simplification found that keeps behavior byte-identical
  • build/lint of touched shell files (shellcheck, shfmt) not run locally: no such tool runs in this lane; CI runs them

Fix

  • lib/context-zone.sh: band() renamed rank() and returns 0/1/2; the final combination is max as $worst | \["smart","acceptable","dumb"\]\[$worst\]; duplicated and history-only comments shortened
  • lib/docs-cache.sh: new dc_skip_bad helper used by dc_summaries and dc_notes; dc_utc selects its format string once; dc_config builds the DOCS_CACHE_* name in one line
  • plugins/context-guard/scripts/context-zone.sh, plugins/plugin-quality/scripts/context-zone.sh: regenerated shared copies
  • plugins/{attribution,discipline,discovery,harness-config,harness-memory,harness-ops,instruction-placement,knowledge,multi-agent,performance,planning,playbooks,plugin-quality,session-flow}/scripts/docs-cache.sh: regenerated shared copies
  • .changes/{context-guard,plugin-quality,harness-config,harness-ops,discovery,discipline,harness-memory,instruction-placement,knowledge,attribution,performance,planning,playbooks,session-flow,multi-agent}/work-resolve-issue-issue-14328-*.md: patch fragments (### Changed) for each plugin carrying a…

Verification

The runner ran each check from the base copy against b83a844:

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

The run reports:

  • sync-shared-copies: regenerated 16 copies; sync-shared-copies --check: all 767 registered copies match their canonical sources
  • check-changelog-fragments: all 19 fragments valid
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 13 passed, 6 skipped (ruff no .py, typos not installed, three validate-plugins sub-checks that run checked-tree code, changed-skills none)
  • fresh-context review subagent (read-only) of the lib diff: no behavior change found; confirmed same zone word in every case, byte-identical warning text and return statuses for dc_skip_bad, identical dc_utc output, same DOCS_CACHE_* names, unchanged xtrace process counts that context-zone.test.sh…
  • diff size: 2 hand-edited files, 132 changed lines (generated copies and fragments not counted)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42569994818

Left out: the items under Not verified.

Related

#14328

Merge-Risk: max=MEDIUM demote=false head=ad3b3ff82bc179a0f4c57e73373873d651597928 rubric=8.1.2 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on b83a844ff4aacc90cf9f8b25491539ea744d0646; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread lib/docs-cache.sh Resolved
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, blocking only): b83a844f → ad3b3ff8

This lane reviewed an earlier head, so this pass reports blocking findings only. The push changed one file, lib/docs-cache.test.sh, and I read both of its hunks.

What changed: the two malformed-file asserts at lib/docs-cache.test.sh:707 and :717 used to match only ^WARNING: .*<path>. Each now matches the full warning text, anchored at the end of the line:

  • ^WARNING: docs-cache: skipped a note file that is not one JSON note: .*notes/<prefix>/0000000000000000$
  • ^WARNING: docs-cache: skipped a summary file that is not one JSON summary: .*summaries/<prefix>/0000000000000000$

Checked against the code:

  • The patterns match what lib/docs-cache.sh:775 prints: printf 'WARNING: docs-cache: skipped a %s file that is not one JSON %s: %s\n'.
  • The call sites pass the right word: dc_skip_bad summary at :788 and dc_skip_bad note at :838. The tests now fail if those two arguments are swapped, which was the gap my earlier advisory finding (refactor(lib): simplify context-zone.sh and docs-cache.sh #14382 (comment)) described. That finding is resolved.
  • The trailing $ inside the double-quoted grep pattern stays a literal end-of-line anchor. The printed path ends with the file name, so the anchor matches.

I ran nothing: this comes from reading the diff and the source. Whether the tests pass in CI was not checked here.

No new findings. No manifest changes, nothing that spends money, and no embedded instructions in the inputs.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #14382, incremental since b83a844f

I found no security issues in this push. This round only reported blocking findings because the prior-findings file says this lane already reviewed an earlier head (blocking only: yes).

What I read. The incremental scope lists one file, lib/docs-cache.test.sh, and I read both of its hunks. It does not match any TRUSTED PATHS glob.

What changed. Two grep -c assertions in the malformed-note and malformed-summary edge tests were tightened:

  • Before, each looked for ^WARNING: .*<path>.
  • Now each must match the full warning text docs-cache: skipped a … file that is not one JSON …:, with an end anchor ($).

These are test assertions only:

  • They feed nothing into a process, the network, a token or a hold.
  • They are not a standing instruction, a trust control, a merge hold or a plugin manifest.
  • They add no new input path. The ${KEY:0:16} value they use is set by the test itself.

Prior findings. The one earlier entry is this lane's clean summary for b83a844f, which had 0 findings. There is nothing to restate.

PR context. It contains no embedded instructions aimed at this lane.

Spend: none.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head b83a844ff4aacc90cf9f8b25491539ea744d0646. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM61JvIb
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on ad3b3ff.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head ad3b3ff82bc179a0f4c57e73373873d651597928, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for ad3b3ff

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14382-ad3b3ff82bc179a0f4c57e73373873d651597928, expires on 2026-12-09.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 5137d2e Nov 9, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14328-42569994818-1 branch November 9, 2026 07:16
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 5137d2ee148b67cbe3bc4258638ecd53d83e5384; 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.

Simplify the context-zone.sh, docs-cache.sh and docs-fetcher-gate.mjs shared lib sources

0 participants