Skip to content

chore(governance): seed governance and template files, hardened - #237

Merged
claude[bot] merged 5 commits into
mainfrom
chore/seed-governance-templates-hardened
Aug 24, 2026
Merged

chore(governance): seed governance and template files, hardened#237
claude[bot] merged 5 commits into
mainfrom
chore/seed-governance-templates-hardened

Conversation

@claude

@claude claude Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Problem

Two problems, one structural and one that this PR previously got wrong.

1. The org auto-seed PR (#233) cannot hold a fix. Its branch is regenerated by
the seeding automation every 20–40 minutes; remediation commits pushed there were
discarded within minutes by an identical fresh seed. Its payload also fails as
generated: PR size, Pre-commit (trailing whitespace in CODE_OF_CONDUCT.md), and
Scorecard/Sonar on governance.yml.

2. This PR's first attempt at the Scorecard/Sonar fix was itself broken. It
pinned both reusable-workflow callees to 7ed3ab8650583f6659a6caf061eae77dbd3ed1be.
That is the annotated tag object for v1, not a commit — GitHub's commits API
rejects it outright:

$ gh api repos/Quantum-L9/.github/commits/7ed3ab8650583f6659a6caf061eae77dbd3ed1be
No commit found for SHA: 7ed3ab8650583f6659a6caf061eae77dbd3ed1be (HTTP 422)

So the Governance workflow failed before creating any jobconclusion: failure
with total_count: 0, and the run labelled by its raw path instead of
name: Governance, because the file never parsed that far. That failure emits no
check-runs, which is why a check-runs-only query showed this PR as green when it
was not.

Fix

git ls-remote refs/tags/v1 returns the tag object; refs/tags/v1^{} returns the
commit it peels to. Both are recorded now, and uses: references the commit:

tag object SHA : 7ed3ab8650583f6659a6caf061eae77dbd3ed1be   refs/tags/v1
peeled commit  : 3e841ea4f7f8be2a8c9fc45cad5bed46fe801d08   refs/tags/v1^{}

Verified at the peeled commit: it resolves as a real commit object
(feat(governance): deploy advisory defaults v3.1 (#18), 2026-07-29), and both
governance-pr.yml and governance-issue.yml exist there, each exposing
on: workflow_call. Not a revert to a floating @v1. The header comment now
records the two SHAs as distinct identities and points the preflight at
refs/tags/v1^{}, so a re-seed cannot repeat the mistake.

Otherwise this PR is the 14 governance/template/community files of the org seed,
with the fixes the seeder's own payload lacks: CODE_OF_CONDUCT.md trailing
whitespace repaired, and governance.yml given a top-level
permissions: contents: read. Job-level permissions, the absence of
secrets: inherit, and the event triggers are unchanged.

Evidence

Governance now starts and executes, on head 0cce42b:

run 32678432319  .github/workflows/governance.yml  conclusion: success
  total_jobs: 2
    pr / gates -> success (3 steps)
    issue      -> skipped (0 steps)   # correct: this is a pull_request event

Job count is the point: 2, not 0. Prior runs on bf635a5 were
failure / total_count: 0.

All other material workflows on this head are success: PR Review Enforcement,
Supply Chain Security, CodeQL Analysis, Architecture Compliance Check, L9 Lint and
Test, L9 Audit Harness, Contract Enforcement, Docker Build & Push, Terminology
Guard, Release Drafter, Code Quality.

Not green, stated plainly: L9 Analysis is startup_failure. That is a
repository-wide pre-existing condition, not caused by this diff — it reproduces on
main at the base SHA and on unrelated branches (every one of the last 12 runs of
that workflow). It is recorded, not claimed as passing.

Relationship to the other PRs

#234 (38bc671) and #236 (9936954) are merged; main is at 9936954. #236
carried the 4 lint/test toolchain files with hardened installs. This PR carries the
remaining 14 — the two file sets are disjoint. Once this lands, all 18 seed
destinations exist on main and the missing-only seeder has nothing left to
propose, which is why #233 becomes closable rather than mergeable.

Risk

Low — templates, community files, and one workflow caller. No runtime code, no
tests. Rollback: revert.

One trade, flagged: SHA-pinning governance.yml means future governance releases
no longer propagate by moving the v1 tag; a re-seed must bump the pinned commit
(preflight retained in the file). That matches this repo's full-SHA-pin convention
but diverges from the org pack's tag-motion design. If the pack should stay
tag-pinned, that decision belongs upstream in Quantum-L9/.github.

History note

This branch preserves the seed commit (ea4cfb3, from the seeding flow) plus the
remediation commits, merged with current main. No history rewritten, no force
push.


Generated by Claude Code

cryptoxdog and others added 3 commits August 23, 2026 19:15
Remediates three failure classes on this PR without changing what the seed
delivers:

- CODE_OF_CONDUCT.md: the four enforcement entries used two-space markdown
  hard breaks, which the trailing-whitespace pre-commit hook strips in CI
  (the "Pre-commit Hooks" / "CI Gate" failure). They are now separate
  paragraphs with no trailing whitespace, rendering the same.

- .github/workflows/governance.yml: added a top-level `permissions:
  contents: read` block (Scorecard Token-Permissions: "no topLevel
  permission defined") and pinned both reusable-workflow callees to the
  commit SHA the v1 tag points at — 7ed3ab86, verified against the file's
  own preflight (`git ls-remote ... refs/tags/v1`) before pinning (Sonar
  S7637 x2, Scorecard Pinned-Dependencies). The header comment now
  describes SHA-bump-on-reseed instead of tag motion, and keeps the pin
  record and preflight.

- .github/workflows/l9-lint-test-node.yml: installs now require a lockfile
  (no floating `npm install`/`pnpm install`/`yarn install` fallback) and
  run with --ignore-scripts, and the tsc step uses `npx --no-install` so
  it can only run the lockfile-resolved local compiler (Sonar S6505 x12,
  S8543 x3; Scorecard Pinned-Dependencies npmCommand findings). On this
  Python-only repo both Node jobs are skipped by the detect-node guard;
  the hardened defaults bind future Node consumers, which can relax
  per-repo where dependencies genuinely need install-time scripts.
The PR-size gate blocks at 1000 reviewable added lines and this seed
carried 1213; the gate's required action is to split. The four lint/test
toolchain files (biome.json, .biomeignore, .vscode/extensions.json,
.github/workflows/l9-lint-test-node.yml — ~383 lines) move to a sibling
PR based on main, leaving this PR the governance, template, and community
files at ~830 added lines. Nothing is dropped: the toolchain files land
via the follow-up PR with the security hardening from the previous commit
already applied.
@claude
claude Bot requested a review from cryptoxdog as a code owner August 23, 2026 23:39
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

⚠️ Large PR Warning
Reviewable lines changed: 844
Warning threshold: 300 lines
Consider splitting for easier review

📋 Best Practices for Large Changes

  1. Refactoring + Features: Separate into 2 PRs
  2. Multiple Features: One PR per feature
  3. Database + Code: Separate migration from logic
  4. Generated Code: Exclude it from reviewable-size accounting

This PR passes the blocking limit but is larger than recommended.

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

L9 Audit Harness Report

  • Generated: 2026-08-24T01:01:00.415448+00:00
  • Repo root: /home/runner/work/Cognitive.Engine.Graphs/Cognitive.Engine.Graphs
  • Overall result: ✅ PASSED
  • Exit code: 0

Step Results

Step Status Exit Code Notes
Architecture Audit ✅ Passed 0
Spec Coverage ✅ Passed 0
Contract Wiring ✅ Passed 0

Architecture Audit Findings

Severity Count
🔴 CRITICAL 0
🟠 HIGH 0
🟡 MEDIUM 15
🔵 LOW 0

See artifacts/audit_report.md for full details.

Spec Coverage

  • ✅ Implemented: 37
  • ⚠️ Partial: 9
  • ❌ Missing: 0
  • Total features: 46
Category Implemented Partial Missing Total
gates 10 0 0 10
scoring 7 0 0 7
v1.1_node 2 0 0 2
v1.1_edge 2 0 0 2
v1.1_action 0 2 0 2
v1.1_scoring 1 1 0 2
action_handler 0 6 0 6
gds_algorithm 5 0 0 5
research_pattern 10 0 0 10

See artifacts/coverage_report.md for full details.

Next Steps

All checks passed. Safe to merge.

claude Bot added 2 commits August 24, 2026 00:59
The previous pin used 7ed3ab8650583f6659a6caf061eae77dbd3ed1be, which is the
ANNOTATED TAG OBJECT for v1 — not a commit. GitHub's commits API rejects it
("No commit found for SHA"), so both Governance runs on this branch failed
before any job was created: conclusion=failure with total_count=0 jobs, and the
run labelled by its raw path rather than `name: Governance`, because the file
never parsed that far.

`git ls-remote refs/tags/v1` returns the tag object; `refs/tags/v1^{}` returns
the commit it peels to. Both callees now reference the peeled commit
3e841ea4f7f8be2a8c9fc45cad5bed46fe801d08 ("feat(governance): deploy advisory
defaults v3.1 (#18)"), verified as a real commit object, with
governance-pr.yml and governance-issue.yml both present there and both exposing
`on: workflow_call`.

The header comment now records the two SHAs as distinct identities and points
the preflight at the peeled ref, so a future re-seed cannot repeat the mistake.

No behavior change beyond making the caller resolvable: top-level
`permissions: contents: read`, both job-level permission blocks, the absence of
`secrets: inherit`, and the event triggers are all unchanged. This is not a
revert to a floating `@v1`.
@sonarqubecloud

Copy link
Copy Markdown

@claude
claude Bot merged commit 614c08b into main Aug 24, 2026
56 checks passed
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.

1 participant