Skip to content

Commit a83773d

Browse files
committed
style(snapshot): header and selection comments describe the restacked engine
The file header claimed the snapshot shared runForRepo's denial classification through a helper that no longer exists; the classification is inline, and the two differ (runForRepo also weighs the required set and landed writes). The header now names only what the two still share, the sections allowlist rule. The required-set fact was stated twice, once as "takes no required set", which is false since SnapshotOptions.sections is a SectionSelection carrying one. The field comment states the rule once: the set goes unread because a snapshot never writes, so a denial classifies on onMissingPermission alone. The inline duplicate is cut.
1 parent a2e9635 commit a83773d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎src/engine/snapshot.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
2-
* The snapshot pipeline: read every supported section back through its read port, assemble the
3-
* settings document, and validate it before anyone sees it. The read-only twin of runForRepo in
4-
* ./orchestrate.ts, sharing its allowlist rule and its denial classification.
2+
* The read-only twin of runForRepo in ./orchestrate.ts, honoring the sections allowlist by the
3+
* same rule.
54
*/
65

76
import { stringify as stringifyYaml } from "yaml";
@@ -30,7 +29,10 @@ import type { SectionSelection } from "./section-selection.js";
3029
export interface SnapshotOptions {
3130
/** The target repository, parsed at the caller's validated boundary. */
3231
repo: RepoRef;
33-
/** The allowlist; its required set is unused here, since a snapshot never writes. */
32+
/**
33+
* The allowlist. Its required set goes unread: required-sections governs what must apply, and
34+
* a snapshot never writes, so a denial classifies on onMissingPermission alone.
35+
*/
3436
sections: SectionSelection;
3537
onMissingPermission: "fail" | "warn";
3638
}
@@ -133,8 +135,6 @@ export async function snapshotRepository(
133135
);
134136
} catch (error) {
135137
if (error instanceof PermissionDenied) {
136-
// A snapshot never writes and takes no required set, so a denial classifies on the
137-
// skip/fail policy alone.
138138
const status = opts.onMissingPermission === "warn" ? "skipped" : "failed";
139139
if (status === "skipped") {
140140
io.annotate("warning", `${section.key}: skipped - ${error.detail}`);

0 commit comments

Comments
 (0)