axstack 0.74.0 → 0.76.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.
- package/README.md +2 -1
- package/docs/getting-started.md +2 -1
- package/docs/installation.md +3 -1
- package/docs/workflows.md +4 -2
- package/package.json +1 -1
- package/profiles/presets/claude-only.json +2 -2
- package/profiles/presets/codex-only.json +2 -2
- package/profiles/presets/mixed.json +2 -2
- package/skills/axstack/references/pr-triage-collect.js +196 -0
- package/skills/axstack/references/pr-triage-nightly.md +17 -25
- package/skills/axstack/references/role-roster.md +2 -0
- package/skills/axstack/scripts/mermaid-check.js +549 -0
- package/skills/axstack/vendor/pele/LICENSE +40 -0
- package/skills/axstack/vendor/pele/PROVENANCE.md +8 -0
- package/skills/axstack/vendor/pele/pele.js +149 -0
- package/skills/axstack-explain/SKILL.md +15 -10
- package/skills/axstack-explain/references/architecture-diagram.md +8 -4
- package/skills/axstack-explain/references/fidelity.md +4 -5
- package/skills/axstack-explain/references/inline-pages.md +33 -1
- package/skills/axstack-explain/references/mermaid.md +165 -0
- package/skills/axstack-explain/references/visual-qa.md +5 -1
- package/skills/axstack-publish/SKILL.md +7 -0
- package/skills/voa/SKILL.md +11 -14
- package/skills/voa/references/native-inventory.exec.js +50 -0
- package/skills/voa/references/native-inventory.js +152 -0
package/README.md
CHANGED
|
@@ -92,7 +92,8 @@ and [guides](docs/guides.md) for features, reviews, watches, debugging and relea
|
|
|
92
92
|
| Understand | [axstack-anatomy](skills/axstack-anatomy/SKILL.md) | Build an isometric physical-object figure with the vendored anatomy kit. |
|
|
93
93
|
| Understand | [axstack-work-chat](skills/axstack-work-chat/SKILL.md) | Answer a scoped Slack or Teams question from a transcript or authorized thread or message link. |
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
Diagram-led explanations default to prose and native Mermaid fences in chat.
|
|
96
|
+
Non-diagram layouts default to checked inline T3 pages.
|
|
96
97
|
Use Anatomy only on an explicit isometric or physical-object figure request.
|
|
97
98
|
Every Explain visual is authored and independently reviewed; plain prose stays proportional.
|
|
98
99
|
[Architecture diagrams](skills/axstack-explain/references/architecture-diagram.md) add scout grounding,
|
package/docs/getting-started.md
CHANGED
|
@@ -47,7 +47,8 @@ PRs/chains use Git and `gh pr`. With this harness target, check also reports the
|
|
|
47
47
|
owned instruction binding. Any reported gap exits 1; follow
|
|
48
48
|
[troubleshooting](installation.md#exit-codes-and-troubleshooting) before starting a task.
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
Diagram-led explanations default to prose and native Mermaid fences in chat.
|
|
51
|
+
Non-diagram layouts default to checked inline T3 pages.
|
|
51
52
|
Use Anatomy only on an explicit isometric or physical-object figure request.
|
|
52
53
|
Every Explain visual receives author and reviewer dispatches. Spec approval readbacks also
|
|
53
54
|
use inline pages, identifying the revision you approve.
|
package/docs/installation.md
CHANGED
|
@@ -75,7 +75,9 @@ the settings sidecar preserves the value while any other install still owns it.
|
|
|
75
75
|
- `--yes` confirms writes under the user's home directory. Tests use temporary
|
|
76
76
|
homes and fixtures only.
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
Diagram-led explanations default to prose and native Mermaid fences in chat.
|
|
79
|
+
Non-diagram layouts default to checked inline T3 pages.
|
|
80
|
+
Use Anatomy only on an explicit
|
|
79
81
|
isometric or physical-object figure request. The driver authors ordinary inline
|
|
80
82
|
HTML and chat Mermaid, with an optional specialist author. Anatomy keeps
|
|
81
83
|
delegated authorship. Every visual receives independent review through the
|
package/docs/workflows.md
CHANGED
|
@@ -52,7 +52,8 @@ Direct routes need no spec ceremony:
|
|
|
52
52
|
- [axstack-anatomy](../skills/axstack-anatomy/SKILL.md) builds an isometric,
|
|
53
53
|
physical-object, or anatomy-style figure with the vendored kit and Bun.
|
|
54
54
|
- `axstack-explain` separates implemented, intended, tested, live, and unknown
|
|
55
|
-
behavior.
|
|
55
|
+
behavior. Diagram-led explanations default to prose and native Mermaid
|
|
56
|
+
fences in chat. Non-diagram layouts default to checked inline T3 pages.
|
|
56
57
|
The driver authors ordinary inline HTML and chat Mermaid; `axstack-explainer`
|
|
57
58
|
is optional for these and retains other visual authorship, including Anatomy.
|
|
58
59
|
Every visual is independently reviewed by `axstack-explainer-review`;
|
|
@@ -65,7 +66,8 @@ Direct routes need no spec ceremony:
|
|
|
65
66
|
Whole-work understanding and defense covers high-level flow, decisions,
|
|
66
67
|
data/state, misbehaviour at trust boundaries and visible failure, with open
|
|
67
68
|
evidence gaps. Narrow questions stay proportional.
|
|
68
|
-
Explain
|
|
69
|
+
Explain uses [Mermaid](../skills/axstack-explain/references/mermaid.md) for
|
|
70
|
+
diagrams and embeds checked, pre-rendered SVG in requested HTML artifacts.
|
|
69
71
|
Use Anatomy only on an explicit isometric or physical-object figure request.
|
|
70
72
|
- `axstack-improve` returns a small ranked set of evidenced improvement
|
|
71
73
|
candidates without editing code. Its test-audit lens marks every declaration
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axstack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.76.0",
|
|
4
4
|
"description": "Axstack installer and setup CLI: installs owned chat skills and role data, configures supported harness settings, and checks T3 Code capabilities.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"provider": "claude",
|
|
144
144
|
"modeId": "bypassPermissions",
|
|
145
145
|
"thinkingOptionId": "medium",
|
|
146
|
-
"notes": "Visual author: for Explain, the driver authors ordinary inline HTML and chat Mermaid by default. Optional specialist for those visuals; retains other visual authorship, including anatomy figures, with source fidelity. T3 resolves Claude classes from saved capabilities; a Claude rejection holds. Also authors Publish article adaptations.",
|
|
146
|
+
"notes": "Visual author: for Explain, the driver authors ordinary inline HTML and chat Mermaid by default. Optional specialist for those visuals; retains other visual authorship, including anatomy figures, with source fidelity. Diagram authors follow the Explain mermaid.md reference. T3 resolves Claude classes from saved capabilities; a Claude rejection holds. Also authors Publish article adaptations.",
|
|
147
147
|
"modelClass": "opus",
|
|
148
148
|
"model": "claude-opus-5-5"
|
|
149
149
|
},
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"provider": "claude",
|
|
154
154
|
"modeId": "bypassPermissions",
|
|
155
155
|
"thinkingOptionId": "medium",
|
|
156
|
-
"notes": "Independent explanation reviewer: always reviews every visual. Reviews consequential or complex driver-written prose or on request. Checks the exact artifact for text and source fidelity, including the full claim set on the first and every subsequent review, including conditions, branches, complete cited source ranges and regression of prior findings. The browser interaction pass belongs to axstack-ui-verifier. Any artifact change invalidates its review. T3 resolves Claude classes from saved capabilities; a Claude rejection holds. Design review follows design.md hard rules, the neon.md palette and FRONTEND-DESIGN.md as lead design and craft authority (including calibration defaults, restraint and quality floor) for every inline HTML page, every non-anatomy standalone HTML file and every Publish article adaptation. For non-anatomy Explain inline pages, the reviewer inspects the driver's final-byte html_preview screenshots at 728px dark and 360px light bound to the artifact SHA-256. Missing, stale, unreadable or inadequate preview evidence requires fresh capture before review. Reuse adequate driver evidence while retaining layout, accessibility, theme and fit checks. For anatomy inline pages the reviewer itself renders exact bytes with html_preview at 728px dark and 360px light as a non-publishing self-check. For Publish the reviewer opens axstack-ui-verifier PNGs at 360px, 390px mobile, 728px and 1440px desktop, all four widths dark, with paths bound to the artifact SHA-256 and recorded before review. With an explicit user theme, the PNGs show that theme at the same four widths. Inspect the 1440px desktop screenshot for balanced composition, intentional horizontal margins, bounded prose measure, typography, section spacing and chart legibility. Inspect the 360px and 390px mobile screenshots for gutters, readable text and chart labels. A page failing to look decent is a blocking design finding, repaired by the same author. For Anatomy and Publish only, retain Delivery's design-only exception. Never describe a remaining finding as fixed or a clean pass. Apply Delivery's progress-based repairs and dependency holds; repair count alone never abandons the requested format. Apply Delivery's normal holds for other failures and unknown renders. Chat Mermaid and anatomy keep their existing review.",
|
|
156
|
+
"notes": "Independent explanation reviewer: always reviews every visual. Reviews consequential or complex driver-written prose or on request. Checks the exact artifact for text and source fidelity, including the full claim set on the first and every subsequent review, including conditions, branches, complete cited source ranges and regression of prior findings. The browser interaction pass belongs to axstack-ui-verifier. Any artifact change invalidates its review. T3 resolves Claude classes from saved capabilities; a Claude rejection holds. Design review follows design.md hard rules, the neon.md palette and FRONTEND-DESIGN.md as lead design and craft authority (including calibration defaults, restraint and quality floor) for every inline HTML page, every non-anatomy standalone HTML file and every Publish article adaptation. For non-anatomy Explain inline pages, the reviewer inspects the driver's final-byte html_preview screenshots at 728px dark and 360px light bound to the artifact SHA-256. Missing, stale, unreadable or inadequate preview evidence requires fresh capture before review. Reuse adequate driver evidence while retaining layout, accessibility, theme and fit checks. For anatomy inline pages the reviewer itself renders exact bytes with html_preview at 728px dark and 360px light as a non-publishing self-check. For Publish the reviewer opens axstack-ui-verifier PNGs at 360px, 390px mobile, 728px and 1440px desktop, all four widths dark, with paths bound to the artifact SHA-256 and recorded before review. With an explicit user theme, the PNGs show that theme at the same four widths. Inspect the 1440px desktop screenshot for balanced composition, intentional horizontal margins, bounded prose measure, typography, section spacing and chart legibility. Inspect the 360px and 390px mobile screenshots for gutters, readable text and chart labels. A page failing to look decent is a blocking design finding, repaired by the same author. For Anatomy and Publish only, retain Delivery's design-only exception. Never describe a remaining finding as fixed or a clean pass. Apply Delivery's progress-based repairs and dependency holds; repair count alone never abandons the requested format. Apply Delivery's normal holds for other failures and unknown renders. Chat Mermaid and anatomy keep their existing review. Rerun mermaid-check.js on the exact reviewed Mermaid source and follow mermaid.md for render proof.",
|
|
157
157
|
"modelClass": "sonnet"
|
|
158
158
|
},
|
|
159
159
|
{
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"provider": "codex",
|
|
143
143
|
"modeId": "full-access",
|
|
144
144
|
"thinkingOptionId": "high",
|
|
145
|
-
"notes": "Visual author: for Explain, the driver authors ordinary inline HTML and chat Mermaid by default. Optional specialist for those visuals; retains other visual authorship, including anatomy figures, with source fidelity. Resolve the class from saved T3 capabilities at run start; rejection and unavailable settings hold without substitution. Also authors Publish article adaptations.",
|
|
145
|
+
"notes": "Visual author: for Explain, the driver authors ordinary inline HTML and chat Mermaid by default. Optional specialist for those visuals; retains other visual authorship, including anatomy figures, with source fidelity. Diagram authors follow the Explain mermaid.md reference. Resolve the class from saved T3 capabilities at run start; rejection and unavailable settings hold without substitution. Also authors Publish article adaptations.",
|
|
146
146
|
"modelClass": "sol"
|
|
147
147
|
},
|
|
148
148
|
{
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"provider": "codex",
|
|
152
152
|
"modeId": "full-access",
|
|
153
153
|
"thinkingOptionId": "xhigh",
|
|
154
|
-
"notes": "Independent explanation reviewer: always reviews every visual. Reviews consequential or complex driver-written prose or on request. Checks the exact artifact for text and source fidelity, including the full claim set on the first and every subsequent review, including conditions, branches, complete cited source ranges and regression of prior findings. The browser interaction pass belongs to axstack-ui-verifier. Any artifact change invalidates its review. Resolve the class from saved T3 capabilities at run start; rejection and unavailable settings hold without substitution. Design review follows design.md hard rules, the neon.md palette and FRONTEND-DESIGN.md as lead design and craft authority (including calibration defaults, restraint and quality floor) for every inline HTML page, every non-anatomy standalone HTML file and every Publish article adaptation. For non-anatomy Explain inline pages, the reviewer inspects the driver's final-byte html_preview screenshots at 728px dark and 360px light bound to the artifact SHA-256. Missing, stale, unreadable or inadequate preview evidence requires fresh capture before review. Reuse adequate driver evidence while retaining layout, accessibility, theme and fit checks. For anatomy inline pages the reviewer itself renders exact bytes with html_preview at 728px dark and 360px light as a non-publishing self-check. For Publish the reviewer opens axstack-ui-verifier PNGs at 360px, 390px mobile, 728px and 1440px desktop, all four widths dark, with paths bound to the artifact SHA-256 and recorded before review. With an explicit user theme, the PNGs show that theme at the same four widths. Inspect the 1440px desktop screenshot for balanced composition, intentional horizontal margins, bounded prose measure, typography, section spacing and chart legibility. Inspect the 360px and 390px mobile screenshots for gutters, readable text and chart labels. A page failing to look decent is a blocking design finding, repaired by the same author. For Anatomy and Publish only, retain Delivery's design-only exception. Never describe a remaining finding as fixed or a clean pass. Apply Delivery's progress-based repairs and dependency holds; repair count alone never abandons the requested format. Apply Delivery's normal holds for other failures and unknown renders. Chat Mermaid and anatomy keep their existing review.",
|
|
154
|
+
"notes": "Independent explanation reviewer: always reviews every visual. Reviews consequential or complex driver-written prose or on request. Checks the exact artifact for text and source fidelity, including the full claim set on the first and every subsequent review, including conditions, branches, complete cited source ranges and regression of prior findings. The browser interaction pass belongs to axstack-ui-verifier. Any artifact change invalidates its review. Resolve the class from saved T3 capabilities at run start; rejection and unavailable settings hold without substitution. Design review follows design.md hard rules, the neon.md palette and FRONTEND-DESIGN.md as lead design and craft authority (including calibration defaults, restraint and quality floor) for every inline HTML page, every non-anatomy standalone HTML file and every Publish article adaptation. For non-anatomy Explain inline pages, the reviewer inspects the driver's final-byte html_preview screenshots at 728px dark and 360px light bound to the artifact SHA-256. Missing, stale, unreadable or inadequate preview evidence requires fresh capture before review. Reuse adequate driver evidence while retaining layout, accessibility, theme and fit checks. For anatomy inline pages the reviewer itself renders exact bytes with html_preview at 728px dark and 360px light as a non-publishing self-check. For Publish the reviewer opens axstack-ui-verifier PNGs at 360px, 390px mobile, 728px and 1440px desktop, all four widths dark, with paths bound to the artifact SHA-256 and recorded before review. With an explicit user theme, the PNGs show that theme at the same four widths. Inspect the 1440px desktop screenshot for balanced composition, intentional horizontal margins, bounded prose measure, typography, section spacing and chart legibility. Inspect the 360px and 390px mobile screenshots for gutters, readable text and chart labels. A page failing to look decent is a blocking design finding, repaired by the same author. For Anatomy and Publish only, retain Delivery's design-only exception. Never describe a remaining finding as fixed or a clean pass. Apply Delivery's progress-based repairs and dependency holds; repair count alone never abandons the requested format. Apply Delivery's normal holds for other failures and unknown renders. Chat Mermaid and anatomy keep their existing review. Rerun mermaid-check.js on the exact reviewed Mermaid source and follow mermaid.md for render proof.",
|
|
155
155
|
"modelClass": "luna"
|
|
156
156
|
},
|
|
157
157
|
{
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"provider": "claude",
|
|
144
144
|
"modeId": "bypassPermissions",
|
|
145
145
|
"thinkingOptionId": "medium",
|
|
146
|
-
"notes": "Visual author: for Explain, the driver authors ordinary inline HTML and chat Mermaid by default. Optional specialist for those visuals; retains other visual authorship, including anatomy figures, with source fidelity. T3 resolves Claude classes from saved capabilities; a Claude rejection holds. Also authors Publish article adaptations.",
|
|
146
|
+
"notes": "Visual author: for Explain, the driver authors ordinary inline HTML and chat Mermaid by default. Optional specialist for those visuals; retains other visual authorship, including anatomy figures, with source fidelity. Diagram authors follow the Explain mermaid.md reference. T3 resolves Claude classes from saved capabilities; a Claude rejection holds. Also authors Publish article adaptations.",
|
|
147
147
|
"modelClass": "opus",
|
|
148
148
|
"model": "claude-opus-5-5"
|
|
149
149
|
},
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"provider": "codex",
|
|
154
154
|
"modeId": "full-access",
|
|
155
155
|
"thinkingOptionId": "high",
|
|
156
|
-
"notes": "Independent Sol high explanation reviewer: always reviews every visual. Reviews consequential or complex driver-written prose or on request. Checks the exact artifact for text and source fidelity, including the full claim set on the first and every subsequent review, including conditions, branches, complete cited source ranges and regression of prior findings. The browser interaction pass belongs to axstack-ui-verifier. Any artifact change invalidates its review. Resolve the class from saved T3 capabilities at run start; rejection and unavailable settings hold without substitution. Design review follows design.md hard rules, the neon.md palette and FRONTEND-DESIGN.md as lead design and craft authority (including calibration defaults, restraint and quality floor) for every inline HTML page, every non-anatomy standalone HTML file and every Publish article adaptation. For non-anatomy Explain inline pages, the reviewer inspects the driver's final-byte html_preview screenshots at 728px dark and 360px light bound to the artifact SHA-256. Missing, stale, unreadable or inadequate preview evidence requires fresh capture before review. Reuse adequate driver evidence while retaining layout, accessibility, theme and fit checks. For anatomy inline pages the reviewer itself renders exact bytes with html_preview at 728px dark and 360px light as a non-publishing self-check. For Publish the reviewer opens axstack-ui-verifier PNGs at 360px, 390px mobile, 728px and 1440px desktop, all four widths dark, with paths bound to the artifact SHA-256 and recorded before review. With an explicit user theme, the PNGs show that theme at the same four widths. Inspect the 1440px desktop screenshot for balanced composition, intentional horizontal margins, bounded prose measure, typography, section spacing and chart legibility. Inspect the 360px and 390px mobile screenshots for gutters, readable text and chart labels. A page failing to look decent is a blocking design finding, repaired by the same author. For Anatomy and Publish only, retain Delivery's design-only exception. Never describe a remaining finding as fixed or a clean pass. Apply Delivery's progress-based repairs and dependency holds; repair count alone never abandons the requested format. Apply Delivery's normal holds for other failures and unknown renders. Chat Mermaid and anatomy keep their existing review.",
|
|
156
|
+
"notes": "Independent Sol high explanation reviewer: always reviews every visual. Reviews consequential or complex driver-written prose or on request. Checks the exact artifact for text and source fidelity, including the full claim set on the first and every subsequent review, including conditions, branches, complete cited source ranges and regression of prior findings. The browser interaction pass belongs to axstack-ui-verifier. Any artifact change invalidates its review. Resolve the class from saved T3 capabilities at run start; rejection and unavailable settings hold without substitution. Design review follows design.md hard rules, the neon.md palette and FRONTEND-DESIGN.md as lead design and craft authority (including calibration defaults, restraint and quality floor) for every inline HTML page, every non-anatomy standalone HTML file and every Publish article adaptation. For non-anatomy Explain inline pages, the reviewer inspects the driver's final-byte html_preview screenshots at 728px dark and 360px light bound to the artifact SHA-256. Missing, stale, unreadable or inadequate preview evidence requires fresh capture before review. Reuse adequate driver evidence while retaining layout, accessibility, theme and fit checks. For anatomy inline pages the reviewer itself renders exact bytes with html_preview at 728px dark and 360px light as a non-publishing self-check. For Publish the reviewer opens axstack-ui-verifier PNGs at 360px, 390px mobile, 728px and 1440px desktop, all four widths dark, with paths bound to the artifact SHA-256 and recorded before review. With an explicit user theme, the PNGs show that theme at the same four widths. Inspect the 1440px desktop screenshot for balanced composition, intentional horizontal margins, bounded prose measure, typography, section spacing and chart legibility. Inspect the 360px and 390px mobile screenshots for gutters, readable text and chart labels. A page failing to look decent is a blocking design finding, repaired by the same author. For Anatomy and Publish only, retain Delivery's design-only exception. Never describe a remaining finding as fixed or a clean pass. Apply Delivery's progress-based repairs and dependency holds; repair count alone never abandons the requested format. Apply Delivery's normal holds for other failures and unknown renders. Chat Mermaid and anatomy keep their existing review. Rerun mermaid-check.js on the exact reviewed Mermaid source and follow mermaid.md for render proof.",
|
|
157
157
|
"modelClass": "sol"
|
|
158
158
|
},
|
|
159
159
|
{
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
const HELP = `Nightly PR triage recipe: bun --no-env-file pr-triage-collect.js OWNER/REPO [OWNER/REPO ...]
|
|
2
|
+
--help Print this help without I/O beyond stdout.
|
|
3
|
+
|
|
4
|
+
Read-only: starts gh subprocesses in / and queries github.com with existing gh credentials.
|
|
5
|
+
Writes one compact JSON observation to stdout; no files, persistent state, or forge changes.
|
|
6
|
+
Paginate own open PR inventory and read details in batches of eight with at most three repositories
|
|
7
|
+
in flight. Request budgets are 10 seconds per call, 30 per repository and 90 overall.
|
|
8
|
+
Subprocess output is capped at 512 KiB per request.
|
|
9
|
+
CI and review decisions are GitHub aggregates. NONE means the pinned head has no reported rollup;
|
|
10
|
+
NO_DECISION means GitHub reports no aggregate review decision. Neither grants merge authority.
|
|
11
|
+
Review threads beyond the first 100 make the count UNKNOWN. At most two sample links are included.
|
|
12
|
+
Staleness uses GitHub updatedAt and a seven-day threshold. Rank actions in the pass thread.
|
|
13
|
+
Exit 0: complete observation. Exit 1: invalid input. Exit 2: incomplete, retain observed facts.`;
|
|
14
|
+
|
|
15
|
+
const UNKNOWN = 'UNKNOWN';
|
|
16
|
+
const DAY = 86_400_000;
|
|
17
|
+
const CI = ['ERROR', 'EXPECTED', 'FAILURE', 'PENDING', 'SUCCESS'];
|
|
18
|
+
const REVIEWS = ['APPROVED', 'CHANGES_REQUESTED', 'REVIEW_REQUIRED'];
|
|
19
|
+
const REPO = /^(?!\.{1,2}\/)[A-Za-z0-9_.-]+\/(?!\.{1,2}$)[A-Za-z0-9_.-]+$/;
|
|
20
|
+
const fold = (value) => typeof value === 'string' ? value.toLowerCase() : '';
|
|
21
|
+
const validNumber = (value) => Number.isSafeInteger(value) && value > 0;
|
|
22
|
+
const gap = (reason) => ({ status: 'unknown', reason });
|
|
23
|
+
|
|
24
|
+
async function gh(args, deadline) {
|
|
25
|
+
const timeout = Math.min(10_000, Math.ceil(deadline - performance.now()));
|
|
26
|
+
if (timeout <= 0) return null;
|
|
27
|
+
try {
|
|
28
|
+
const child = Bun.spawn(['gh', 'api', '--hostname', 'github.com', ...args], {
|
|
29
|
+
cwd: '/', env: { ...process.env, GH_PROMPT_DISABLED: '1' },
|
|
30
|
+
stdin: 'ignore', stdout: 'pipe', stderr: 'ignore', timeout, maxBuffer: 512 * 1024, killSignal: 'SIGKILL',
|
|
31
|
+
});
|
|
32
|
+
const [text, exit] = await Promise.all([child.stdout.text(), child.exited]);
|
|
33
|
+
return { text, exit };
|
|
34
|
+
} catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function query(repo, fields, deadline) {
|
|
40
|
+
const [owner, name] = repo.split('/').map((segment) => JSON.stringify(segment));
|
|
41
|
+
const document = `query { repository(owner: ${owner}, name: ${name}) { nameWithOwner ${fields} } }`;
|
|
42
|
+
const result = await gh(['graphql', '-f', `query=${document}`], deadline);
|
|
43
|
+
try {
|
|
44
|
+
const response = JSON.parse(result?.text ?? '');
|
|
45
|
+
const errors = response.errors ?? [];
|
|
46
|
+
const data = response.data?.repository;
|
|
47
|
+
if (!Array.isArray(errors) || errors.some((error) => !Array.isArray(error?.path) || !error.path.length) ||
|
|
48
|
+
(result.exit !== 0 && !errors.length) || fold(data?.nameWithOwner) !== fold(repo) ||
|
|
49
|
+
affected(errors, ['repository', 'nameWithOwner'])) return null;
|
|
50
|
+
return { data, errors };
|
|
51
|
+
} catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// A GraphQL error blocks its field and descendants, or the parent's aggregate.
|
|
57
|
+
const affected = (errors, path) => errors.some(({ path: source }) =>
|
|
58
|
+
path.slice(0, source.length).every((part, i) => part === source[i]));
|
|
59
|
+
|
|
60
|
+
async function inventory(repo, login, deadline) {
|
|
61
|
+
const own = [];
|
|
62
|
+
const seen = new Set();
|
|
63
|
+
const cursors = new Set();
|
|
64
|
+
const path = ['repository', 'pullRequests'];
|
|
65
|
+
let cursor = null;
|
|
66
|
+
let total;
|
|
67
|
+
let coverage = { status: 'pass' };
|
|
68
|
+
do {
|
|
69
|
+
const after = cursor === null ? '' : `, after: ${JSON.stringify(cursor)}`;
|
|
70
|
+
const page = await query(repo, `pullRequests(states: OPEN, first: 50${after}, orderBy: {field: CREATED_AT, direction: ASC}) {
|
|
71
|
+
totalCount nodes { number author { login } } pageInfo { hasNextPage endCursor }
|
|
72
|
+
}`, deadline);
|
|
73
|
+
const listing = page?.data.pullRequests;
|
|
74
|
+
if (!Array.isArray(listing?.nodes)) return { own, coverage: gap('inventory page unavailable') };
|
|
75
|
+
if (affected(page.errors, path)) coverage = gap('partial inventory response');
|
|
76
|
+
if (total === undefined) total = listing.totalCount;
|
|
77
|
+
if (!Number.isSafeInteger(total) || total < 0 || total !== listing.totalCount) coverage = gap('inconsistent inventory count');
|
|
78
|
+
for (const [i, pr] of listing.nodes.entries()) {
|
|
79
|
+
if (!validNumber(pr?.number) || !fold(pr?.author?.login) || seen.has(pr.number) ||
|
|
80
|
+
affected(page.errors, [...path, 'nodes', i])) {
|
|
81
|
+
coverage = gap('incomplete or duplicate inventory row');
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
seen.add(pr.number);
|
|
85
|
+
if (fold(pr.author.login) === login) own.push(pr.number);
|
|
86
|
+
}
|
|
87
|
+
const pageInfo = listing.pageInfo;
|
|
88
|
+
if (affected(page.errors, [...path, 'pageInfo']) || typeof pageInfo?.hasNextPage !== 'boolean') {
|
|
89
|
+
return { own, coverage: gap('pagination state unavailable') };
|
|
90
|
+
}
|
|
91
|
+
if (pageInfo.hasNextPage) {
|
|
92
|
+
cursor = pageInfo.endCursor;
|
|
93
|
+
if (typeof cursor !== 'string' || !cursor || cursors.has(cursor)) return { own, coverage: gap('invalid or repeated cursor') };
|
|
94
|
+
cursors.add(cursor);
|
|
95
|
+
} else cursor = null;
|
|
96
|
+
} while (cursor !== null);
|
|
97
|
+
return { own, coverage: seen.size === total ? coverage : gap('inventory row count mismatch') };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const detailFields = `number state author { login } headRefOid updatedAt isDraft mergeable reviewDecision
|
|
101
|
+
commits(last: 1) { nodes { commit { oid statusCheckRollup { state } } } }
|
|
102
|
+
reviewThreads(first: 100) { totalCount pageInfo { hasNextPage } nodes { isResolved comments(first: 1) { nodes { url } } } }`;
|
|
103
|
+
|
|
104
|
+
function threads(connection, url) {
|
|
105
|
+
const nodes = connection?.nodes;
|
|
106
|
+
if (connection?.pageInfo?.hasNextPage !== false || !Array.isArray(nodes) ||
|
|
107
|
+
nodes.length !== connection.totalCount ||
|
|
108
|
+
nodes.some((node) => typeof node?.isResolved !== 'boolean')) return { unresolvedThreads: UNKNOWN };
|
|
109
|
+
const unresolved = nodes.filter((node) => !node.isResolved);
|
|
110
|
+
const links = new Set();
|
|
111
|
+
for (const thread of unresolved) {
|
|
112
|
+
const link = thread.comments?.nodes?.[0]?.url;
|
|
113
|
+
const anchor = typeof link === 'string' && link.match(/#discussion_r\d+$/)?.[0];
|
|
114
|
+
if (anchor && fold(link) === fold(`${url}${anchor}`)) links.add(`${url}${anchor}`);
|
|
115
|
+
if (links.size === 2) break;
|
|
116
|
+
}
|
|
117
|
+
return { unresolvedThreads: unresolved.length, ...(links.size ? { threadLinks: [...links] } : {}) };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function summarize(repo, number, response, login) {
|
|
121
|
+
const url = `https://github.com/${repo}/pull/${number}`;
|
|
122
|
+
const alias = `pr${number}`;
|
|
123
|
+
const pr = response?.data[alias];
|
|
124
|
+
const reliable = (field) => !affected(response.errors, ['repository', alias, field]);
|
|
125
|
+
const known = pr?.number === number && pr.state === 'OPEN' && fold(pr.author?.login) === login &&
|
|
126
|
+
['number', 'state', 'author'].every(reliable);
|
|
127
|
+
const field = (name) => known && reliable(name) ? pr[name] : undefined;
|
|
128
|
+
const oid = field('headRefOid');
|
|
129
|
+
const head = typeof oid === 'string' && /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/.test(oid) ? oid : UNKNOWN;
|
|
130
|
+
const commits = field('commits')?.nodes;
|
|
131
|
+
const commit = commits?.length === 1 ? commits[0]?.commit : null;
|
|
132
|
+
const rollup = head !== UNKNOWN && commit?.oid === head ? commit.statusCheckRollup : undefined;
|
|
133
|
+
const ci = rollup === null ? 'NONE' : CI.includes(rollup?.state) ? rollup.state : UNKNOWN;
|
|
134
|
+
const decision = field('reviewDecision');
|
|
135
|
+
const reviews = decision === null ? 'NO_DECISION' : REVIEWS.includes(decision) ? decision : UNKNOWN;
|
|
136
|
+
const merge = field('mergeable');
|
|
137
|
+
const mergeable = ['MERGEABLE', 'CONFLICTING'].includes(merge) ? merge : UNKNOWN;
|
|
138
|
+
const updated = field('updatedAt');
|
|
139
|
+
const age = typeof updated === 'string' && /^\d{4}-\d\d-\d\dT.*Z$/.test(updated) ? Date.now() - Date.parse(updated) : NaN;
|
|
140
|
+
const stale = age >= 0 ? age >= 7 * DAY : UNKNOWN;
|
|
141
|
+
const draft = field('isDraft');
|
|
142
|
+
return { number, url, head, ci, reviews, mergeable, ...threads(field('reviewThreads'), url),
|
|
143
|
+
updatedAt: stale === UNKNOWN ? UNKNOWN : updated, stale, draft: typeof draft === 'boolean' ? draft : UNKNOWN,
|
|
144
|
+
...(['ERROR', 'FAILURE', 'PENDING', 'EXPECTED'].includes(ci) ? { checksUrl: `${url}/checks` } : {}),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
async function details(repo, numbers, login, deadline) {
|
|
149
|
+
const prs = [];
|
|
150
|
+
for (let i = 0; i < numbers.length; i += 8) {
|
|
151
|
+
const batch = numbers.slice(i, i + 8);
|
|
152
|
+
const fields = batch.map((number) => `pr${number}: pullRequest(number: ${number}) { ${detailFields} }`).join('\n');
|
|
153
|
+
const response = await query(repo, fields, deadline);
|
|
154
|
+
for (const number of batch) prs.push(summarize(repo, number, response, login));
|
|
155
|
+
}
|
|
156
|
+
return prs;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
async function inParallel(items, operation) {
|
|
160
|
+
let index = 0;
|
|
161
|
+
const result = [];
|
|
162
|
+
await Promise.all(Array.from({ length: Math.min(3, items.length) }, async () => {
|
|
163
|
+
while (index < items.length) {
|
|
164
|
+
const i = index++;
|
|
165
|
+
result[i] = await operation(items[i]);
|
|
166
|
+
}
|
|
167
|
+
}));
|
|
168
|
+
return result;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
async function collect(repos) {
|
|
172
|
+
const deadline = performance.now() + 90_000;
|
|
173
|
+
const identity = await gh(['user', '--jq', '.login'], deadline);
|
|
174
|
+
const login = identity?.text.trim();
|
|
175
|
+
if (identity?.exit !== 0 || !/^[A-Za-z0-9-]+$/.test(login ?? '')) return {
|
|
176
|
+
login: UNKNOWN, repositories: repos.map((repo) => ({ repo, coverage: gap('forge identity unavailable'), prs: [] })),
|
|
177
|
+
};
|
|
178
|
+
const repositories = await inParallel(repos, async (repo) => {
|
|
179
|
+
const repoDeadline = Math.min(deadline, performance.now() + 30_000);
|
|
180
|
+
const { own, coverage } = await inventory(repo, fold(login), repoDeadline);
|
|
181
|
+
return { repo, coverage, prs: await details(repo, own, fold(login), repoDeadline) };
|
|
182
|
+
});
|
|
183
|
+
return { login, repositories };
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const args = process.argv.slice(2);
|
|
187
|
+
if (args.length === 1 && args[0] === '--help') console.log(HELP);
|
|
188
|
+
else if (!args.length || args.some((repo) => !REPO.test(repo)) || new Set(args.map(fold)).size !== args.length) {
|
|
189
|
+
console.error('Expected a unique list of GitHub OWNER/REPO arguments. See --help.');
|
|
190
|
+
process.exitCode = 1;
|
|
191
|
+
} else {
|
|
192
|
+
const report = await collect(args);
|
|
193
|
+
console.log(JSON.stringify(report));
|
|
194
|
+
if (report.repositories.some(({ coverage, prs }) => coverage.status === 'unknown' ||
|
|
195
|
+
prs.some((pr) => Object.values(pr).includes(UNKNOWN)))) process.exitCode = 2;
|
|
196
|
+
}
|
|
@@ -1,34 +1,26 @@
|
|
|
1
1
|
# Nightly PR-triage prompt
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
At pass start,
|
|
6
|
-
|
|
3
|
+
Run a fresh read-only nightly PR-triage pass. Read-only applies to the forge.
|
|
4
|
+
Follow [Provider bindings](t3-runtime.md#preflight-and-binding) and [setup](automations.md#nightly-pr-triage-setup).
|
|
5
|
+
At pass start, read the prior pass thread with `t3_thread_read` for guarded verification or hold/report before replacing its identity. Record own pass threadId in the activation record and read back the save.
|
|
6
|
+
|
|
7
7
|
Read the durable activation record for the repository set.
|
|
8
|
-
Resolve the user with `gh api user --jq .login
|
|
9
|
-
Read all open PRs authored by the user in every repository in the recorded set,
|
|
10
|
-
|
|
8
|
+
Resolve the user with `gh api user --jq .login` through the collector.
|
|
9
|
+
Read all open PRs authored by the user in every repository in the recorded set, including all pages.
|
|
10
|
+
Set `AXSTACK_SKILL_DIR` to the installed skill directory and shell arguments to the recorded repositories.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
bun --no-env-file "${AXSTACK_SKILL_DIR}/references/pr-triage-collect.js" "$@"
|
|
14
|
+
```
|
|
11
15
|
|
|
12
|
-
Report each PR's CI, reviews, mergeable state, and unresolved threads in your
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Report incomplete repository or pagination coverage explicitly.
|
|
16
|
+
Use the compact JSON. Report each PR's CI, reviews, mergeable state, and unresolved threads in your own T3 thread.
|
|
17
|
+
Keep partial rows on exit 2. For an incomplete forge field, report `UNKNOWN`.
|
|
18
|
+
Mark coverage gaps or an unavailable collector `UNKNOWN`.
|
|
16
19
|
Flag stale PRs after 7 days of inactivity.
|
|
17
|
-
Report the top three PRs to act on
|
|
18
|
-
If fewer than three PRs exist, report those available.
|
|
20
|
+
Report the top three PRs to act on, or fewer if available, with observed reasons and evidence links.
|
|
19
21
|
Never declare a PR merge-ready.
|
|
20
|
-
|
|
21
22
|
Never merge, post comments, change labels, push, send user messages, dispatch
|
|
22
23
|
work, or launch threads.
|
|
23
24
|
|
|
24
|
-
At pass
|
|
25
|
-
|
|
26
|
-
verification or hold/report before replacing its identity.
|
|
27
|
-
Record own pass threadId in the existing activation record and read back the save.
|
|
28
|
-
|
|
29
|
-
At pass end, an unbound pass calls `t3_thread_organize` with `action: settle` on its
|
|
30
|
-
own thread only, only when it owns no PR watch, has zero unsettled descendants,
|
|
31
|
-
has no pending receipt and is not held, wedged or a stalled owner.
|
|
32
|
-
Follow [Finite-session teardown](automations.md#finite-session-teardown) for
|
|
33
|
-
deferred self-settle and next-pass verification; this applies to quiet, skipped
|
|
34
|
-
and empty passes too.
|
|
25
|
+
At pass end, an unbound pass calls `t3_thread_organize` with `action: settle` on its own thread only, only when it owns no PR watch, has zero unsettled descendants, has no pending receipt and is not held, wedged or a stalled owner.
|
|
26
|
+
Follow [Finite-session teardown](automations.md#finite-session-teardown) for deferred self-settle and next-pass verification. This applies to quiet, skipped and empty passes too.
|
|
@@ -42,10 +42,12 @@ Engineering authors and code reviewers cannot acquire this artifact authority.
|
|
|
42
42
|
- `axstack-explainer`: for Explain, the driver authors ordinary inline HTML and
|
|
43
43
|
chat Mermaid by default. The specialist can author these visuals when useful;
|
|
44
44
|
it retains other visual authorship, including anatomy figures.
|
|
45
|
+
Diagram authors follow [Mermaid](../../axstack-explain/references/mermaid.md).
|
|
45
46
|
Mixed and claude-only pin Opus 5.5 (`claude-opus-5-5`) medium exactly.
|
|
46
47
|
- `axstack-explainer-review` always reviews every visual; `codex/sol` high in mixed.
|
|
47
48
|
Consequential or complex driver-written prose keeps its review rule; every
|
|
48
49
|
whiteboard defense is consequential, in chat too.
|
|
50
|
+
Rerun the Mermaid checker on the exact reviewed diagram source.
|
|
49
51
|
- `axstack-diligence`: read-only [diligence checks](diligence.md) for authored PR
|
|
50
52
|
review rounds and bounded research, spec, ticket, receipt, and release claims.
|
|
51
53
|
Follow the [applicable diligence gate](diligence.md#applicable-diligence-gate):
|