Skip to content

chore(comments): remove comments at the necessary posture in architecture, attribution, autonomy, bash-format, bugs - #18296

Merged
kyle-sexton merged 3 commits into
mainfrom
chore/comment-sweep-B010
Nov 23, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
chore/comment-sweep-B010

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: ADR 0110 bulk comment sweep, batch B010

Summary

This PR runs /code-tidying:remove-comments at the necessary posture over batch B010, which covers the scripts of the architecture, attribution, autonomy, bash-format and bugs plugins. ADR 0110 approved removing existing comments in bulk without asking about each one. No behavior changes.

Fix

  • 96 files touched and 4343 comment lines deleted. 27 deletions are reshape flags (a rename, extraction or test would make the comment unnecessary). No open root-cause rows.
  • Every file passes change-shape.sh as COMMENT-ONLY against HEAD.
  • Some insertions remain:
    • test fixture lines that lost a trailing # N line-number comment;
    • outside-party keeps over the 2-line budget, shortened in place in lane-stop-gate-lib.sh;
    • the check-signal-envelope.mjs traceparent note, cut to a link to the W3C spec section.
  • Kept as the floor:
    • shebangs and every shellcheck directive with its justification;
    • test-scope:, portability-ok: and silent-skip-ok: markers;
    • script exit-code lists;
    • every header block a script prints as its own --help (sed -n '2,${/^#/!q;p;}' "${BASH_SOURCE[0]}", or the awk form in lane-stop-gate-arm.sh).
  • Kept: comments inside awk or jq program strings and heredoc bodies, because removing them changes a string.
  • Lifted with the override token (an owner decision): these files are on the GLOBAL HARD path list as hook-wired scripts or hook-manager config. Each was triaged under the same floor and COMMENT-ONLY gate.
    • plugins/autonomy/hooks/lane-stop-gate.sh: 363 lines deleted.
    • plugins/bash-format/hooks/bash-format.sh: 22 lines deleted.
    • plugins/bash-format/git-hooks/lefthook-remote.yml: no comments, so unchanged.
  • Left untouched: files that fail to parse as themselves (UNPROVABLE): lane-notify.sh, sweep-ledger.sh and the two map-dependencies/dependency-graph scripts.
  • Each plugin gets one bump: none changelog fragment.

Removed-comment narrative

The removed comments recorded the following rationale. This body becomes the squash commit message, so the rationale stays in history.

architecture

  • lib/dotnet-references.sh: map-landscape's portfolio collector and map-dependencies share one reader. Two parsers would drift, and a portfolio row and a graph edge would stop describing the same file.
  • lib/{go,jvm,node,python,rust}-references.sh: the map-dependencies manifest readers. Their headers held the tab-separated record formats and listed the shapes each reader reports as unread.
    • setup.py is executable and is never run.
    • Node JSON is read by token position, so a nested pnpm.overrides.dependencies is not read as a section.
  • lib/json-escape.sh: backslash is escaped before the quote, because Windows paths are full of backslashes. The function uses parameter expansion and assigns JSON_ESC rather than printing, because a fork per field measured about 1s per field on Windows.
  • lib/github-remote.sh: the host rules.
    • Scheme and user info are stripped, and matching is case-insensitive with an optional www..
    • A numeric port is accepted only with a scheme, and scp form only without one.
    • Lookalike hosts, api.github.com, file:// and relative paths all fail.
  • lib/record-layout.sh: line-based readers need repositories and edges either empty on the key's line or opened alone, with one object per line.
  • lib/family-records.sh: evidence collectors skip family records, because a record's URLs are output, not configuration.
  • lib/likec4-golden.sh:
    • UPDATE_GOLDEN=1 rewrites the goldens.
    • LIKEC4_VALIDATE=1 runs the LikeC4 CLI, which needs network and npx.
    • Bump LIKEC4_VERSION together with the map-* skill bodies that name it.
  • scripts/build-view.mjs:
    • Usage: node build-view.mjs <kind> --record <record.json> [--from <node-id>].
    • Record values reach the page as data, never as markup.
    • --from keeps only the scalars, nodes and edges reachable from that node. Package and unresolved edges are not reachability.
    • Output goes to one deterministic, private temp directory, and nothing is written through a link.
  • co-change.mjs:
    • It reads git log --no-merges --name-only once, is read-only, and gives byte-identical output for the same history and settings.
    • Settings come from the layout object, resolved through config-cascade.mjs.
  • map-landscape/portfolio-facts.sh:
    • One cached, bounded find walk replaces thirteen separate calls, which were minutes slower on filesystems with per-open overhead.
    • Dot-directories are pruned, except the CI and container config directories.
    • A root-level manifest wins over a deeper one.
    • Owner parsing requires a host, and strips a port only when there is a scheme.
    • Top-level JSON keys are found by position.
    • A requirements filename names its own scope, matched with its separator.
  • map-landscape/reference-edges.sh:
    • Only the github.com owner is trusted for bare owner/repo tokens, and placeholder owners are skipped.
    • Test, fixture and eval files and committed output are excluded as evidence.
    • Owner and repository are compared case-insensitively with nocasematch.
    • Aliases are handed out once, in order.
  • map-landscape/landscape-record.sh:
    • A local checkout wins over fetched facts.
    • Timestamp drift never gates --check, and remote is downgraded to a note.
    • Edges are compared per type.
    • A here-string replaces printf | grep -q, because an early grep -q exit gives EPIPE under pipefail.
  • map-landscape/render-landscape.sh:
    • Aliases are deduplicated after punctuation folding.
    • Pipes are escaped without gsub replacements, because mawk and gawk disagree.
    • Quotes are replaced to stop diagram-syntax injection.
    • Archived status leads the description, and owner-first sorting keeps owners contiguous.
  • map-data/collect-data.sh: the tier-winner rules (an unreadable tier refuses the record only if it wins), the mismatch rows and the migration-replay statement list.
  • map-deployment/collect-deployment.sh: the Compose layer-merge rules, the CloudFormation, Pulumi, Helm and Bicep/ARM notes, and the ECS <name>@<service> placement rule.
  • map-containers/collect-containers.sh: the last-FROM rule, shared-infrastructure pairs and uses-edge resolution.
  • Test suites: the per-case descriptions and section dividers, including the reasons for the render-components cases.
    • An older record with no result key exits 1.
    • A quote or pipe in a name cannot break the diagram.
    • Test projects are not deployables.
    • A graph older than HEAD warns and still renders.

attribution

  • check-stamps.sh:
    • A stamp needs both a keyword and a date, and only ISO 8601 dates are parsed.
    • The trigger-less check is off by default and coarse.
    • Date arithmetic is days-from-civil, so GNU and BSD date cannot diverge.
    • may_form() separates the month May from the modal "may". A capitalized modal at the start of a sentence reads as a month.
    • The "read" keyword uses a 30-character window.
    • The windows and keyword lists are shared with extract-breadcrumbs.sh.
  • extract-breadcrumbs.sh: output is grouped per directory and --dir is non-recursive, because a neighbor's citation can name an unfenced copy's source. A fence is an HTML comment carrying a URL, closed by <!-- /provenance -->.
  • emit-findings.sh: only fingerprint-confirmed outcomes reach a findings file. Fields are joined on tabs rather than @tsv, because @tsv escapes backslashes.
  • fingerprint.mjs: quotations and fences are stripped before shingling. Verdicts are matched spans with line offsets, because whole-file containment dilutes a real 27-word match.
  • score-golden.test.sh: a golden case the run never scored is DECLINED and excluded from the tally.
  • list-corpus.sh: the repo-relative path comes from git, because Git for Windows spells one directory several ways. A leading **/ also matches the repo root.
  • retirements.yaml: the records are append-only and are demoted with status: report-only. The contract is in docs/contracts/retired-conventions/README.md.

autonomy

bash-format

  • git-hooks/shfmt-rewrite.sh:
    • shfmt runs only for files an .editorconfig shell section governs. A bare [*] does not opt a file in.
    • The subscript guard exists because shfmt turns ${m[a-b]} into a different key (Associative array key with hyphen breaks in v3.6.0 mvdan/sh#956). It compares subscript source text before and after, and fails closed.
    • The --apply-ignore support is decided by probing the flag, never inferred from a failed run.
  • git-hooks/adapters.sh: bf_lint_once lints each distinct pair of bytes and nearest .shellcheckrc once, then fans the findings out to every copy. A group that spans directories stays whole only when a probe finds it sources nothing.
  • hooks/bash-format.sh:
    • The launcher skips the script unless the payload holds a string ending in sh.
    • A file that Read named is never rewritten.
    • The Stop row exits 2 on findings and blocks at most once per turn.
    • cygpath is looked up only on Windows bash, because on WSL a miss probes every /mnt/c PATH entry over 9P.
  • hooks/bash-format.test.sh: the PostToolBatch row takes no matcher, so sh" is its only filter. A failed format run with a shfmt that knows --apply-ignore is never re-run without the flag, because that would discard the repo's ignore = true.

bugs

  • scripts/concat-gotchas.sh:
    • The script always exits 0, so a pre-compute injection cannot fail skill load.
    • A root that is $HOME, an ancestor of it, or outside a git tree has no team or personal layer.

Verification

  • Every changed file passes change-shape.sh as COMMENT-ONLY against HEAD.
  • Header blocks that scripts print as --help are byte-identical before and after, for all 11 such files.
  • One floor marker was found among the deleted lines, the # test-scope: line in extract-breadcrumbs.test.sh, and it was restored.
  • Every *.test.sh and *.test.mjs suite in the batch passes: 60 of 60, run from the worktree. Node suites ran with node --test --test-concurrency=4. After the override edits, lane-stop-gate.test.sh (134 passed), bash-format.test.sh (52 passed) and lefthook-remote.test.sh (42 passed) were rerun.
  • scripts/check-affected.sh --base origin/main ran on the first commit: 23 passed and 1 skipped.

Related

  • ADR 0110 (bulk comment sweep at the necessary posture).
  • Batch B010 of the comment sweep. Other batches ship as their own PRs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RMa43yt8jZqGJ5kzhzjRAX

kyle-sexton and others added 2 commits November 22, 2026 21:32
…ture, attribution, autonomy, bash-format, bugs

ADR 0110 bulk comment sweep, batch B010. Every changed file is
COMMENT-ONLY per change-shape.sh; the removed-comment narrative is in the
pull request body, which becomes the squash commit message.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMa43yt8jZqGJ5kzhzjRAX
… B010

Owner decision: the hook-wired scripts are in scope, triaged with the
override token. lane-stop-gate.sh and bash-format.sh are COMMENT-ONLY per
change-shape.sh; lefthook-remote.yml holds no comments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMa43yt8jZqGJ5kzhzjRAX
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 23, 2026 02:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T02:42:43.295493Z b39f4f9 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review (incremental, b39f4f9 → dced8b8)

No security issues found.

I read every hunk of both files in scope:

  • plugins/architecture/skills/improve/scripts/lens-roster.test.sh gains one comment line, # test-scope: plugins/architecture/skills/improve/SKILL.md plugins/architecture/skills/improve/actions/*.md.
  • plugins/autonomy/skills/setup/scripts/check-security-binding.escalation-stop.test.sh gains one comment line, # test-scope: plugins/autonomy/skills/setup/evals/fixtures/security-binding/probe-transcripts/ci-pool-a-l2.json.

Both are test-scope metadata comments in test scripts. They declare which files each test reads, and no executable statement changes. Neither file matches a TRUSTED PATHS glob. Neither touches a trust control (trusted-trigger check, lane token, kill switch, merge hold or .github/actions/), a standing instruction or a plugin manifest, so there are no manifest lines.

This lane already reviewed an earlier head (blocking only: yes), so this review reported only CRITICAL and IMPORTANT findings. There were none. The prior summary comment had no line anchor, and nothing in this push repeats or reopens it.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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

No findings in the incremental review of b39f4f95 → dced8b8b. This was a blocking-only review, because this lane already reviewed an earlier head.

I read every hunk of both files in scope. Each one adds a single # test-scope: header line.

  • plugins/architecture/skills/improve/scripts/lens-roster.test.sh:2 now declares plugins/architecture/skills/improve/SKILL.md and plugins/architecture/skills/improve/actions/*.md. The suite reads exactly these files: $dir/SKILL.md at lines 16 and 18, and $dir/actions/*.md at line 11.
  • plugins/autonomy/skills/setup/scripts/check-security-binding.escalation-stop.test.sh:3 now declares .../probe-transcripts/ci-pool-a-l2.json.
    • That file exists in the repository.
    • The Node suite loads evals/fixtures/security-binding/valid.json (check-security-binding.escalation-stop.test.mjs:54). That fixture references the transcript through probe_evidence (valid.json:14), so the suite does depend on it.
    • The sibling wrapper check-security-binding.admission-leaf.test.sh already carries the same declaration, so the two wrappers now match.

Neither change alters a shebang, the set options, or any test logic. The new lines sit in each file's header comment block, where the other test-scope: markers already are.

This push touches no closing-issue criteria; the PR closes no issue (it cites ADR 0110). The PR context file and the prior-findings file held no embedded instructions to the lane.

I checked this by reading the diff and the files it names. I ran nothing.

Loosened checks would be marked: fail (the prompt gave no verdict or patterns, so I used fail and no consumer entries); patterns: 0. The prompt had no loosened_check_decision_record: line, so I did not check the citation requirement. This push loosens no check.

Verifier dropped 0 of 0 candidates.

The test-selection trace (scripts/affected-tests.sh R8) found that
lens-roster.test.sh reads the improve skill's SKILL.md and actions/*.md,
and check-security-binding.escalation-stop.test.sh reads the ci-pool-a-l2
probe transcript, without either suite being selected by a change to those
files. A test-scope line in each suite declares them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMa43yt8jZqGJ5kzhzjRAX
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 3f19a00 Nov 23, 2026
84 of 85 checks passed
@kyle-sexton
kyle-sexton deleted the chore/comment-sweep-B010 branch November 23, 2026 03:53
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 23, 2026
kyle-sexton added a commit that referenced this pull request Nov 23, 2026
…B013

Deletes the prose lines left behind when sweep batches B010 (#18296) and
B013 (#18291) removed only part of a comment run, in
check-emission-conformance.mjs and Invoke-Dlss5Mod.ps1. Exit lines and
directives stay. The jq stdin note in lane-stop-gate-lib.sh stays: it records
an outside constraint, a native Windows jq cannot open an MSYS-style path.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RMa43yt8jZqGJ5kzhzjRAX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant