@on-par/factory-core 0.9.8-next.82 → 0.9.8-next.84
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.
- package/dist/phases/build-lint-rules.d.ts +6 -0
- package/dist/phases/build-lint-rules.d.ts.map +1 -1
- package/dist/phases/build-lint-rules.js +45 -13
- package/dist/phases/build-lint-rules.js.map +1 -1
- package/dist/run/stack-slice-entry.d.ts +4 -1
- package/dist/run/stack-slice-entry.d.ts.map +1 -1
- package/dist/run/stack-slice-entry.js +11 -3
- package/dist/run/stack-slice-entry.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { LintConfigProbe } from '../checkers/probe.js';
|
|
2
2
|
export declare const LINT_RULES_HEADING = "## Lint rules in force";
|
|
3
|
+
export declare const LINT_RULES_CAP = 40;
|
|
3
4
|
/** Top-level error-severity rule names from a parsed oxlint config; unsafe names are dropped and counted. */
|
|
4
5
|
export declare function collectOxlintErrorRules(config: unknown): {
|
|
5
6
|
rules: string[];
|
|
6
7
|
unsafe: number;
|
|
7
8
|
};
|
|
9
|
+
/** Error-severity rule keys scraped from oxlint.config.* source text (regex, no evaluation); unsafe names are dropped and counted. */
|
|
10
|
+
export declare function extractOxlintErrorRulesFromText(source: string): {
|
|
11
|
+
rules: string[];
|
|
12
|
+
unsafe: number;
|
|
13
|
+
};
|
|
8
14
|
/** Pointer section naming the linter and its config path; never reads the config (#3041). */
|
|
9
15
|
export declare function renderLintConfigPointer(probe: LintConfigProbe): string;
|
|
10
16
|
/** Markdown section (leading blank line) for the BUILD prompt, or '' when there is nothing to say. Never throws. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-lint-rules.d.ts","sourceRoot":"","sources":["../../src/phases/build-lint-rules.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAI5D,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"build-lint-rules.d.ts","sourceRoot":"","sources":["../../src/phases/build-lint-rules.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAI5D,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAG3D,eAAO,MAAM,cAAc,KAAK,CAAC;AAYjC,6GAA6G;AAC7G,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,OAAO,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAY5F;AAOD,sIAAsI;AACtI,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAWnG;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAMtE;AAED,oHAAoH;AACpH,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAuC9E"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
// src/phases/build-lint-rules.ts — "Lint rules in force" BUILD prompt section from .oxlintrc.json (#3040); ESLint/Biome get a config pointer (#3041)
|
|
1
|
+
// src/phases/build-lint-rules.ts — "Lint rules in force" BUILD prompt section from .oxlintrc.json (#3040) or oxlint.config.* read as text, never evaluated (#3042); ESLint/Biome get a config pointer (#3041)
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { detectLintConfig } from '../checkers/probe.js';
|
|
5
5
|
import { UNTRUSTED_LINT_CONFIG_NOTICE, wrapUntrustedLintConfig } from '../utils/untrusted-input.js';
|
|
6
6
|
export const LINT_RULES_HEADING = '## Lint rules in force';
|
|
7
|
+
// Max rules listed in the prompt; the rest are counted, not named (#3042).
|
|
8
|
+
export const LINT_RULES_CAP = 40;
|
|
7
9
|
const LINTER_NAMES = { oxlint: 'oxlint', eslint: 'ESLint', biome: 'Biome' };
|
|
8
10
|
// oxlint AllowWarnDeny: "error" | "deny" | 2 are error severity.
|
|
9
11
|
const ERROR_SEVERITIES = new Set(['error', 'deny', 2]);
|
|
@@ -29,6 +31,25 @@ export function collectOxlintErrorRules(config) {
|
|
|
29
31
|
}
|
|
30
32
|
return { rules: rules.sort(), unsafe };
|
|
31
33
|
}
|
|
34
|
+
const BLOCK_COMMENT = /\/\*[\s\S]*?\*\//g;
|
|
35
|
+
const LINE_COMMENT = /(^|[^:'"\\])\/\/.*$/gm;
|
|
36
|
+
const ERROR_PAIR = /(?:(['"`])([^'"`\n]{1,300})\1|([A-Za-z_$][\w$-]*))\s*:\s*\[?\s*(?:(['"`])(?:error|deny)\4|2(?![\w.]))/gi;
|
|
37
|
+
/** Error-severity rule keys scraped from oxlint.config.* source text (regex, no evaluation); unsafe names are dropped and counted. */
|
|
38
|
+
export function extractOxlintErrorRulesFromText(source) {
|
|
39
|
+
const stripped = source.replace(BLOCK_COMMENT, '').replace(LINE_COMMENT, '$1');
|
|
40
|
+
const names = new Set();
|
|
41
|
+
for (const match of stripped.matchAll(ERROR_PAIR))
|
|
42
|
+
names.add(match[2] ?? match[3]);
|
|
43
|
+
const rules = [];
|
|
44
|
+
let unsafe = 0;
|
|
45
|
+
for (const name of names) {
|
|
46
|
+
if (SAFE_RULE_NAME.test(name))
|
|
47
|
+
rules.push(name);
|
|
48
|
+
else
|
|
49
|
+
unsafe++;
|
|
50
|
+
}
|
|
51
|
+
return { rules: rules.sort(), unsafe };
|
|
52
|
+
}
|
|
32
53
|
/** Pointer section naming the linter and its config path; never reads the config (#3041). */
|
|
33
54
|
export function renderLintConfigPointer(probe) {
|
|
34
55
|
const exec = probe.executable ? ' It is a JS/TS module, so it was not evaluated.' : '';
|
|
@@ -43,26 +64,37 @@ export async function renderLintRulesInForce(worktree) {
|
|
|
43
64
|
return '';
|
|
44
65
|
if (probe.linter === 'eslint' || probe.linter === 'biome')
|
|
45
66
|
return renderLintConfigPointer(probe);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
try {
|
|
50
|
-
parsed = JSON.parse(await readFile(join(worktree, probe.configPath), 'utf-8'));
|
|
67
|
+
let found;
|
|
68
|
+
if (probe.format === 'executable') {
|
|
69
|
+
found = extractOxlintErrorRulesFromText(await readFile(join(worktree, probe.configPath), 'utf-8'));
|
|
51
70
|
}
|
|
52
|
-
|
|
53
|
-
parsed
|
|
71
|
+
else if (probe.format === 'json') {
|
|
72
|
+
let parsed;
|
|
73
|
+
try {
|
|
74
|
+
parsed = JSON.parse(await readFile(join(worktree, probe.configPath), 'utf-8'));
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
parsed = undefined;
|
|
78
|
+
}
|
|
79
|
+
if (!isPlainObject(parsed)) {
|
|
80
|
+
return `\n\n${LINT_RULES_HEADING}\nThe repo configures oxlint in \`${probe.configPath}\`, but it could not be parsed as JSON, so its rules are not listed here. Run the repo's lint command to see them.`;
|
|
81
|
+
}
|
|
82
|
+
found = collectOxlintErrorRules(parsed);
|
|
54
83
|
}
|
|
55
|
-
|
|
56
|
-
return
|
|
84
|
+
else {
|
|
85
|
+
return '';
|
|
57
86
|
}
|
|
58
|
-
const { rules, unsafe } =
|
|
87
|
+
const { rules, unsafe } = found;
|
|
59
88
|
if (rules.length === 0 && unsafe === 0)
|
|
60
89
|
return '';
|
|
61
|
-
const
|
|
90
|
+
const shown = rules.slice(0, LINT_RULES_CAP);
|
|
91
|
+
const leftOut = rules.length - shown.length;
|
|
92
|
+
const list = wrapUntrustedLintConfig(shown.map((r) => `- ${r}`).join('\n'));
|
|
62
93
|
const omitted = unsafe > 0 ? `\n${unsafe} rule name(s) omitted (unsafe characters).` : '';
|
|
94
|
+
const capped = leftOut > 0 ? `\n${leftOut} more rule(s) left out (list capped at ${LINT_RULES_CAP}).` : '';
|
|
63
95
|
return (`\n\n${LINT_RULES_HEADING}\n` +
|
|
64
96
|
`oxlint (\`${probe.configPath}\`) reports these rules as errors, and CHECK's lint step fails on them. Write code that satisfies them:\n` +
|
|
65
|
-
`${UNTRUSTED_LINT_CONFIG_NOTICE}\n${list}${omitted}`);
|
|
97
|
+
`${UNTRUSTED_LINT_CONFIG_NOTICE}\n${list}${omitted}${capped}`);
|
|
66
98
|
}
|
|
67
99
|
catch {
|
|
68
100
|
return '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-lint-rules.js","sourceRoot":"","sources":["../../src/phases/build-lint-rules.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"build-lint-rules.js","sourceRoot":"","sources":["../../src/phases/build-lint-rules.ts"],"names":[],"mappings":"AAAA,8MAA8M;AAE9M,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEpG,MAAM,CAAC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAE3D,2EAA2E;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,MAAM,YAAY,GAA8C,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAEvH,iEAAiE;AACjE,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAU,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AAChE,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,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I,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5E,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,MAAM,4CAA4C,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1F,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,0CAA0C,cAAc,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3G,OAAO,CACL,OAAO,kBAAkB,IAAI;YAC7B,aAAa,KAAK,CAAC,UAAU,2GAA2G;YACxI,GAAG,4BAA4B,KAAK,IAAI,GAAG,OAAO,GAAG,MAAM,EAAE,CAC9D,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -2,7 +2,10 @@ import type { PlanResult } from '../phases/plan.js';
|
|
|
2
2
|
import type { RunOutcome } from './outcome.js';
|
|
3
3
|
import type { RunPorts, RunRequest } from './run-issue.js';
|
|
4
4
|
type PlanSlice = NonNullable<PlanResult['slice']>;
|
|
5
|
-
/** Runs one pass per slice: while a stack-mode pass is ready and
|
|
5
|
+
/** Runs one pass per slice: while a stack-mode pass is ready and neither the top slice nor the slice cap
|
|
6
|
+
* (`maxSlices`, ADR-0156), plans the next one. Any non-ready slice outcome (a CHECK park, escalation or
|
|
7
|
+
* environment release, or any earlier park) ends the chain. That outcome is returned as the run's outcome,
|
|
8
|
+
* and later slices are never planned, branched or built (#3061). */
|
|
6
9
|
export declare function runStackLoop(request: RunRequest, runOnce: (request: RunRequest) => Promise<RunOutcome>): Promise<RunOutcome>;
|
|
7
10
|
/** Creates slice k's branch from its parent ref and records it in the slice plan comment, before BUILD.
|
|
8
11
|
* Returns the recorded slice and the request rebound to the slice branch, or the parked outcome. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-slice-entry.d.ts","sourceRoot":"","sources":["../../src/run/stack-slice-entry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stack-slice-entry.d.ts","sourceRoot":"","sources":["../../src/run/stack-slice-entry.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG3D,KAAK,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AAMlD;;;qEAGqE;AACrE,wBAAsB,YAAY,CAChC,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,GACpD,OAAO,CAAC,UAAU,CAAC,CAiBrB;AAED;qGACqG;AACrG,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,QAAQ,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CAChD,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC,CAiC/E"}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
// packages/core/src/run/stack-slice-entry.ts — ADR-0161: stack mode builds every slice in one run, each on its parent's branch.
|
|
2
2
|
import { upsertSlicePlanComment } from '../readiness/slice-plan-github.js';
|
|
3
|
-
import { parentRefForSlice, stackSliceBranch, withSliceBranchCreated } from '../readiness/slice-plan.js';
|
|
3
|
+
import { DEFAULT_MAX_SLICES, parentRefForSlice, stackSliceBranch, withSliceBranchCreated, } from '../readiness/slice-plan.js';
|
|
4
4
|
import { createStackSliceBranch } from './stack-slice-branch.js';
|
|
5
5
|
function errorMessage(err) {
|
|
6
6
|
return err instanceof Error ? err.message : String(err);
|
|
7
7
|
}
|
|
8
|
-
/** Runs one pass per slice: while a stack-mode pass is ready and
|
|
8
|
+
/** Runs one pass per slice: while a stack-mode pass is ready and neither the top slice nor the slice cap
|
|
9
|
+
* (`maxSlices`, ADR-0156), plans the next one. Any non-ready slice outcome (a CHECK park, escalation or
|
|
10
|
+
* environment release, or any earlier park) ends the chain. That outcome is returned as the run's outcome,
|
|
11
|
+
* and later slices are never planned, branched or built (#3061). */
|
|
9
12
|
export async function runStackLoop(request, runOnce) {
|
|
10
13
|
let outcome = await runOnce(request);
|
|
14
|
+
// The slice-gate parks a fresh plan above the cap at PLAN, so through the gate no slice is built. The
|
|
15
|
+
// loop enforces the cap too, so it holds if the gate is bypassed: at most min(plan length, maxSlices)
|
|
16
|
+
// slices are built; the run stops after slice `limit`, returns its ready outcome, and leaves later
|
|
17
|
+
// slices pending.
|
|
18
|
+
const stackLimit = (count) => Math.min(count, request.maxSlices ?? DEFAULT_MAX_SLICES);
|
|
11
19
|
while (request.sizeGateMode === 'stack' &&
|
|
12
20
|
!request.resumeFrom &&
|
|
13
21
|
outcome.state === 'ready' &&
|
|
14
22
|
outcome.slice !== undefined &&
|
|
15
|
-
outcome.slice.index < outcome.slice.count) {
|
|
23
|
+
outcome.slice.index < stackLimit(outcome.slice.count)) {
|
|
16
24
|
outcome = await runOnce({ ...request, sliceIndex: outcome.slice.index + 1 });
|
|
17
25
|
}
|
|
18
26
|
return outcome;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-slice-entry.js","sourceRoot":"","sources":["../../src/run/stack-slice-entry.ts"],"names":[],"mappings":"AAAA,gIAAgI;AAChI,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,
|
|
1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AI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,oBAAoB,MAAM,+BAA+B,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;IAC/G,CAAC;IACD,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,KAAK,aAAa,MAAM,SAAS,MAAM,EAAE,CAAC,CAAC;IAC/E,OAAO;QACL,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;QAChC,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;KACjF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@on-par/factory-core",
|
|
3
|
-
"version": "0.9.8-next.
|
|
3
|
+
"version": "0.9.8-next.84",
|
|
4
4
|
"description": "Core engine: model router, constitutions, checkers, and pipeline phases for the Software Factory.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"prepack": "node ../../scripts/pack-hygiene-cli.ts prepack"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@on-par/adr-kit": "0.9.8-next.
|
|
58
|
-
"@on-par/contracts": "0.9.8-next.
|
|
59
|
-
"@on-par/factory-config": "0.9.8-next.
|
|
60
|
-
"@on-par/repo-context": "0.9.8-next.
|
|
57
|
+
"@on-par/adr-kit": "0.9.8-next.84",
|
|
58
|
+
"@on-par/contracts": "0.9.8-next.84",
|
|
59
|
+
"@on-par/factory-config": "0.9.8-next.84",
|
|
60
|
+
"@on-par/repo-context": "0.9.8-next.84",
|
|
61
61
|
"@octokit/rest": "^22.0.0",
|
|
62
62
|
"execa": "^10.1.0",
|
|
63
63
|
"gray-matter": "^4.0.3",
|