Skip to content

refactor(architecture): simplify map-deployment readers and renderer - #14809

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14408-42648158481-1
Nov 9, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14408

Summary

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

Behavior-preserving simplification of the five map-deployment scripts: render-deployment.sh drops the always-equal target variable and gains calias()/nalias() helpers that replace eleven repeated alias("c"|"n"|"cn", ..., jget(...)) expressions; terraform-reader.awk and yaml-rows.awk drop unused locals (rest, key, bi, n) and the ok/sec temporaries in resolve() and the container param calls; pulumi-reader.awk lowercases the ECS type once; deployment-diff.awk names its two presence tests and reflows its header comment. Choices were limited to within-file changes because the issue puts cross-file dedup (the duplicated node/param/place/add_env helpers in terraform-reader.awk and yaml-rows.awk) out of scope, and the replica_of read-creates-element quirk in container_diffs was left exactly as is to keep the output unchanged.

Not verified

  • collect-deployment.test.sh (covers render-deployment.sh and the readers) was not run: this lane cannot execute bash test suites or awk; left to the PR's CI
  • shellcheck/lint of render-deployment.sh not run here (no linter wrapper available); left to the PR's CI
  • ci-status green on the PR is a PR check, left to CI
  • tidy: passes 1-3 ran with no further edits; passes 4-5 (markdown) skipped because the fragment's only line is fixed verbatim by the issue's acceptance criterion

Fix

  • plugins/architecture/skills/map-deployment/scripts/render-deployment.sh: removed the target variable (always equal to md); added calias(p) and nalias(prefix, n) awk helpers and used them at every container and node alias site in the c4-plantuml and likec4 branches
  • plugins/architecture/skills/map-deployment/scripts/terraform-reader.awk: dropped unused locals (tokenize rest, resolve_var key), replaced the ok flag in resolve() with an early return, passed RES_SEC straight to param() in container(), fixed pk = spacing
  • plugins/architecture/skills/map-deployment/scripts/yaml-rows.awk: removed the dead bi/n locals in block_scalar(), merged the two bad-key checks in parse_map(), passed RES_SEC straight to param() in ecs_container()
  • plugins/architecture/skills/map-deployment/scripts/pulumi-reader.awk: collect_res() lowercases the ECS type segment once instead of three times
  • plugins/architecture/skills/map-deployment/scripts/deployment-diff.awk: container_diffs() names the two presence tests ia/ib; reflowed the header comment
  • .changes/architecture/work-resolve-issue-issue-14408-42648158481-1-35214039.md: patch fragment, ### Changed, Internal simplification, no behavior change.

Verification

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

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

The run reports:

Left out: the items under Not verified.

Related

#14408

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

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

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14809, map-deployment simplification

I found no security issues.

I read every hunk of all 6 changed files. None of them matches a trusted path, and the diff touches no trust control, plugin manifest or standing instruction.

The only security-relevant surface is the secret-redaction data flow, and the change keeps it intact:

  • terraform-reader.awk resolve(): the new early return sets RES_SEC = sec and then calls unresolved(v). unresolved(v) sets only RES_OK = 0. The removed ok flag path ended in the same state, so a secret flag picked up in a nested ${...} still carries through when resolution fails.
  • terraform-reader.awk container() and yaml-rows.awk ecs_container(): these now pass RES_SEC straight to param(). The value is read when the call is made, after the get() on the line before. That is the same value the removed sec temporary held, so secret parameters are still flagged.
  • render-deployment.sh:
    • calias(p) and nalias(prefix, n) read the same held["placements", p] and held["nodes", n] entries the replaced inline expressions read. They still go through alias(), which cleans names with redact_secret_value and sanitises them to [A-Za-z0-9_].
    • No function with either name exists elsewhere in the plugin, so they cannot clash with the redaction awk loaded alongside them.
    • Dropping target is safe: it was always set to $md, so the now-unconditional rm -f "$md" deletes the same file as before.
    • The heredoc's awk program keeps its single-quote escaping.
  • pulumi-reader.awk and deployment-diff.awk: these are logic-equivalent refactors with no trust-boundary effect.
  • .changes/ fragment: text only.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

This is a full review: no earlier head had been reviewed, so the review was not blocking only. I read every hunk of all 6 changed files. The PR simplifies five map-deployment scripts and adds a changelog fragment. I checked each hunk against the closing issue #14408's rule that behavior must not change. I read the head files but did not run any awk, bash or test suite, so the results below come from reading the code only.

  • deployment-diff.awk: The new ia/ib locals are declared in container_diffs. ia = (a SUBSEP c) in image parses as an assignment of the in test. An in test never creates an array element, and the image comparison still runs only when both are present. Behavior is the same.
  • pulumi-reader.awk: Lowercasing once and then mapping gives the same result as before: cluster→cluster, taskdefinition→taskdef, service→service, anything else→"".
  • render-deployment.sh:
    • calias(p) and nalias(prefix, n): Every call site passes a p or n whose pit/item is held["placements", p] or held["nodes", n]. That includes the networks loop at L324-330 and the likec4 model loop at L344-347. Neither name is defined in redact-connection.awk, and neither body contains a single quote that would break the shell quoting.
    • Removing target: It was always equal to md, so rm -f "$md" keeps the same failure-path behavior.
  • terraform-reader.awk: The removed locals (rest in tokenize, key in resolve_var, sec in container) are not used anywhere in those functions, so none of them silently becomes a global. In resolve(), the early return sets RES_SEC = sec and returns unresolved(v), which sets RES_OK = 0. That gives the same state as the old ok/break path. Passing RES_SEC straight to param() reads it at the same point as before.
  • yaml-rows.awk: Neither bi nor n was read in block_scalar. The merged parse_map check is the same OR of the old checks. The secrets loop in ecs_container still passes a literal 1, and nothing else used sec there.
  • Changelog fragment: It has bump: patch, ### Changed and "Internal simplification, no behavior change.", as the issue's criterion requires.

Acceptance criteria for #14408:

  • Behavior unchanged: met by reading. The existing collect-deployment.test.sh covers the renderer and the readers. The PR body says it was not run locally, so that is unverified and left to CI.
  • Only listed files plus a fragment: met.
  • Size limits: met, at about 100 changed lines and 5 files.
  • Fragment: met.
  • ci-status green: left to CI.

There were no prior or settled threads to apply, and no embedded instructions in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for a0dd652

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-14809-a0dd6520895d259d6dac916aa2391b3e86d59466, 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 52c7ab4 Nov 9, 2026
50 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14408-42648158481-1 branch November 9, 2026 19:01
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 map-deployment architecture plugin code (2 of 2)

0 participants