@ploaness/cli 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/checks/assets.d.ts +12 -0
  2. package/dist/checks/assets.d.ts.map +1 -1
  3. package/dist/checks/assets.js +27 -4
  4. package/dist/checks/assets.js.map +1 -1
  5. package/dist/checks/blocklist.d.ts +8 -0
  6. package/dist/checks/blocklist.d.ts.map +1 -0
  7. package/dist/checks/blocklist.js +106 -0
  8. package/dist/checks/blocklist.js.map +1 -0
  9. package/dist/checks/containers.d.ts +1 -1
  10. package/dist/checks/containers.d.ts.map +1 -1
  11. package/dist/checks/containers.js +31 -27
  12. package/dist/checks/containers.js.map +1 -1
  13. package/dist/checks/conventions.d.ts +2 -1
  14. package/dist/checks/conventions.d.ts.map +1 -1
  15. package/dist/checks/conventions.js +9 -7
  16. package/dist/checks/conventions.js.map +1 -1
  17. package/dist/checks/dependencies.d.ts.map +1 -1
  18. package/dist/checks/dependencies.js +83 -42
  19. package/dist/checks/dependencies.js.map +1 -1
  20. package/dist/checks/editorconfig.d.ts +1 -1
  21. package/dist/checks/editorconfig.d.ts.map +1 -1
  22. package/dist/checks/editorconfig.js +12 -10
  23. package/dist/checks/editorconfig.js.map +1 -1
  24. package/dist/checks/environment.d.ts +13 -0
  25. package/dist/checks/environment.d.ts.map +1 -0
  26. package/dist/checks/environment.js +50 -0
  27. package/dist/checks/environment.js.map +1 -0
  28. package/dist/checks/install.d.ts +2 -0
  29. package/dist/checks/install.d.ts.map +1 -1
  30. package/dist/checks/install.js +10 -1
  31. package/dist/checks/install.js.map +1 -1
  32. package/dist/checks/integrity.d.ts +1 -1
  33. package/dist/checks/integrity.d.ts.map +1 -1
  34. package/dist/checks/integrity.js +4 -4
  35. package/dist/checks/integrity.js.map +1 -1
  36. package/dist/checks/oxlint.d.ts +5 -0
  37. package/dist/checks/oxlint.d.ts.map +1 -0
  38. package/dist/checks/oxlint.js +85 -0
  39. package/dist/checks/oxlint.js.map +1 -0
  40. package/dist/checks/payload.d.ts +22 -1
  41. package/dist/checks/payload.d.ts.map +1 -1
  42. package/dist/checks/payload.js +194 -28
  43. package/dist/checks/payload.js.map +1 -1
  44. package/dist/checks/references.d.ts.map +1 -1
  45. package/dist/checks/references.js +3 -3
  46. package/dist/checks/references.js.map +1 -1
  47. package/dist/checks/suppressions.d.ts +2 -2
  48. package/dist/checks/suppressions.d.ts.map +1 -1
  49. package/dist/checks/suppressions.js +32 -12
  50. package/dist/checks/suppressions.js.map +1 -1
  51. package/dist/checks/tailwind.d.ts.map +1 -1
  52. package/dist/checks/tailwind.js +3 -3
  53. package/dist/checks/tailwind.js.map +1 -1
  54. package/dist/checks/tests.d.ts.map +1 -1
  55. package/dist/checks/tests.js +13 -5
  56. package/dist/checks/tests.js.map +1 -1
  57. package/dist/checks/tree.d.ts +9 -2
  58. package/dist/checks/tree.d.ts.map +1 -1
  59. package/dist/checks/tree.js +17 -29
  60. package/dist/checks/tree.js.map +1 -1
  61. package/dist/checks/wiring.d.ts +10 -0
  62. package/dist/checks/wiring.d.ts.map +1 -1
  63. package/dist/checks/wiring.js +50 -5
  64. package/dist/checks/wiring.js.map +1 -1
  65. package/dist/commands/format.d.ts +4 -1
  66. package/dist/commands/format.d.ts.map +1 -1
  67. package/dist/commands/format.js +17 -3
  68. package/dist/commands/format.js.map +1 -1
  69. package/dist/commands/init.d.ts.map +1 -1
  70. package/dist/commands/init.js +1 -3
  71. package/dist/commands/init.js.map +1 -1
  72. package/dist/context.d.ts +1 -2
  73. package/dist/context.d.ts.map +1 -1
  74. package/dist/context.js +25 -24
  75. package/dist/context.js.map +1 -1
  76. package/dist/gates.d.ts.map +1 -1
  77. package/dist/gates.js +56 -12
  78. package/dist/gates.js.map +1 -1
  79. package/dist/probes/payload-defaults.probe.d.ts +2 -0
  80. package/dist/probes/payload-defaults.probe.d.ts.map +1 -0
  81. package/dist/probes/payload-defaults.probe.js +116 -0
  82. package/dist/probes/payload-defaults.probe.js.map +1 -0
  83. package/dist/secret-mirror.d.ts +3 -0
  84. package/dist/secret-mirror.d.ts.map +1 -0
  85. package/dist/secret-mirror.js +51 -0
  86. package/dist/secret-mirror.js.map +1 -0
  87. package/dist/source-comments.d.ts +9 -0
  88. package/dist/source-comments.d.ts.map +1 -0
  89. package/dist/source-comments.js +54 -0
  90. package/dist/source-comments.js.map +1 -0
  91. package/dist/working-tree.d.ts +5 -0
  92. package/dist/working-tree.d.ts.map +1 -0
  93. package/dist/working-tree.js +36 -0
  94. package/dist/working-tree.js.map +1 -0
  95. package/package.json +8 -7
  96. package/dist/commands/hooks.d.ts +0 -9
  97. package/dist/commands/hooks.d.ts.map +0 -1
  98. package/dist/commands/hooks.js +0 -57
  99. package/dist/commands/hooks.js.map +0 -1
@@ -0,0 +1,85 @@
1
+ import { existsSync, mkdtempSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
2
+ import { tmpdir } from 'node:os';
3
+ import path from 'node:path';
4
+ import { asRecord, asText, isEslintOwnedSuppression, isOxlintConfig, oxlintArguments, oxlintConfig, oxlintGroups, oxlintReportProblems, oxlintRuleNames, oxlintSourceFiles, oxlintSuppressionProblems, } from '@ploaness/governance';
5
+ import { cliDirectory, hasOwnRuntime, readJson, resolveTool, shippedDirectory, workingTreeFiles, } from '../context.js';
6
+ import { failed, passed, runNode, withOutput } from '../exec.js';
7
+ import { sourceComments } from '../source-comments.js';
8
+ const JSON_INDENT = 2;
9
+ const manifestIn = (directory) => asRecord(readJson(path.join(directory, 'package.json')));
10
+ const versionProblems = () => {
11
+ const cli = manifestIn(cliDirectory());
12
+ const expected = asText(asRecord(cli['dependencies'])['oxlint']);
13
+ const manifest = manifestIn(shippedDirectory('oxlint'));
14
+ return expected.length > 0 && manifest['version'] === expected
15
+ ? []
16
+ : [`Oxlint must resolve to the harness-owned version ${expected}`];
17
+ };
18
+ const eligibleFiles = (member, inventory) => oxlintSourceFiles(inventory, member.settings.generatedArtefacts, member.siblingPaths).filter((file) => {
19
+ const absolute = path.join(member.root, file);
20
+ return existsSync(absolute) && statSync(absolute).isFile();
21
+ });
22
+ const suppressionProblems = (member, group) => group.files.flatMap((file) => {
23
+ const text = readFileSync(path.join(member.root, file), 'utf8');
24
+ const problems = oxlintSuppressionProblems(sourceComments(text, file), oxlintRuleNames(group.rules));
25
+ return problems.map((problem) => `${file}: ${problem}`);
26
+ });
27
+ const legacySitesIn = (member, files) => files.flatMap((file) => {
28
+ const text = readFileSync(path.join(member.root, file), 'utf8');
29
+ return sourceComments(text, file)
30
+ .filter(isEslintOwnedSuppression)
31
+ .map((comment) => ({ file, line: comment.line }));
32
+ });
33
+ const nativeVerdict = (result, group, legacy) => {
34
+ const findings = oxlintReportProblems(result.stdout, group.files.length, group.rules.length, { exitCode: result.code, output: result.output, legacy });
35
+ return withOutput(findings.length === 0
36
+ ? passed(`${String(group.files.length)} source file(s) pass ${String(group.rules.length)} native rules`)
37
+ : failed('Oxlint did not establish conformance', [
38
+ ...findings,
39
+ ...(result.code === 0 ? [] : [result.output]),
40
+ ]), result.output);
41
+ };
42
+ const analyze = (member, group) => {
43
+ const directory = mkdtempSync(path.join(tmpdir(), 'ploaness-oxlint-'));
44
+ try {
45
+ const config = path.join(directory, 'oxlint.json');
46
+ writeFileSync(config, `${JSON.stringify(oxlintConfig(group.rules), null, JSON_INDENT)}\n`);
47
+ const legacy = legacySitesIn(member, group.files);
48
+ return nativeVerdict(runNode(resolveTool('oxlint'), [...oxlintArguments(config, group.files)], {
49
+ cwd: member.root,
50
+ }), group, legacy);
51
+ }
52
+ finally {
53
+ rmSync(directory, { recursive: true, force: true });
54
+ }
55
+ };
56
+ /** Run disjoint groups sequentially, preserving each invocation's measured coverage. */
57
+ const analyzeGroups = (member, groups) => {
58
+ const [first, ...rest] = groups;
59
+ if (first === undefined) {
60
+ return passed('no eligible source remains to analyze');
61
+ }
62
+ const result = analyze(member, first);
63
+ if (!result.ok || rest.length === 0) {
64
+ return result;
65
+ }
66
+ const remaining = analyzeGroups(member, rest);
67
+ return withOutput({ ...remaining, summary: `${result.summary}; ${remaining.summary}` }, [result.output, remaining.output].filter(Boolean).join('\n'));
68
+ };
69
+ /** Native core checks for every member, with accessibility only in the existing application scope. */
70
+ export const oxlint = (member) => {
71
+ const inventory = workingTreeFiles(member.root);
72
+ const groups = oxlintGroups(eligibleFiles(member, inventory), hasOwnRuntime(member));
73
+ const problems = [
74
+ ...versionProblems(),
75
+ ...inventory
76
+ .filter(isOxlintConfig)
77
+ .map((file) => `${file}: Oxlint configuration is owned by ploaness`),
78
+ ...groups.flatMap((group) => suppressionProblems(member, group)),
79
+ ];
80
+ if (problems.length > 0) {
81
+ return failed('Oxlint wiring or suppression policy is violated', problems);
82
+ }
83
+ return analyzeGroups(member, groups);
84
+ };
85
+ //# sourceMappingURL=oxlint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oxlint.js","sourceRoot":"","sources":["../../src/checks/oxlint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAChG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EACL,QAAQ,EACR,MAAM,EACN,wBAAwB,EACxB,cAAc,EAGd,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAE1B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,YAAY,EACZ,aAAa,EAEb,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,MAAM,EAAmB,MAAM,EAAkB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,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O,CAAC,CAAC,KAAkB,EAAqB,EAAE,CAC1D,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CACnC;KACF,CAAA;IACD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC,iDAAiD,EAAE,QAAQ,CAAC,CAAA;IAC5E,CAAC;IACD,OAAO,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC,CAAA"}
@@ -2,6 +2,27 @@ import { type Context, type Member } from '../context.js';
2
2
  import { type GateResult } from '../exec.js';
3
3
  /** Regenerate the Payload types and admin import map, then fail on any drift. */
4
4
  export declare const payloadGenerated: (context: Context) => GateResult;
5
- /** Apply the source rules to every tracked TypeScript file under the declared source roots. */
5
+ /**
6
+ * Every collection and global in the BUILT configuration decides its access.
7
+ *
8
+ * The static rule reads the access blocks a project wrote; this one imports the configuration Payload
9
+ * actually boots, so the collections the framework builds for the project - the folder tree, the job
10
+ * queue, a plugin's own - are judged too. Each of those arrives with Payload's default, which admits
11
+ * every signed-in user, and the anonymous sweep cannot see that because a signed-in user is not
12
+ * anonymous. The harness's own tsx loads the configuration against the project's tsconfig, with the
13
+ * project root as the working directory so `payload` resolves from the project.
14
+ */
15
+ export declare const payloadDefaults: (context: Member) => GateResult;
16
+ /** Apply the source rules to every TypeScript file under the declared source roots. */
6
17
  export declare const payloadRules: (context: Member) => GateResult;
18
+ /**
19
+ * Every custom admin view is scanned for accessibility by a specification of the project's own.
20
+ *
21
+ * The pinned sweep skips the admin panel unconditionally, because the panel is Payload's markup and
22
+ * the crawl carries no credential. A custom view is the project's markup behind that exemption, and
23
+ * nothing else in the harness will ever look at it. ploaness cannot scan it - it cannot sign in, and
24
+ * it does not know which container is the project's rather than the framework's - so it requires the
25
+ * project to have scanned it instead.
26
+ */
27
+ export declare const adminViews: (context: Member) => GateResult;
7
28
  //# sourceMappingURL=payload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/checks/payload.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,MAAM,EAIZ,MAAM,eAAe,CAAA;AACtB,OAAO,EAAsB,KAAK,UAAU,EAAmC,MAAM,YAAY,CAAA;AAWjG,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,GAAI,SAAS,OAAO,KAAG,UA0CnD,CAAA;AAaD,+FAA+F;AAC/F,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,KAAG,UAkB9C,CAAA"}
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/checks/payload.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,KAAK,OAAO,EAGZ,KAAK,MAAM,EAOZ,MAAM,eAAe,CAAA;AACtB,OAAO,EAGL,KAAK,UAAU,EAKhB,MAAM,YAAY,CAAA;AA2BnB,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,GAAI,SAAS,OAAO,KAAG,UAgDnD,CAAA;AAuDD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,KAAG,UA6CjD,CAAA;AAuCD,uFAAuF;AACvF,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,KAAG,UAmB9C,CAAA;AAOD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,KAAG,UAmC5C,CAAA"}
@@ -2,9 +2,9 @@
2
2
  // and the Local API must be used in a way that neither over-fetches nor skips access control.
3
3
  import { existsSync, readFileSync } from 'node:fs';
4
4
  import path from 'node:path';
5
- import { findPayloadViolations, findSourceViolations, } from '@ploaness/governance';
6
- import { git, resolveProjectTool, runEnvironment, trackedFiles, } from '../context.js';
7
- import { asFindings, failed, passed, runNode } from '../exec.js';
5
+ import { findDeclaredAdminViews, findEndpointViolations, findGeneratedDrift, findInheritedAccess, findPayloadViolations, findSourceViolations, findUnconstrainedDraftReads, findUnguardedRelationships, findUnscannedAdminViews, parseInheritedAccessReport, payloadConfigPathOf, } from '@ploaness/governance';
6
+ import { cliDirectory, git, manifestPathFrom, readJson, resolveProjectTool, resolveTool, runEnvironment, workingTreeFiles, } from '../context.js';
7
+ import { asFindings, failed, passed, runNode, withOutput, } from '../exec.js';
8
8
  // Resolution failure is an answer rather than an exception the caller must catch.
9
9
  const resolveProjectToolOrUndefined = (context, tool) => {
10
10
  try {
@@ -14,6 +14,21 @@ const resolveProjectToolOrUndefined = (context, tool) => {
14
14
  return undefined;
15
15
  }
16
16
  };
17
+ const readIfPresent = (root, target) => {
18
+ const full = path.join(root, target);
19
+ return existsSync(full) ? readFileSync(full, 'utf8') : undefined;
20
+ };
21
+ // A repository is the normal case and git is required, so a failure here is an absent tool rather than
22
+ // an untracked artefact. Reported as tracked, which leaves the drift comparison - which needs no git at
23
+ // all - to answer on its own.
24
+ const isTracked = (context, target) => {
25
+ try {
26
+ return git(context, ['ls-files', '--', target]).length > 0;
27
+ }
28
+ catch {
29
+ return true;
30
+ }
31
+ };
17
32
  /** Regenerate the Payload types and admin import map, then fail on any drift. */
18
33
  export const payloadGenerated = (context) => {
19
34
  const payloadCli = resolveProjectToolOrUndefined(context, 'payload');
@@ -22,6 +37,19 @@ export const payloadGenerated = (context) => {
22
37
  'ploaness governs Payload projects, so "payload" must be installed in the project itself',
23
38
  ]);
24
39
  }
40
+ // The SETTING rather than the constant behind it. Every other consumer of the artefact list already
41
+ // read the setting - the write denials, the biome carve-outs, the scaffolder - and this one did not,
42
+ // so a project that declared where its import map actually lives had that file denied, excluded, and
43
+ // regenerated, but never diffed. The gate then reported that the artefacts matched a configuration it
44
+ // had not compared them against, and the drift it had just written surfaced two gates later as an
45
+ // unexplained working-tree change.
46
+ const targets = context.settings.generatedArtefacts;
47
+ // Read before the generators run, because they overwrite in place: this is the only moment the
48
+ // previous bytes exist.
49
+ const before = new Map(targets.map((target) => [
50
+ target,
51
+ readIfPresent(context.root, target),
52
+ ]));
25
53
  for (const target of ['generate:types', 'generate:importmap']) {
26
54
  const result = runNode(payloadCli, [target], {
27
55
  cwd: context.root,
@@ -33,49 +61,187 @@ export const payloadGenerated = (context) => {
33
61
  return failed(`payload ${target} failed`, asFindings(result.output));
34
62
  }
35
63
  }
36
- // The SETTING rather than the constant behind it. Every other consumer of the artefact list already
37
- // read the setting - the write denials, the biome carve-outs, the scaffolder - and this one did not,
38
- // so a project that declared where its import map actually lives had that file denied, excluded, and
39
- // regenerated, but never diffed. The gate then reported that the artefacts matched a configuration it
40
- // had not compared them against, and the drift it had just written surfaced two gates later as an
41
- // unexplained working-tree change.
42
- const drifted = context.settings.generatedArtefacts.filter((target) => {
43
- if (!existsSync(path.join(context.root, target))) {
44
- return false;
45
- }
46
- try {
47
- return git(context, ['diff', '--name-only', '--', target]).length > 0;
48
- }
49
- catch {
50
- return false;
51
- }
52
- });
64
+ const regenerated = targets.map((target) => ({
65
+ target,
66
+ isTracked: isTracked(context, target),
67
+ before: before.get(target),
68
+ after: readIfPresent(context.root, target),
69
+ }));
70
+ const drifted = findGeneratedDrift(regenerated);
53
71
  return drifted.length > 0
54
72
  ? failed('generated Payload artefacts drifted from the configuration', [
55
- ...drifted.map((target) => `${target} changed when regenerated`),
73
+ ...drifted,
56
74
  'commit the regenerated files',
57
75
  ])
58
76
  : passed('the generated Payload artefacts match the configuration');
59
77
  };
78
+ // Where Payload keeps the function it fills an undeclared operation with. Named by path because the
79
+ // package's exports map does not expose it; ploaness pins `payload` exactly, so a layout change arrives
80
+ // with a ploaness release rather than silently, and an absent file fails closed below.
81
+ const DEFAULT_ACCESS_MODULE = ['dist', 'auth', 'defaultAccess.js'];
82
+ const PROBE_FILE = ['dist', 'probes', 'payload-defaults.probe.js'];
83
+ // Building a configuration opens no socket, but a plugin might, and a hung import must end as a verdict.
84
+ const PROBE_TIMEOUT_MS = 120_000;
85
+ const defaultAccessFileOf = (context) => {
86
+ const manifest = manifestPathFrom('payload', path.join(context.root, 'package.json'));
87
+ return manifest === undefined
88
+ ? undefined
89
+ : path.join(path.dirname(manifest), ...DEFAULT_ACCESS_MODULE);
90
+ };
91
+ // The two defects the report can carry, named separately so the summary says which one was found
92
+ // rather than counting them together under whichever wording came first.
93
+ const summariseAccessFindings = (inherited, draftReads) => {
94
+ const parts = [
95
+ ...(inherited > 0
96
+ ? [`${String(inherited)} collection(s) or global(s) inherit Payload's default access`]
97
+ : []),
98
+ ...(draftReads > 0
99
+ ? [`${String(draftReads)} drafts read(s) serve an unapproved document to a stranger`]
100
+ : []),
101
+ ];
102
+ return parts.join('; ');
103
+ };
104
+ // The probe's outcome, once it ran: a report that was not printed, or not readable, is a failure of its
105
+ // own rather than an empty finding list, because nothing else stands between a crashed probe and a pass.
106
+ const judgeProbe = (result) => {
107
+ if (result.code !== 0) {
108
+ return failed('the Payload configuration could not be built', asFindings(result.output));
109
+ }
110
+ const report = parseInheritedAccessReport(result.stdout);
111
+ if (report === undefined) {
112
+ return failed('the access probe printed no readable report', asFindings(result.output));
113
+ }
114
+ const inherited = findInheritedAccess(report);
115
+ const draftReads = findUnconstrainedDraftReads(report);
116
+ const findings = [...inherited, ...draftReads];
117
+ return findings.length > 0
118
+ ? failed(summariseAccessFindings(inherited.length, draftReads.length), findings)
119
+ : passed('every collection and global decides its access, framework-built ones included, and no ' +
120
+ 'drafts read serves an unapproved document to a stranger');
121
+ };
122
+ /**
123
+ * Every collection and global in the BUILT configuration decides its access.
124
+ *
125
+ * The static rule reads the access blocks a project wrote; this one imports the configuration Payload
126
+ * actually boots, so the collections the framework builds for the project - the folder tree, the job
127
+ * queue, a plugin's own - are judged too. Each of those arrives with Payload's default, which admits
128
+ * every signed-in user, and the anonymous sweep cannot see that because a signed-in user is not
129
+ * anonymous. The harness's own tsx loads the configuration against the project's tsconfig, with the
130
+ * project root as the working directory so `payload` resolves from the project.
131
+ */
132
+ export const payloadDefaults = (context) => {
133
+ const tsconfig = path.join(context.root, 'tsconfig.json');
134
+ const configPath = payloadConfigPathOf(readJson(tsconfig));
135
+ const configFile = path.join(context.root, configPath);
136
+ if (!existsSync(configFile)) {
137
+ return failed('the Payload configuration could not be found', [
138
+ `${configPath} does not exist; a Payload member names its configuration under ` +
139
+ 'compilerOptions.paths["@payload-config"] in tsconfig.json, which `ploaness init` writes',
140
+ ]);
141
+ }
142
+ const defaultAccessFile = defaultAccessFileOf(context);
143
+ if (defaultAccessFile === undefined) {
144
+ return failed('payload could not be resolved from the project', [
145
+ 'ploaness governs Payload projects, so "payload" must be installed in the project itself',
146
+ ]);
147
+ }
148
+ if (!existsSync(defaultAccessFile)) {
149
+ return failed("Payload's default access could not be located", [
150
+ `${defaultAccessFile} is missing; ploaness knows the layout of the Payload version it pins, ` +
151
+ 'and this installation differs',
152
+ ]);
153
+ }
154
+ const result = runNode(resolveTool('tsx'), [
155
+ '--tsconfig',
156
+ tsconfig,
157
+ path.join(cliDirectory(), ...PROBE_FILE),
158
+ configFile,
159
+ defaultAccessFile,
160
+ ], {
161
+ cwd: context.root,
162
+ // The placeholders every analyzer that imports the project receives, then the project's own
163
+ // environment, then the one option ploaness owns: the same layering the knip and generated gates
164
+ // use, so a configuration that validates `process.env` on import survives here as it does there.
165
+ env: {
166
+ ...context.settings.analysisEnv,
167
+ ...runEnvironment(context),
168
+ NODE_OPTIONS: '--no-deprecation',
169
+ },
170
+ timeoutMs: PROBE_TIMEOUT_MS,
171
+ });
172
+ return withOutput(judgeProbe(result), result.output);
173
+ };
60
174
  const SOURCE_EXTENSIONS = ['.ts', '.tsx'];
61
175
  // The language rules apply to every package; the Payload ones only to a package that has Payload to
62
176
  // misuse. Held together, the import rule ran only where Payload did - so a frontend beside the CMS, the
63
177
  // place a parent-relative import is MOST likely because it has no Payload config to anchor on, was the
64
178
  // one package never checked for it.
65
- const violationsIn = (source, isPayload) => [
66
- ...findSourceViolations(source),
67
- ...(isPayload ? findPayloadViolations(source) : []),
179
+ const violationsIn = (file, isPayload) => [
180
+ ...findSourceViolations(file.source),
181
+ ...(isPayload ? findPayloadViolations(file.source) : []),
182
+ ...(isPayload ? findEndpointViolations(file.path, file.source) : []),
68
183
  ];
69
- /** Apply the source rules to every tracked TypeScript file under the declared source roots. */
70
- export const payloadRules = (context) => {
184
+ const sourceCandidates = (context) => {
71
185
  const roots = context.settings.sourceRoots;
72
- const candidates = trackedFiles(context.root).filter((file) => SOURCE_EXTENSIONS.some((extension) => file.endsWith(extension)) &&
186
+ return workingTreeFiles(context.root).filter((file) => SOURCE_EXTENSIONS.some((extension) => file.endsWith(extension)) &&
73
187
  roots.some((root) => file.startsWith(`${root}/`)) &&
74
188
  !file.endsWith('payload-types.ts') &&
75
189
  existsSync(path.join(context.root, file)));
76
- const findings = candidates.flatMap((file) => violationsIn(readFileSync(path.join(context.root, file), 'utf8'), context.isPayload).map((violation) => `${file}:${String(violation.line)} [${violation.rule}] ${violation.reason}`));
190
+ };
191
+ const reported = (file, violation) => `${file}:${String(violation.line)} [${violation.rule}] ${violation.reason}`;
192
+ // One rule cannot be decided from a single file: a required relationship names its target by slug, and
193
+ // the collection carrying that slug is declared somewhere else. It therefore reads the whole candidate
194
+ // set rather than one text, and it reports the file that declares the relationship rather than the file
195
+ // it happens to be judged from.
196
+ const crossFileFindings = (context, files) => context.isPayload
197
+ ? findUnguardedRelationships(files).map((located) => reported(located.path, located.violation))
198
+ : [];
199
+ /** Apply the source rules to every TypeScript file under the declared source roots. */
200
+ export const payloadRules = (context) => {
201
+ const candidates = sourceCandidates(context);
202
+ const files = candidates.map((file) => ({
203
+ path: file,
204
+ source: readFileSync(path.join(context.root, file), 'utf8'),
205
+ }));
206
+ const findings = [
207
+ ...files.flatMap((file) => violationsIn(file, context.isPayload).map((violation) => reported(file.path, violation))),
208
+ ...crossFileFindings(context, files),
209
+ ];
77
210
  return findings.length > 0
78
211
  ? failed(`${String(findings.length)} source usage violation(s)`, findings)
79
212
  : passed(`${String(candidates.length)} source file(s) follow the usage rules`);
80
213
  };
214
+ // Where a project's specifications live. `tests/` is a ploaness convention rather than a project
215
+ // setting - the suite collects from `tests/unit`, `tests/int` and `tests/e2e`, and the sweeps ploaness
216
+ // pins are written to `tests/e2e` - so a scan written anywhere else would not run either.
217
+ const SPEC_ROOT = 'tests/';
218
+ /**
219
+ * Every custom admin view is scanned for accessibility by a specification of the project's own.
220
+ *
221
+ * The pinned sweep skips the admin panel unconditionally, because the panel is Payload's markup and
222
+ * the crawl carries no credential. A custom view is the project's markup behind that exemption, and
223
+ * nothing else in the harness will ever look at it. ploaness cannot scan it - it cannot sign in, and
224
+ * it does not know which container is the project's rather than the framework's - so it requires the
225
+ * project to have scanned it instead.
226
+ */
227
+ export const adminViews = (context) => {
228
+ const files = sourceCandidates(context).map((file) => ({
229
+ path: file,
230
+ source: readFileSync(path.join(context.root, file), 'utf8'),
231
+ }));
232
+ const specs = files.filter((file) => file.path.startsWith(SPEC_ROOT));
233
+ // A configuration is looked for outside `tests/` alone, so that a fixture config written inside a
234
+ // specification is not read as a view this project serves.
235
+ const declared = files
236
+ .filter((file) => !file.path.startsWith(SPEC_ROOT))
237
+ .map((file) => [file, findDeclaredAdminViews(file.source)]);
238
+ const findings = declared.flatMap(([file, views]) => findUnscannedAdminViews(views, specs, files).map((violation) => `${file.path}:${String(violation.line)} [${violation.rule}] ${violation.reason}`));
239
+ if (findings.length > 0) {
240
+ return failed(`${String(findings.length)} custom admin view(s) are not scanned`, findings);
241
+ }
242
+ const total = declared.reduce((count, [, views]) => count + views.length, 0);
243
+ return passed(total === 0
244
+ ? 'this project declares no custom admin view'
245
+ : `${String(total)} custom admin view(s) are scanned for accessibility`);
246
+ };
81
247
  //# sourceMappingURL=payload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/checks/payload.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,8FAA8F;AAC9F,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GAErB,MAAM,sB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AAI,SAAS,OAAO,KAAG,UAoBnD,CAAA;AAED,wFAAwF;AACxF,eAAO,MAAM,MAAM,GAAI,SAAS,OAAO,KAAG,UAgBzC,CAAA"}
1
+ {"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../src/checks/references.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,UAAU,IAAI,IAAI,EAGxB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAU,KAAK,UAAU,EAAU,MAAM,YAAY,CAAA;AA4B5D;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,YAAY,IAAI,EAChB,gBAAe,WAAW,CAAC,MAAM,CAAqB,KACrD,UA4BF,CAAA;AAoCD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,OAAO,KAAG,UAoBnD,CAAA;AAED,wFAAwF;AACxF,eAAO,MAAM,MAAM,GAAI,SAAS,OAAO,KAAG,UAgBzC,CAAA"}
@@ -4,7 +4,7 @@
4
4
  import { existsSync, globSync, readFileSync } from 'node:fs';
5
5
  import path from 'node:path';
6
6
  import { asRecord, declaredDependencies, extractLiteralSourcePaths, findAgentDocuments, findDocumentReferenceViolations, findMissingConfigReferences, findSkillManifestViolations, findUnreachedExclusionsBySetting, requiredBiomeFiles, } from '@ploaness/governance';
7
- import { shippedDirectory, trackedFiles, } from '../context.js';
7
+ import { shippedDirectory, workingTreeFiles, } from '../context.js';
8
8
  import { failed, passed } from '../exec.js';
9
9
  const declaredScripts = (context) => asRecord(asRecord(context.packageJson)['scripts']);
10
10
  const biomeFilesJson = (context) => JSON.stringify(requiredBiomeFiles(context.settings.sourceRoots));
@@ -62,12 +62,12 @@ const configTargets = (context) => {
62
62
  const mandatedReferences = (context) => new Set(extractLiteralSourcePaths(biomeFilesJson(context)));
63
63
  // A declared exclusion is judged against the paths the gate it narrows would otherwise have read: a
64
64
  // coverage exclusion against what the coverage report measures, a typography or JavaScript exclusion
65
- // against the tracked tree the conventions gate walks. Judging either against the other's set would
65
+ // against the working tree the conventions gate walks. Judging either against the other's set would
66
66
  // report a finding about the wrong thing.
67
67
  // Which file set an exclusion has to reach is decided by the SETTING it came from, not by how its
68
68
  // pattern is written - the partition itself lives in `governance`, where it is spec'd against file lists
69
69
  // no repository has to be built to produce. What is left here is the one read it needs.
70
- const deadExclusions = (context) => findUnreachedExclusionsBySetting(context.settings.declaredExclusions, trackedFiles(context.root));
70
+ const deadExclusions = (context) => findUnreachedExclusionsBySetting(context.settings.declaredExclusions, workingTreeFiles(context.root));
71
71
  /**
72
72
  * A concrete source file carved out of a tool config must still exist on disk, and a declared exclusion
73
73
  * must exclude something. Both are the same defect at different scales: a carve-out that reaches
@@ -1 +1 @@
1
- {"version":3,"file":"references.js","sourceRoot":"","sources":["../../src/checks/references.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,wGAAwG;AACxG,oGAAoG;AACpG,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EACL,QAAQ,EAIR,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,+BAA+B,EAC/B,2BAA2B,EAC3B,2BAA2B,EAC3B,gCAAgC,EAChC,kBAAkB,GAEnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAIL,gBAAgB,EAChB,YAAY,GACb,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,MAAM,EAAmB,MAAM,EAAE,MAAM,YAAY,CAAA;AAE5D,MAAM,eAAe,GAAG,CAAC,OAAgB,EAA2B,EAAE,CACpE,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AAEpD,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAU,EAAE,CAClD,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,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AAC,OAAO,CAAC,YAAY,CAAC,CAAC;KACzD,CAAC,CAAC,GAAG,CACJ,CAAC,SAAyB,EAAU,EAAE,CACpC,GAAG,YAAY,KAAK,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,MAAM,EAAE,CAC5D,CACF,CAAA;IACH,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC;QACxB,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,iCAAiC,EAAE,QAAQ,CAAC;QAC/E,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAA;AACzE,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
- import { type Context } from '../context.js';
1
+ import { type Member } from '../context.js';
2
2
  import { type GateResult } from '../exec.js';
3
3
  /** Count suppressions and source lines across the project's own code. */
4
- export declare const suppressions: (context: Context) => GateResult;
4
+ export declare const suppressions: (context: Member) => GateResult;
5
5
  //# sourceMappingURL=suppressions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"suppressions.d.ts","sourceRoot":"","sources":["../../src/checks/suppressions.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAU,KAAK,UAAU,EAAU,MAAM,YAAY,CAAA;AAW5D,yEAAyE;AACzE,eAAO,MAAM,YAAY,GAAI,SAAS,OAAO,KAAG,UAoD/C,CAAA"}
1
+ {"version":3,"file":"suppressions.d.ts","sourceRoot":"","sources":["../../src/checks/suppressions.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,MAAM,EAAoB,MAAM,eAAe,CAAA;AAC7D,OAAO,EAAU,KAAK,UAAU,EAAU,MAAM,YAAY,CAAA;AAgD5D,yEAAyE;AACzE,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,KAAG,UA4C9C,CAAA"}
@@ -7,33 +7,53 @@
7
7
  // a separate informational report such as dependency freshness.
8
8
  import { existsSync, readFileSync, statSync } from 'node:fs';
9
9
  import path from 'node:path';
10
- import { countSourceLines, findSuppressions, isGovernedCode, judgeSuppressions, } from '@ploaness/governance';
11
- import { trackedFiles } from '../context.js';
10
+ import { countSourceLines, findSuppressions, hasExtension, isGovernedCode, isOxlintSuppression, judgeSuppressions, OXLINT_EXTENSIONS, oxlintSourceFiles, } from '@ploaness/governance';
11
+ import { workingTreeFiles } from '../context.js';
12
12
  import { failed, passed } from '../exec.js';
13
+ import { sourceComments } from '../source-comments.js';
13
14
  import { managedPaths } from './assets.js';
14
15
  const isUnderSourceRoots = (file, sourceRoots) => sourceRoots.some((sourceRoot) => file.startsWith(`${sourceRoot}/`));
15
- /** Count suppressions and source lines across the project's own code. */
16
- export const suppressions = (context) => {
17
- const excluded = context.settings.typographyExclusions;
18
- // A managed file is ploaness's, byte for byte, and the project can neither remove a suppression
19
- // inside it nor be asked to justify one. Its lines are left out of the denominator for the same
20
- // reason: a ceiling earned by code the project did not write would be an allowance, not a measure.
16
+ const sitesOf = (scanned) => [
17
+ ...findSuppressions(scanned.file, scanned.content),
18
+ ...(hasExtension(scanned.file, OXLINT_EXTENSIONS)
19
+ ? sourceComments(scanned.content, scanned.file)
20
+ .filter(isOxlintSuppression)
21
+ .map((comment) => ({
22
+ file: scanned.file,
23
+ line: comment.line,
24
+ token: 'oxlint-disable',
25
+ }))
26
+ : []),
27
+ ];
28
+ const eligibleFiles = (context, inventory, native) => {
21
29
  const managed = managedPaths(context);
22
- // A tracked path is not always a regular file: a symlink and a submodule gitlink both appear here.
23
- const files = trackedFiles(context.root).filter((file) => {
30
+ const excluded = context.settings.typographyExclusions;
31
+ return inventory.filter((file) => {
24
32
  const full = path.join(context.root, file);
25
- return (isUnderSourceRoots(file, context.settings.sourceRoots) &&
33
+ return ((hasExtension(file, OXLINT_EXTENSIONS)
34
+ ? native.has(file)
35
+ : isUnderSourceRoots(file, context.settings.sourceRoots)) &&
26
36
  !managed.has(file) &&
27
37
  isGovernedCode(file, excluded) &&
28
38
  existsSync(full) &&
29
39
  statSync(full).isFile());
30
40
  });
41
+ };
42
+ /** Count suppressions and source lines across the project's own code. */
43
+ export const suppressions = (context) => {
44
+ // A managed file is ploaness's, byte for byte, and the project can neither remove a suppression
45
+ // inside it nor be asked to justify one. Its lines are left out of the denominator for the same
46
+ // reason: a ceiling earned by code the project did not write would be an allowance, not a measure.
47
+ // An enumerated path is not always a regular file: a symlink and a submodule gitlink both appear here.
48
+ const inventory = workingTreeFiles(context.root);
49
+ const native = new Set(oxlintSourceFiles(inventory, context.settings.generatedArtefacts, context.siblingPaths));
50
+ const files = eligibleFiles(context, inventory, native);
31
51
  // Read once, then derive both figures from the same contents rather than accumulating as we go.
32
52
  const contents = files.map((file) => ({
33
53
  file,
34
54
  content: readFileSync(path.join(context.root, file), 'utf8'),
35
55
  }));
36
- const sites = contents.flatMap((scanned) => findSuppressions(scanned.file, scanned.content));
56
+ const sites = contents.flatMap((scanned) => sitesOf(scanned));
37
57
  const sourceLines = contents.reduce((total, scanned) => total + countSourceLines(scanned.content), 0);
38
58
  const report = judgeSuppressions(sites, sourceLines, context.settings.maxSuppressions);
39
59
  const summary = `${String(report.count)} of ${String(report.ceiling)} permitted, ` +
@@ -1 +1 @@
1
- {"version":3,"file":"suppressions.js","sourceRoot":"","sources":["../../src/checks/suppressions.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,EAAE;AACF,uGAAuG;AACvG,wGAAwG;AACxG,kGAAkG;AAClG,wGAAwG;AACxG,gEAAgE;AAChE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,GAGlB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAgB,YAAY,EAAE,MAAM,eAAe,CAAA;AAC1D,OAA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AAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CACrF;KACF,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../src/checks/tailwind.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAU,KAAK,UAAU,EAAU,MAAM,YAAY,CAAA;AAc5D,gGAAgG;AAChG,eAAO,MAAM,cAAc,GAAI,SAAS,OAAO,KAAG,UAejD,CAAA"}
1
+ {"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../../src/checks/tailwind.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,OAAO,EAAoB,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAU,KAAK,UAAU,EAAU,MAAM,YAAY,CAAA;AAc5D,gGAAgG;AAChG,eAAO,MAAM,cAAc,GAAI,SAAS,OAAO,KAAG,UAejD,CAAA"}