Skip to content

Commit fa06cbf

Browse files
authored
chore: cut the comment blocks over the file-size check's caps to what the code cannot show (#479)
1 parent 3589d96 commit fa06cbf

7 files changed

Lines changed: 32 additions & 74 deletions

File tree

‎.github/scripts/gen-inputs-table.ts‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,8 @@ const row = lineOf([
5151
backticked,
5252
]);
5353

54-
/** What action-docs writes between its markers, by position after the opening marker's own line ends:
55-
*
56-
* "" the rest of the marker line
57-
* "## Inputs"
58-
* ""
59-
* "| name | description | required | default |"
60-
* "| --- | --- | --- | --- |"
61-
* one row per input a description never holds a "|" (test/docs/inputs.test.ts)
62-
* "" before the closing marker
63-
*
64-
* A region of blank lines alone (a fresh marker pair) is also a rendering's shape. */
54+
/** The first entry is the rest of the opening marker's own line. A "|" in a description would split its rendered row
55+
* past `row`'s four cells and refuse it as authored, so test/docs/inputs.test.ts pins every description free of one. */
6556
const LEADING: ((line: string) => boolean)[] = [
6657
(line) => line === "",
6758
(line) => line === "## Inputs",

‎.github/scripts/release-pipeline.ts‎

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,14 @@
1010
* refs/tags/vX -> the same commit, moved on each release in the line
1111
*
1212
* Every artifact is a function of its main commit alone, so runs for different commits never wait on each other
13-
* and a rerun mints the same name and verifies instead of appending. latest and vX move through movePointer alone:
14-
* forward along main, under a compare-and-set on the value origin advertised, never back.
13+
* and a rerun mints the same name and verifies instead of appending. latest and vX move through movePointer alone.
14+
* Every subcommand but prerelease-version runs under a workflow step, bare or in the step's shell; no step runs two.
1515
*
16-
* release-please cuts the DRAFT release without a tag (`draft` on, `force-tag-creation` off); one subcommand runs
17-
* per workflow step:
16+
* release-please cuts the DRAFT release without a tag (`draft` on, `force-tag-creation` off) and creates or
17+
* refreshes the release PR only when a releasable commit lands (release-please-config.json leaves always-update
18+
* off); that refresh is what publishes the `next` pre-release.
1819
*
19-
* package-commit post-green.yml GITHUB_SHA, RUN_URL (optional)
20-
* anchor update-release-pr.yml GITHUB_SHA
21-
* npm-verdict next update-release-pr.yml GITHUB_SHA, NPM_REGISTRY_URL (optional)
22-
* npm-confirm next update-release-pr.yml GITHUB_SHA, NPM_REGISTRY_URL (optional), NPM_CONFIRM_PAUSE_MS (optional)
23-
* npm-verdict stable update-release.yml TAG, GITHUB_SHA, NPM_REGISTRY_URL (optional)
24-
* npm-floor both publish jobs (nothing; npm on PATH)
25-
* package, retag-major update-release.yml TAG, GITHUB_SHA, RUN_URL (optional, package only)
26-
* boundary-check, anchor-check checks.yml (the checkout alone)
27-
* prerelease-version by hand GITHUB_SHA (the version a commit's next publish carries)
28-
*
29-
* The `next` pre-release publishes when release-please creates or refreshes the release PR, which it does only when a
30-
* releasable commit lands (release-please-config.json leaves always-update off); npm-verdict next is the guard on
31-
* npm state that follows, never the decision to publish.
32-
*
33-
* Node builtins only: bun runs this before `bun install`. Tests: test/scripts/release-pipeline*.test.ts over release-pipeline-fixture.ts.
20+
* Node builtins only: bun runs this before `bun install`.
3421
*/
3522

3623
import { execFileSync, spawnSync } from "node:child_process";
@@ -454,15 +441,9 @@ export interface PointerMove {
454441
* The one way a pointer (latest, vX) moves: forward along main, never back. A pointer's source is its commit's
455442
* parent when that parent is on main; the candidate's source is on main by its caller's check.
456443
*
457-
* pointer's source is the candidate's or descends from it -> left: the same package, or a rerun of an older commit's run
458-
* same source, another tree -> refused: two builds of one main commit
459-
* pointer's source unknown (off main, a root) -> moved: a value this pipeline did not mint
460-
* otherwise -> moved, under a lease on the value observed
461-
*
462444
* A value left in place must be a package of the commit it is read as packaging, or a hand-pushed bare child of a
463445
* newer commit would stand as "already past". Main's head is read AFTER the pointer on every pass: a pointer a rival
464-
* moved to a newer commit's package has that commit on main by then. A lease lost to a rival re-observes and
465-
* decides again; a push refused with the ref unmoved is thrown.
446+
* moved to a newer commit's package has that commit on main by then.
466447
*/
467448
export function movePointer(cwd: string, ref: string, candidate: Packaged): PointerMove {
468449
for (let attempt = 1; attempt <= PUSH_ATTEMPTS; attempt++) {

‎src/discovery/discover.ts‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,14 @@ export interface ExcludePattern {
8989
}
9090

9191
/**
92-
* `nocase`: repository names compare case-insensitively on GitHub. `dot`: a leading "." is an ordinary character
93-
* in a repository name (".github"), not the hidden-file marker picomatch skips by default. `posix`: "[!ab]" is a
94-
* negated class, as in a shell, instead of a class holding "!". `fastpaths: false`: the shortcut regexes picomatch
95-
* mints for star-led patterns demand a character after a literal dot, so "*.*" would miss "archive."; the full
96-
* parser keeps "*" any run of characters. `debug`: an invalid class like "[z-a]" throws instead of compiling to a
97-
* never-matching regex. `windows: false`: the main entry otherwise follows the host OS, and a slug is a GitHub
98-
* identifier, not a path, so the matcher is the same on every runner. `literalBrackets: false`: a class compiles
99-
* to the class alone, not an alternation with its literal text, which no name holds; thousands of classes then
100-
* compile in milliseconds instead of reaching the engine's size limit.
92+
* picomatch is built for file paths and a slug is a GitHub identifier, so each option is set for a name, none left to its default:
93+
* nocase -> GitHub compares repository names case-insensitively
94+
* dot -> a leading "." is an ordinary name character (".github"), not the hidden-file marker
95+
* posix -> "[!ab]" is a negated class, as in a shell, not a class holding "!"
96+
* fastpaths -> the star-led shortcut regexes demand a character after a literal dot, so "*.*" would miss "archive."
97+
* debug -> an invalid class like "[z-a]" throws instead of compiling to a never-matching regex
98+
* windows -> pinned: only picomatch's main callable reads the host OS; makeRe never does
99+
* literalBrackets -> no alternation with the class's literal text (no name holds it); thousands compile in milliseconds, under the engine's limit
101100
*/
102101
const EXCLUDE_GLOB_OPTIONS = {
103102
nocase: true,

‎src/flows/settings-write.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**
2-
* The one place a run writes a settings document (a snapshot, the merged file, init's starting file): staged beside
3-
* the destination and renamed into place, so a write that fails partway (disk full, an interrupted run) leaves the
4-
* previous file intact instead of a truncated one. The rename is atomic on POSIX and a single replace call on
5-
* Windows. The staging name is unique to the write (pid and random bytes), so no file of the user's is ever unlinked
6-
* or written through: an existing path there fails the write instead. A destination that is a symlink is replaced by
7-
* the rename, the link itself, never its referent, so the written document is always a regular file at `path`. The
8-
* guards over the writer hold one promise: an input layer is never the destination, under any name the read follows
9-
* or the rename reaches; deliberate evasion (hardlinks, mounts, races) is out of scope. A hard crash mid-write leaves
10-
* the staging file for the user to remove (.gitignore hides it); no run sweeps a file another process may be writing.
2+
* The one place a run writes a settings document (a snapshot, the merged file, init's starting file). The guards
3+
* over the writer hold one promise: an input layer is never the destination, under any name the read follows or the
4+
* rename reaches. Deliberate evasion (hardlinks, mounts, races) is out of scope.
5+
*
6+
* staged beside the destination, renamed in -> a write that fails partway leaves the previous file intact
7+
* the rename -> atomic on POSIX, a single replace call on Windows
8+
* a symlink at the destination -> the link itself is replaced, never its referent: `path` is always a regular file after
9+
* a hard crash mid-write -> the staging file is left for the user to remove (.gitignore hides it); no run
10+
* sweeps a file another process may be writing
1111
*/
1212

1313
import { randomBytes } from "node:crypto";

‎src/github/secret-scan.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ function renderKeyPath(path: readonly string[]): string {
4949
* a property -> read through its descriptor; an enumerable accessor is rejected UNREAD (a getter could sabotage globals)
5050
* an object's keys -> only Object.keys are copied, so symbol and non-enumerable keys never reach the copy (array indices do)
5151
* a container again -> rejected when it is one of its own ancestors (a YAML alias cycle); a sibling alias is copied twice
52-
* the wire -> only the copy is sent
53-
*
54-
* A rejection is the NotPlainData the walk hands up, an instance no payload value can be.
5552
*/
5653
function normalizePlainData(
5754
value: unknown,

‎src/sections/contract/errors.ts‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ import { grantFor, type SectionPermission, samePermission } from "./permissions.
1414
* What ends a section's work, as a value. `message` is the whole line the loops report; `kind` is read for policy
1515
* alone (a denial's partial-success handling in engine/orchestrate.ts), never to rebuild prose.
1616
*
17-
* request kinds (failureFor and the request helpers): rate-limit, rejected, server-error, unauthorized,
18-
* validation, transport, malformed
19-
* duplicate kinds (the identity checks): declared-duplicate, live-duplicate
20-
* live-shape -> GitHub's answer parsed but cannot be reconciled (an item without an id, a repeated rule type)
21-
* refused -> the section declines to proceed: the settings file conflicts with live state, an actor cannot
22-
* be resolved, a write would drop live values the file omits
23-
* unverified -> a write landed but its echo disagrees with what was set
24-
* thrown -> an exception escaped a section: the client's own throw on an unmarked request, or a BUG
25-
* invariant; the loops report its message like any other failure
17+
* live-shape -> GitHub's answer parsed but cannot be reconciled (an item without an id, a repeated rule type)
18+
* refused -> the section declines to proceed: the settings file conflicts with live state, an actor cannot be
19+
* resolved, a write would drop live values the file omits
20+
* unverified -> a write landed but its echo disagrees with what was set
21+
* thrown -> an exception escaped a section: the client's own throw on an unmarked request, or a BUG invariant
2622
*/
2723
export type SectionFailure =
2824
| {

‎src/sections/shared/roles.ts‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@ const STANDARD_PERMISSIONS = ["pull", "triage", "push", "maintain", "admin"] as
4545
* The two wrong spellings hide until apply: "write" on an existing Write collaborator converges with zero drift
4646
* (the live role_name IS "write") while the same entry on a new one PUTs {"permission":"write"} and 422s.
4747
*
48-
* read, write (any case) -> the vocabulary GET reports a role in; the grant takes pull, push
49-
* Push, ADMIN (a mis-cased standard) -> the lowercase form
50-
* "", " push", "push\n" (block scalar) -> nothing to grant, or whitespace GitHub would not match
51-
*
52-
* One regex, so the published schema carries the same rule as a `pattern` (a pattern has no flags, hence the
53-
* case classes): an exact standard permission, or one line with no whitespace at either end that folds to none
54-
* of the seven words.
48+
* One regex, so the published schema carries the same rule as a `pattern`; a pattern has no flags, hence the case classes.
5549
*/
5650
const REFUSED_FOLDED = [...STANDARD_PERMISSIONS, ...PERMISSION_FOR_ROLE.keys()];
5751
const caseless = (word: string) => [...word].map((c) => `[${c.toUpperCase()}${c}]`).join("");

0 commit comments

Comments
 (0)