Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
71ba4ae
docs(standards): add organization health defaults
scttbnsn Aug 13, 2026
22feaaa
ci(greptile): require manual review requests (#11)
scttbnsn Aug 14, 2026
932eb95
chore(sync): reconcile main before promotion
scttbnsn Aug 14, 2026
bc5ab59
ci(workflows): add reusable CI foundation (#13)
scttbnsn Aug 14, 2026
5ee1885
chore(sync): reconcile main before promotion
scttbnsn Aug 14, 2026
16a6680
feat(quality): standardize long-run reporting (#15)
scttbnsn Aug 14, 2026
cd3c68f
chore(sync): reconcile main before promotion
scttbnsn Aug 14, 2026
99a7a99
fix(quality): enforce report contract boundaries
scttbnsn Aug 14, 2026
9a5362a
fix(quality): decode reports as utf-8
scttbnsn Aug 14, 2026
a39c5bd
test(quality): pin fixture encoding
scttbnsn Aug 14, 2026
7be30f3
ci(profile): make asset generation read-only (#10)
scttbnsn Aug 14, 2026
55c58e8
ci(review): add deduplicated Greptile summon (#9)
scttbnsn Aug 14, 2026
e30a84d
chore(sync): reconcile main before promotion
scttbnsn Aug 14, 2026
6e7a78d
ci(workflows): add run-test and run-lint toggles to go-ci (#19)
scttbnsn Aug 16, 2026
f347593
chore(sync): reconcile main before promotion
scttbnsn Aug 16, 2026
04ad251
ci(workflows): add module-directory input to node-ci (#22)
scttbnsn Aug 16, 2026
67d152a
chore(sync): reconcile main before promotion
scttbnsn Aug 16, 2026
7f9be8b
docs(onboarding): record the qlty alignment baseline (#24)
scttbnsn Aug 16, 2026
922de8f
chore(sync): reconcile main before promotion
scttbnsn Aug 16, 2026
f4c1d50
docs(onboarding): align with the codified standards registry (#26)
scttbnsn Aug 16, 2026
e211199
chore(sync): reconcile main before promotion
scttbnsn Aug 16, 2026
5ac2e3f
chore(repo): meet our own onboarding checklist (#28)
scttbnsn Aug 16, 2026
5bc5208
chore(sync): reconcile main before promotion
scttbnsn Aug 16, 2026
30d6b13
docs(community): org-default code of conduct + community checklist (#30)
scttbnsn Aug 17, 2026
3e80630
chore(sync): reconcile main before promotion
scttbnsn Aug 17, 2026
dd74a99
feat(workflows): add the shared star-chart refresh reusable workflow …
scttbnsn Aug 20, 2026
82f48ca
chore(sync): reconcile main before promotion
scttbnsn Aug 20, 2026
79801af
Main-is-released check, and the codified star-chart shape (#34)
scttbnsn Aug 21, 2026
e2c03ba
chore(sync): reconcile main before promotion
scttbnsn Aug 21, 2026
58c1fd4
fix(workflows): close three shared-workflow defects (#36)
scttbnsn Aug 21, 2026
22d2706
chore(sync): reconcile main before promotion
scttbnsn Aug 21, 2026
0dd3d77
chore: gitignore .claude/ so a nested worktree can't be staged as a g…
scttbnsn Aug 27, 2026
54f1b86
fix(starchart): the documented dispatch step needs actions:write (#39)
scttbnsn Aug 27, 2026
0151d3e
chore(renovate): tidy go.sum after a gomod update (#40)
scttbnsn Aug 27, 2026
759794f
chore(sync): reconcile main before promotion
scttbnsn Aug 27, 2026
eb74985
chore(renovate): move the vite ecosystem as one group (#42)
scttbnsn Aug 27, 2026
d2120bc
chore(sync): reconcile main before promotion
scttbnsn Aug 27, 2026
eddc1af
chore(renovate): scope Portwing lock maintenance exception (#44)
scttbnsn Aug 30, 2026
5d4b724
chore(sync): reconcile main before promotion
scttbnsn Aug 30, 2026
d0f3e5b
fix(renovate): scope lock maintenance to npm
scttbnsn Aug 30, 2026
0aa77c2
docs(onboarding): add the .planning/ gitignore checkbox (#46)
scttbnsn Sep 7, 2026
495a52a
chore(sync): reconcile main before promotion
scttbnsn Sep 7, 2026
49a5982
fix(quality): isolate validation and pace hosted work (#48)
scttbnsn Oct 25, 2026
6bc2e35
chore(sync): reconcile main before promotion
scttbnsn Oct 25, 2026
2684d4d
chore(renovate): target dev/repository-standards (#50)
scttbnsn Oct 26, 2026
488b322
docs(onboarding): align checklist with contextual guidance (#51)
scttbnsn Oct 26, 2026
aa8c2ad
chore(sync): reconcile main before promotion
scttbnsn Oct 26, 2026
9d54f49
chore(deps): update non-major (github-actions) (#53)
renovate[bot] Oct 26, 2026
5d28948
chore(sync): reconcile main before promotion
scttbnsn Oct 26, 2026
4d3b129
chore(deps): update dependency ubuntu to v26 (#55)
renovate[bot] Oct 26, 2026
7a6fcc5
chore(sync): reconcile main before promotion
scttbnsn Oct 26, 2026
5d1b581
fix(ci): update harden-runner for hosted runner DNS fix (#57)
scttbnsn Oct 31, 2026
5814a72
chore(sync): reconcile main before promotion
scttbnsn Oct 31, 2026
96a6074
docs(profile): add CodesWhat brand line and site link (#58)
scttbnsn Oct 31, 2026
605e352
chore(sync): reconcile main before profile promotion
scttbnsn Oct 31, 2026
eaa21cc
chore(deps): update non-major (github-actions) (#61)
renovate[bot] Nov 17, 2026
22b874d
chore(sync): reconcile main before promotion
scttbnsn Nov 17, 2026
0df1d2e
fix(quality-report): harden aggregation and wire-check contract tests…
scttbnsn Nov 18, 2026
b6f91ce
chore(sync): reconcile main before promotion
scttbnsn Nov 18, 2026
355fbd1
fix(ci): namespace artifact names and page release-gate runs (#65)
scttbnsn Nov 18, 2026
d4b9059
chore(sync): reconcile main before promotion
scttbnsn Nov 18, 2026
e70acea
chore(deps): update dependency node to v26 (#67)
renovate[bot] Nov 21, 2026
4893d88
chore(sync): reconcile main before promotion
scttbnsn Nov 21, 2026
9890471
feat(actions): add shared changes-gate composite action (#70)
scttbnsn Nov 22, 2026
8d7814b
feat(ci): default node-ci to Node 26 (#69)
scttbnsn Nov 22, 2026
4d1c911
chore(sync): reconcile main before promotion
scttbnsn Nov 22, 2026
27ffcbe
feat(actions): add tree-receipt verify and record actions (#73)
scttbnsn Nov 23, 2026
f9729f5
fix(changes-gate): fail open on gate failure, harden matching and fet…
scttbnsn Nov 24, 2026
84880e6
fix(tree-receipt): bind receipts to verified push-run evidence (#75)
scttbnsn Nov 24, 2026
56c0468
chore(sync): reconcile main before promotion
scttbnsn Nov 24, 2026
fbeed2e
chore(quality): add local qlty config and pre-push check (#77)
scttbnsn Nov 24, 2026
ced8418
chore(sync): reconcile main before promotion
scttbnsn Nov 24, 2026
5a77e4e
chore(deps): update non-major (github-actions) (#72)
renovate[bot] Nov 24, 2026
8dae5cd
chore(sync): reconcile main before promotion
scttbnsn Nov 24, 2026
bf97f1a
fix: land the 2026-11-26 audit fixes (#80)
scttbnsn Nov 26, 2026
7d59554
chore(sync): reconcile main before promotion
scttbnsn Nov 26, 2026
aa97ef5
docs(agents): check dev for high code scanning alerts before promotin…
scttbnsn Nov 26, 2026
9dcd1b7
chore(sync): reconcile main before promotion
scttbnsn Nov 26, 2026
8bc736c
feat(quality-report): match artifact patterns like minimatch, extglob…
scttbnsn Nov 27, 2026
daebc53
chore(sync): reconcile main before promotion
scttbnsn Nov 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 154 additions & 5 deletions .github/tests/quality_report_contract_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import subprocess
import sys
import tempfile
import time
import unittest
from unittest import mock

Expand Down Expand Up @@ -176,13 +177,161 @@ def test_selector_expands_brace_alternatives_like_download_artifact(self):

self.assertEqual([1, 2], ids)

def test_selector_rejects_extglob_patterns(self):
with self.assertRaises(SELECTOR_MODULE["SelectionError"]) as caught:
def test_selector_selects_extglob_alternatives(self):
ids, _ = self.select(
[
self.artifact(1, "2026-08-13T12:01:00Z", name="quality-result-auth"),
self.artifact(2, "2026-08-13T12:01:00Z", name="quality-result-stats"),
self.artifact(3, "2026-08-13T12:01:00Z", name="quality-result-other"),
],
pattern="quality-result-@(auth|stats)",
)

self.assertEqual([1, 2], ids)

def test_matches_agrees_with_minimatch_defaults(self):
# Each row was checked against minimatch 10 with default options, the
# matcher actions/download-artifact applies to its pattern input.
rows = [
("quality-result-*", "quality-result-auth", True),
("quality-result-*", "quality-result-", True),
("quality-result-*", "quality-report-auth", False),
("quality-result-{auth,stats}", "quality-result-stats", True),
("quality-result-{auth,stats}", "quality-result-other", False),
("result-{1..3}", "result-2", True),
("result-{1..3}", "result-4", False),
("{a,{b,c}}", "c", True),
("a{b", "a{b", True),
("quality-result-@(auth|stats)", "quality-result-auth", True),
("quality-result-@(auth|stats)", "quality-result-other", False),
("@(a|b)c", "bc", True),
("@(a|b)c", "abc", False),
("?(a|b)c", "c", True),
("?(a|b)c", "abc", False),
("+(x)", "xxx", True),
("+(x)", "", False),
("*(a|b)c", "ababc", True),
("*(a|b)c", "abcd", False),
("target-result-!(windows)-*", "target-result-linux-x64", True),
("target-result-!(windows)-*", "target-result-windows-x64", False),
# a leading ! negates the whole pattern, so !(...) at the start is
# not an extglob: it negates the literal "(auth)*"
("!(auth)*", "stats", True),
("!(auth)*", "authz", True),
("!(a)", "a", True),
("!!(a)", "(a)", True),
("!a", "b", True),
("!a", "a", False),
("!!a", "a", True),
("#a", "#a", False),
("", "", True),
("", "a", False),
("*", ".hidden", False),
("*", "visible", True),
(".*", ".hidden", True),
("?", ".", False),
("[a-c]x", "bx", True),
("[a-c]x", ".x", False),
("@(.a|b)", ".a", True),
("*(a|b)", ".a", False),
("+(*|.a)", ".a", True),
("[abc]", "b", True),
("[a-c]", "d", False),
("[!a]", "b", True),
("[^a]", "a", False),
("[a", "[a", True),
("[]a]", "]", True),
("[[:alpha:]]", "q", True),
("[[:alpha:]]", "7", False),
("[[:digit:]]x", "7x", True),
("a\\*", "a*", True),
("a\\*", "ab", False),
("@(a|b", "@(a|b", True),
("@()", "@()", True),
("quality-report-.dist", "quality-report-.dist", True),
("quality-report-*", "quality-report-.dist", True),
("*.txt", "a.txt", True),
("*.txt", ".txt", False),
("Quality-*", "quality-a", False),
]
matches = SELECTOR_MODULE["matches"]
for pattern, name, expected in rows:
with self.subTest(pattern=pattern, name=name):
self.assertIs(expected, matches(name, pattern))

def test_selector_refuses_constructs_it_cannot_mirror(self):
error = SELECTOR_MODULE["SelectionError"]
for pattern in ("**/quality-result-a", "quality-result-a/**", "a\\|b", "a-[[:alpha:]]"):
with self.subTest(pattern=pattern):
with self.assertRaises(error):
self.select(
[self.artifact(1, "2026-08-13T12:01:00Z", name="quality-result-a")],
pattern=pattern,
)

def refuses(self, pattern):
error = SELECTOR_MODULE["SelectionError"]
with self.assertRaises(error):
self.select(
[self.artifact(1, "2026-08-13T12:01:00Z", name="quality-result-auth")],
pattern="quality-result-@(auth|stats)",
[self.artifact(1, "2026-08-13T12:01:00Z", name="quality-result-a")],
pattern=pattern,
)
self.assertIn("extglob", str(caught.exception))

def test_oversized_brace_range_bound_is_a_selection_error(self):
self.refuses("a-{1.." + "9" * 4301 + "}")
self.refuses("a-{" + "9" * 4301 + "..1}")
self.assertEqual(["a-1", "a-2", "a-3"], SELECTOR_MODULE["expand_braces"]("a-{1..3}"))

def test_brace_expansion_deduplicates_a_large_range_quickly(self):
expanded = SELECTOR_MODULE["expand_braces"]("a-{0..99999}")
self.assertEqual(100000, len(expanded))
self.assertEqual("a-0", expanded[0])
self.assertEqual(["a-1", "a-2"], SELECTOR_MODULE["expand_braces"]("a-{1,2,1}"))

def test_deeply_nested_extglob_is_a_selection_error(self):
self.refuses("@(" * 2000 + "a" + ")" * 2000)
self.refuses("@(" * 65 + "a" + ")" * 65)
self.assertTrue(SELECTOR_MODULE["matches"]("a", "@(@(a))"))

def test_many_negation_groups_is_a_selection_error(self):
started = time.monotonic()
self.refuses("quality-result-" + "!(x)" * 14)
self.refuses("quality-result-" + "!(x)" * 25)
self.refuses("a" + "!(x|y|z)" * 8)
self.assertLess(time.monotonic() - started, 2)

def test_negation_copies_of_a_long_literal_are_a_selection_error(self):
started = time.monotonic()
self.refuses("quality-result-" + "!(x)" * 10 + "a" * 60000)
matches = SELECTOR_MODULE["matches"]
self.assertTrue(matches("a" * 60000, "*" + "a" * 59999))
self.assertLess(time.monotonic() - started, 2)

def test_ordinary_negation_groups_still_match(self):
matches = SELECTOR_MODULE["matches"]
started = time.monotonic()
self.assertTrue(matches("ab", "!(a)!(b)"))
self.assertTrue(matches("xy", "!(a)!(b)"))
self.assertTrue(matches("quality-result-y", "quality-result-!(x)"))
self.assertFalse(matches("quality-result-x", "quality-result-!(x)"))
self.assertTrue(matches("pre-q-r", "pre-!(a)-!(b)"))
self.assertFalse(matches("pre-a-r", "pre-!(a)-!(a)"))
eight = "q-" + "!(x)" * 8
self.assertTrue(matches("q-yyyyyyyy", eight))
self.assertTrue(matches("q-y", eight))
self.assertLess(time.monotonic() - started, 2)

def test_escaped_pipe_is_refused_before_suffix_shortcuts(self):
self.refuses("*a\\|b")
self.refuses("??\\|b")
self.assertTrue(SELECTOR_MODULE["matches"]("xa", "*a"))
self.assertTrue(SELECTOR_MODULE["matches"]("b", "@(a|b)"))

def test_brace_expansion_cap_never_drops_alternatives_silently(self):
self.refuses("!{quality-result-{0..99999},a/../b}")
self.refuses("!{quality-result-{0..1},a/../b}")
self.refuses("{0..100000}")
self.refuses("{0..99999}{a,b}")

def test_brace_expansion_handles_nesting_and_literals(self):
expand = SELECTOR_MODULE["expand_braces"]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quality-report-aggregate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
required: true
type: string
result_artifact_pattern:
description: Artifact-name glob (* ? [] and {a,b} alternatives; extglob is not supported) containing target-result.json files
description: Artifact-name pattern containing target-result.json files, matched with minimatch 10.2.6 default options as the compatibility target (* ? [] {a,b} and extglob such as @(a|b)); the deepest extglob nesting, escaped pipes, path segments like ** and .., and oversized brace expansions fail the selection instead of matching
required: false
type: string
default: quality-result-*
Expand Down
46 changes: 33 additions & 13 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ contract tests that pin the shapes other repositories depend on.
## What lives here

- `.github/workflows/go-ci.yml`, `node-ci.yml`, `release-gate.yml`,
`greptile-summon.yml`, `quality-report-aggregate.yml` — reusable workflows
`greptile-summon.yml`, `quality-report-aggregate.yml`,
`main-is-released.yml`, `starchart-refresh.yml`: reusable workflows
consumed by other CodesWhat repositories.
- `.github/tests/` — contract tests. These are the public API of the org's
- `actions/changes-gate` and `actions/tree-receipt/{verify,record}`:
composite actions consumers pin the same way. Each has its own README and
contract test (`changes_gate_contract_test.py`,
`tree_receipt_contract_test.py`).
- `.github/tests/`: contract tests. These are the public API of the org's
shared configs (the `greptile.json` shape, the quality-report v1 contract,
the reusable CI inputs). Change a contract test and its consumers together,
never one side alone.
- `profile/` — the organization profile README plus generated SVG assets
- `profile/`: the organization profile README plus generated SVG assets
from `scripts/generate_profile_svg.py`. The untracked
`profile/font_reference.svg` is user-owned; leave it alone.

Expand All @@ -35,21 +40,36 @@ contract tests that pin the shapes other repositories depend on.
Verify promotions with tree equality
(`git diff --quiet origin/main origin/dev/repository-standards`), never
commit ancestry.
- Before opening a promotion, check dev for open code scanning alerts at
high or above. `main`'s ruleset blocks merges on them and dev PRs don't.
This must print 0:
- After opening a promotion PR, check its code scanning result before
approving. `main`'s ruleset blocks merges on open alerts at high or above,
and CodeQL here only analyzes pull requests, on `refs/pull/<n>/merge`, so a
dev-branch query always returns 0 and proves nothing. Wait for an analysis
of the PR's current test merge commit, then count the open alerts on that
ref. With `n` set to the promotion PR number, run this in bash. It must
print 0:

```sh
alerts="repos/CodesWhat/.github/code-scanning/alerts"
gh api --paginate \
"$alerts?state=open&ref=refs/heads/dev/repository-standards&per_page=100" |
```bash
repo="repos/CodesWhat/.github"
ref="refs/pull/$n/merge"
if merge="$(gh api "$repo/pulls/$n" --jq .merge_commit_sha)" &&
analyses="$(gh api --paginate \
"$repo/code-scanning/analyses?ref=$ref&per_page=100")" &&
jq -se --arg m "$merge" 'any(.[][]; .commit_sha == $m)' \
<<<"$analyses" >/dev/null &&
alerts="$(gh api --paginate \
"$repo/code-scanning/alerts?state=open&ref=$ref&per_page=100")" &&
[ "$(gh api "$repo/pulls/$n" --jq .merge_commit_sha)" = "$merge" ]; then
jq -s '[.[][] | .rule | select(.security_severity_level == "high"
or .security_severity_level == "critical" or .severity == "error")]
| length'
| length' <<<"$alerts"
else
echo "check failed or no code scanning analysis of the merge commit yet"
fi
```

Fix each alert, or dismiss it with a reason once it's verified as a false
positive. Never change the ruleset to get past it.
Approve only at 0, at the head the check ran on, and run it again after any
push. Fix each alert, or dismiss it with a reason once it's
verified as a false positive. Never change the ruleset to get past it.
- There is no shared admission queue; pace hosted review and heavy CI with
the maintainer directly. Add `review-ready` for a PR's first CodeRabbit
review and request subsequent fix-batch reviews explicitly.
Expand Down
7 changes: 7 additions & 0 deletions REPOSITORY_ONBOARDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,13 @@ Add these only when the behavior exists:
Trace other consumers of the committed SVGs, such as a website, before
removing them or the caller. The reusable workflow keeps its interface for
existing pins.
- [ ] A dev-branch repository whose full CI is expensive can skip repeat work
with this repository's composite actions, pinned to a full commit SHA like
the reusable workflows. `actions/changes-gate` tells a PR whether any file
that matters changed, so docs-only PRs can skip heavy jobs.
`actions/tree-receipt` lets the promotion PR and the push to `main` reuse a
trusted earlier run for the same tree, and falls back to a full run on any
doubt. Their READMEs document the inputs.

### Qlty

Expand Down
16 changes: 12 additions & 4 deletions decisions/quality-reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,18 @@ Target result JSON is always uploaded; crash forensics remain failure-only.
Completeness requires fresh results for every expected target. The aggregate
job downloads only artifacts matching `result_artifact_pattern` that were
created strictly after the current attempt started, selected by explicit
artifact ID. Results retained from an earlier attempt never count, and a
partial rerun that lacks replacements fails closed: `complete=false`,
`outcome=error`, no aggregate score, and a nonzero exit. An empty selection
downloads nothing instead of falling back to every artifact.
artifact ID. The compatibility target is minimatch 10.2.6 with its
default options, which is what `actions/download-artifact` applies to its
pattern; the selector does not promise every behavior of that action. `*`,
`?`, `[...]`, `{a,b}` and `{1..3}` braces, and extglob (`@(a|b)`, `?()`,
`+()`, `*()`, `!()`) all work. A leading `!` negates the whole pattern, so
`!(a)*` is not an extglob. Artifact names have no path separator, so a
pattern that needs `**` or `..` segments, that escapes a pipe, that nests
extglobs past the parser limit, or whose brace expansion would pass its size
cap fails the selection instead of matching. Results retained from an earlier
attempt never count, and a partial rerun that lacks replacements fails closed:
`complete=false`, `outcome=error`, no aggregate score, and a nonzero exit. An
empty selection downloads nothing instead of falling back to every artifact.
Normalized aggregate artifacts use at least 90 days of retention.

The reusable workflow checks out its own contract at the exact called-workflow
Expand Down
Loading
Loading