fix(ci): render Pages candidate summary safely (#216) - #219
Conversation
|
Post-merge #216 rework is complete at exact HEAD Blocking Human Gate defect resolved:
Preserved:
Exact-head evidence:
The previously deployed #213 candidate is stale after this fix. Once reviewed/integrated, the exact-main manual candidate Human Gate must be rerun on the new main SHA before tag creation. |
miso-develop
left a comment
There was a problem hiding this comment.
Review disposition: READY_FOR_INTEGRATION
Reviewed exact PR head 694241b5956418e55cd0f5b58ce8c4715b9c0d26 against reopened Issue #216 and the durable post-merge Human Gate finding from manual Pages candidate run 35449129354.
No blocking finding identified.
Human Gate defect resolution
The observed defect is correctly addressed.
The failed candidate summary path on merged main used Markdown backticks inside double-quoted Bash echo arguments. Bash interpreted those backticks as command substitution, which the durable Human Gate evidence confirmed with errors such as:
refs/heads/main: No such file or directory;v1.0.0: command not found.
PR #219 removes both affected shell-rendered summary blocks and replaces them with repository-owned Python rendering:
- authorization summary:
python scripts/ci_pages_summary.py candidate-authorization ... - build identity summary:
python scripts/ci_pages_summary.py candidate-build-identity ...
The identity values are passed as ordinary quoted CLI arguments. Python writes the Markdown directly to GITHUB_STEP_SUMMARY; no shell evaluates the rendered Markdown contents.
For the actual workflow path, the values are additionally constrained before/at use:
- source ref must equal exactly
refs/heads/main; - candidate SHA must match exact 40-hex syntax;
- workflow source SHA must equal freshly fetched current main;
- candidate SHA must equal that same current main;
- build commit is GitHub's source SHA;
- Product/Firmware version continues through the canonical release validation contract;
- exact-release input is constrained to
true|false.
Therefore the required source/build identity no longer passes through a shell command-substitution boundary.
Regression coverage
tests/ci_pages_summary_test.py verifies:
- exact authorization summary identity;
- exact
v1.0.0/ build-commit / non-exact candidate identity; - backticks and
$()supplied as CLI values remain inert literal data and cannot execute shell commands.
tests/ci_change_impact_test.py additionally pins workflow wiring:
- Pages must invoke both summary-helper commands;
- the Pages workflow must not contain a double-quoted
echoline with Markdown backticks.
The summary tests are wired into the unconditional required security:scan job.
Preserved manual candidate security/release contract
The fix does not weaken or reorder the manual candidate authorization gate:
workflow_dispatchonly for manual candidate;GITHUB_REF == refs/heads/main;- explicit candidate acknowledgement remains mandatory;
- exact 40-character
candidate_sharemains mandatory; origin/mainis freshly fetched;- workflow source SHA must equal fresh current main;
- candidate SHA must equal fresh current main;
- manual candidate still forces
EXACT_RELEASE=false; - tag-triggered Pages behavior is unchanged;
- production release validation remains;
- immutable ESP-IDF identity remains;
- isolated firmware build/package/image validation remains;
- same-origin firmware assets and production Web build remain;
- Pages staging artifact retains
retention-days: 1; - consumed Pages artifact is still deleted by exact artifact ID;
- Pages/OIDC authority remains confined to the Pages deploy job.
.github/workflows/release-authorized.yml is byte-for-byte unchanged from current main (blob d126d260b05c56556cb2e83017ee21086a362490).
No Product, Protocol, Storage Schema, Vault Format, crypto, Trusted Browser, Recovery, Lock, firmware-runtime, or release-authority behavior changes.
Exact-head CI
Security #951: SUCCESS.
- exact job/check context:
security:scan; tests/ci_change_impact_test.py+tests/ci_pages_summary_test.py: 18 tests passed;- existing release authorization, attestation, supply-chain, automatic-lock, snapshot-production-boundary, and repository security checks remain green;
- final repository scan: SUCCESS.
Foundation #948: SUCCESS.
- deterministic classifier: SUCCESS;
- exact PR impact: Web=true, Firmware=true, Pages=true, Shared=true,
uncertain=false; - changed-path set contains exactly the five effective PR files;
- Linux Web + production-equivalent Chrome smoke: SUCCESS;
- Windows Chrome: SUCCESS;
- Firmware: SUCCESS;
- release validation remains
M5StickS3 v1.0.0 protocol=2 storage=2 vault=1 security=encrypted-vault-ram-only-vmk/v1 eligibility=production-eligible; - isolated ESP-IDF/package validation and dependency-lock verification succeeded.
No Pages workflow run was created for this PR, as expected.
Staleness / collision / release state
- handoff HEAD matches current PR HEAD;
- PR #219 is open, non-draft, mergeable;
- current
mainremains exact PR base6f008c6864d3b080106f53d51eb7cbe1f2b4c150; - compare is 5 commits ahead / 0 behind;
- effective diff is exactly:
.github/workflows/pages.yml;.github/workflows/security.yml;scripts/ci_pages_summary.py;tests/ci_change_impact_test.py;tests/ci_pages_summary_test.py;
- PR #219 is the only open PR at final Review check;
v1.0.0tag is absent;- GitHub Release
v1.0.0is absent.
Integration / Human Gate boundary
#216 / PR #219 is ready for Integration.
The previously successful manual candidate deployment at main 6f008c6864d3b080106f53d51eb7cbe1f2b4c150 becomes stale once this fix is merged.
After Integration merges #219, control must return to #213 and the explicit Human-approved manual Pages candidate gate must be rerun against the new exact current-main SHA. That rerun must verify, from the actual hosted workflow summary/deployment evidence:
- source ref renders literally as
refs/heads/main; - source SHA, candidate SHA, and current-main SHA render fully and identically;
- Product/Firmware identity renders as
v1.0.0; - build commit renders fully;
- exact release renders
false; - candidate build/deploy succeeds;
- staging artifact is deleted by exact ID;
- hosted candidate remains non-exact/pre-release.
Protected v1.0.0 creation must remain blocked until that fresh exact-main Human Gate passes.
No additional Security-role review is required for this narrow summary-rendering correction; the required Security workflow is green and no security/release authority was expanded.
READY_TO_MERGEHEAD: Integration reconstruction:
STATE: READY_TO_MERGE |
INTEGRATEDPR: #219 Pre-merge evidence:
Post-merge evidence on exact merged main:
The earlier manual candidate on STATE: INTEGRATED |
Rework for #216 after post-merge Human Gate finding.
Problem
Manual Pages candidate run 35449129354 deployed the correct exact-main candidate, but
.github/workflows/pages.ymlrendered Markdown backticks inside double-quoted Bashechostrings. Bash treated those backticks as command substitution, corrupting the required source/build identity summary.Fix
scripts/ci_pages_summary.pysecurity:scansuiteechocannot regressRegression
tests/ci_pages_summary_test.pyverifies:$()supplied as values remain literal text and cannot execute shell commandstests/ci_change_impact_test.pyverifies Pages uses the helper and contains no unsafe double-quoted backtick echo.Scope boundary
No change to:
candidate_sha40-hex requirementM5AUTH_EXACT_RELEASE=falsefor manual candidateBecause this fix changes main after merge, the prior #213 manual candidate becomes stale. After this PR is reviewed and integrated, #213 must rerun the exact-main manual Pages candidate Human Gate on the new main SHA.
Exact-head verification
HEAD:
694241b5956418e55cd0f5b58ce8c4715b9c0d26security:scan15368tests/ci_change_impact_test.py+tests/ci_pages_summary_test.py: 18 tests passed6f008c6864d3b080106f53d51eb7cbe1f2b4c150.github/workflows/pages.yml.github/workflows/security.ymlscripts/ci_pages_summary.pytests/ci_change_impact_test.pytests/ci_pages_summary_test.pyecholine with Markdown backticksv1.0.0tag: absentv1.0.0GitHub Release: absentPost-integration requirement
The previous manual candidate run is stale once this fix reaches main. After independent Review and Integration, #213 must run the exact-main manual Pages candidate Human Gate again against the new current-main SHA and verify the corrected summary identity before protected
v1.0.0creation.