@plainconceptsplatform/workflows 1.9.0 → 1.10.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 +1 -1
- package/dist/catalog-installation.js +2 -2
- package/dist/package-baseline.js +4 -1
- package/dist/route-processing.js +4 -1
- package/dist/worker-env.d.ts +1 -1
- package/dist/worker-env.js +6 -2
- package/dist/workflow-catalog.d.ts +3 -1
- package/dist/workflow-catalog.js +6 -0
- package/loops/actions/add-issue-labels/action.yml +50 -50
- package/loops/actions/agent-output.cjs +17 -17
- package/loops/actions/apply-agent-bundle/action.yml +24 -24
- package/loops/actions/apply-agent-comments/action.yml +42 -42
- package/loops/actions/apply-agent-labels/action.yml +55 -55
- package/loops/actions/audit-close/action.yml +13 -6
- package/loops/actions/classify-route/classify-route.sh +3 -1
- package/loops/actions/cleanup-artifacts/action.yml +91 -91
- package/loops/actions/close-agent-issues/action.yml +43 -43
- package/loops/actions/collect-doc-drift/action.yml +29 -0
- package/loops/actions/collect-doc-drift/collect-doc-drift.mjs +133 -0
- package/loops/actions/create-issue-comment/action.yml +29 -29
- package/loops/actions/download-agent-output/action.yml +53 -53
- package/loops/actions/identify-gate-subject/action.yml +4 -0
- package/loops/actions/land-pull-request/action.yml +10 -0
- package/loops/actions/land-pull-request/land-pull-request.sh +14 -0
- package/loops/actions/link-pr-to-issue/action.yml +40 -40
- package/loops/actions/list-open-issues/action.yml +33 -33
- package/loops/actions/load-issue-context/action.yml +45 -45
- package/loops/actions/merge-agent-pr/action.yml +49 -49
- package/loops/actions/remove-issue-labels/action.yml +37 -37
- package/loops/actions/report-workflow-errors/action.yml +1 -1
- package/loops/actions/update-agent-issues/action.yml +58 -58
- package/loops/actions/validate-refine-output/action.yml +6 -1
- package/loops/actions/validate-refine-output/validate-refine-output.sh +20 -2
- package/loops/actions/validate-review-output/action.yml +35 -35
- package/loops/actions/validate-triage-output/action.yml +36 -36
- package/loops/actions/verify-composite-actions/action.yml +9 -9
- package/loops/actions/verify-refine-output/action.yml +9 -9
- package/loops/actions/verify-route-matrix/action.yml +9 -9
- package/loops/actions/verify-route-matrix/verify-route-matrix.sh +38 -5
- package/loops/docs/diagrams.md +45 -2
- package/loops/templates/agentics/agentics-maintenance.yml +121 -121
- package/loops/templates/issues/bug_report.yml +109 -109
- package/loops/templates/issues/feature_request.yml +75 -75
- package/loops/workflows/agent-docs-audit.md +266 -0
- package/loops/workflows/agent-merge-gate.md +11 -7
- package/loops/workflows/agent-refine.md +61 -11
- package/loops/workflows/shared/platform-defaults.md +53 -53
- package/loops/workflows/work-router.yml +120 -3
- package/package.json +1 -1
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
name: Bug report
|
|
2
|
-
description: Report a defect
|
|
3
|
-
labels: ["bug"]
|
|
4
|
-
body:
|
|
5
|
-
- type: markdown
|
|
6
|
-
attributes:
|
|
7
|
-
value: |
|
|
8
|
-
Thanks for reporting. Do **not** include real secrets or production data use placeholders.
|
|
9
|
-
|
|
10
|
-
For security vulnerabilities, contact the team directly instead of filing a public issue.
|
|
11
|
-
- type: dropdown
|
|
12
|
-
id: severity
|
|
13
|
-
attributes:
|
|
14
|
-
label: Severity
|
|
15
|
-
options:
|
|
16
|
-
- Production-down / data loss
|
|
17
|
-
- Major broken core flow
|
|
18
|
-
- Minor broken edge case
|
|
19
|
-
- Cosmetic / polish
|
|
20
|
-
validations:
|
|
21
|
-
required: true
|
|
22
|
-
- type: dropdown
|
|
23
|
-
id: frequency
|
|
24
|
-
attributes:
|
|
25
|
-
label: Frequency
|
|
26
|
-
description: How often does this happen?
|
|
27
|
-
options:
|
|
28
|
-
- Always
|
|
29
|
-
- Intermittent
|
|
30
|
-
- Only once
|
|
31
|
-
validations:
|
|
32
|
-
required: true
|
|
33
|
-
- type: textarea
|
|
34
|
-
id: what-happened
|
|
35
|
-
attributes:
|
|
36
|
-
label: What happened?
|
|
37
|
-
description: A clear description of the bug and its impact.
|
|
38
|
-
validations:
|
|
39
|
-
required: true
|
|
40
|
-
- type: textarea
|
|
41
|
-
id: repro
|
|
42
|
-
attributes:
|
|
43
|
-
label: Steps to reproduce
|
|
44
|
-
description: How can a maintainer reproduce it?
|
|
45
|
-
placeholder: |
|
|
46
|
-
1. Go to ...
|
|
47
|
-
2. Do ...
|
|
48
|
-
3. See error
|
|
49
|
-
validations:
|
|
50
|
-
required: true
|
|
51
|
-
- type: textarea
|
|
52
|
-
id: expected
|
|
53
|
-
attributes:
|
|
54
|
-
label: Expected behavior
|
|
55
|
-
validations:
|
|
56
|
-
required: true
|
|
57
|
-
- type: dropdown
|
|
58
|
-
id: area
|
|
59
|
-
attributes:
|
|
60
|
-
label: Where does it occur?
|
|
61
|
-
options:
|
|
62
|
-
- Backend
|
|
63
|
-
- Frontend
|
|
64
|
-
- Both
|
|
65
|
-
- CLI / tooling
|
|
66
|
-
- Configuration / deployment
|
|
67
|
-
- Documentation
|
|
68
|
-
- Other
|
|
69
|
-
validations:
|
|
70
|
-
required: true
|
|
71
|
-
- type: textarea
|
|
72
|
-
id: acceptance
|
|
73
|
-
attributes:
|
|
74
|
-
label: Acceptance criteria
|
|
75
|
-
description: How will we know it's fixed? A checklist a reviewer can verify (include the test that should turn green).
|
|
76
|
-
placeholder: |
|
|
77
|
-
- [ ] ...
|
|
78
|
-
- [ ] A test that fails before the fix and passes after
|
|
79
|
-
validations:
|
|
80
|
-
required: false
|
|
81
|
-
- type: textarea
|
|
82
|
-
id: open-questions
|
|
83
|
-
attributes:
|
|
84
|
-
label: Open questions
|
|
85
|
-
description: Decisions a maintainer must make before this can be planned. Leave blank if none.
|
|
86
|
-
validations:
|
|
87
|
-
required: false
|
|
88
|
-
- type: textarea
|
|
89
|
-
id: environment
|
|
90
|
-
attributes:
|
|
91
|
-
label: Environment
|
|
92
|
-
description: Local vs deployed, branch/commit, OS, runtime versions if relevant.
|
|
93
|
-
validations:
|
|
94
|
-
required: false
|
|
95
|
-
- type: textarea
|
|
96
|
-
id: logs
|
|
97
|
-
attributes:
|
|
98
|
-
label: Logs / screenshots
|
|
99
|
-
description: Paste relevant logs or screenshots. Redact secrets and PII.
|
|
100
|
-
render: shell
|
|
101
|
-
validations:
|
|
102
|
-
required: false
|
|
103
|
-
- type: textarea
|
|
104
|
-
id: related
|
|
105
|
-
attributes:
|
|
106
|
-
label: Related links
|
|
107
|
-
description: Links to related issues, PRs, discussions, or docs. Leave blank if none.
|
|
108
|
-
validations:
|
|
109
|
-
required: false
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report a defect
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for reporting. Do **not** include real secrets or production data use placeholders.
|
|
9
|
+
|
|
10
|
+
For security vulnerabilities, contact the team directly instead of filing a public issue.
|
|
11
|
+
- type: dropdown
|
|
12
|
+
id: severity
|
|
13
|
+
attributes:
|
|
14
|
+
label: Severity
|
|
15
|
+
options:
|
|
16
|
+
- Production-down / data loss
|
|
17
|
+
- Major broken core flow
|
|
18
|
+
- Minor broken edge case
|
|
19
|
+
- Cosmetic / polish
|
|
20
|
+
validations:
|
|
21
|
+
required: true
|
|
22
|
+
- type: dropdown
|
|
23
|
+
id: frequency
|
|
24
|
+
attributes:
|
|
25
|
+
label: Frequency
|
|
26
|
+
description: How often does this happen?
|
|
27
|
+
options:
|
|
28
|
+
- Always
|
|
29
|
+
- Intermittent
|
|
30
|
+
- Only once
|
|
31
|
+
validations:
|
|
32
|
+
required: true
|
|
33
|
+
- type: textarea
|
|
34
|
+
id: what-happened
|
|
35
|
+
attributes:
|
|
36
|
+
label: What happened?
|
|
37
|
+
description: A clear description of the bug and its impact.
|
|
38
|
+
validations:
|
|
39
|
+
required: true
|
|
40
|
+
- type: textarea
|
|
41
|
+
id: repro
|
|
42
|
+
attributes:
|
|
43
|
+
label: Steps to reproduce
|
|
44
|
+
description: How can a maintainer reproduce it?
|
|
45
|
+
placeholder: |
|
|
46
|
+
1. Go to ...
|
|
47
|
+
2. Do ...
|
|
48
|
+
3. See error
|
|
49
|
+
validations:
|
|
50
|
+
required: true
|
|
51
|
+
- type: textarea
|
|
52
|
+
id: expected
|
|
53
|
+
attributes:
|
|
54
|
+
label: Expected behavior
|
|
55
|
+
validations:
|
|
56
|
+
required: true
|
|
57
|
+
- type: dropdown
|
|
58
|
+
id: area
|
|
59
|
+
attributes:
|
|
60
|
+
label: Where does it occur?
|
|
61
|
+
options:
|
|
62
|
+
- Backend
|
|
63
|
+
- Frontend
|
|
64
|
+
- Both
|
|
65
|
+
- CLI / tooling
|
|
66
|
+
- Configuration / deployment
|
|
67
|
+
- Documentation
|
|
68
|
+
- Other
|
|
69
|
+
validations:
|
|
70
|
+
required: true
|
|
71
|
+
- type: textarea
|
|
72
|
+
id: acceptance
|
|
73
|
+
attributes:
|
|
74
|
+
label: Acceptance criteria
|
|
75
|
+
description: How will we know it's fixed? A checklist a reviewer can verify (include the test that should turn green).
|
|
76
|
+
placeholder: |
|
|
77
|
+
- [ ] ...
|
|
78
|
+
- [ ] A test that fails before the fix and passes after
|
|
79
|
+
validations:
|
|
80
|
+
required: false
|
|
81
|
+
- type: textarea
|
|
82
|
+
id: open-questions
|
|
83
|
+
attributes:
|
|
84
|
+
label: Open questions
|
|
85
|
+
description: Decisions a maintainer must make before this can be planned. Leave blank if none.
|
|
86
|
+
validations:
|
|
87
|
+
required: false
|
|
88
|
+
- type: textarea
|
|
89
|
+
id: environment
|
|
90
|
+
attributes:
|
|
91
|
+
label: Environment
|
|
92
|
+
description: Local vs deployed, branch/commit, OS, runtime versions if relevant.
|
|
93
|
+
validations:
|
|
94
|
+
required: false
|
|
95
|
+
- type: textarea
|
|
96
|
+
id: logs
|
|
97
|
+
attributes:
|
|
98
|
+
label: Logs / screenshots
|
|
99
|
+
description: Paste relevant logs or screenshots. Redact secrets and PII.
|
|
100
|
+
render: shell
|
|
101
|
+
validations:
|
|
102
|
+
required: false
|
|
103
|
+
- type: textarea
|
|
104
|
+
id: related
|
|
105
|
+
attributes:
|
|
106
|
+
label: Related links
|
|
107
|
+
description: Links to related issues, PRs, discussions, or docs. Leave blank if none.
|
|
108
|
+
validations:
|
|
109
|
+
required: false
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
name: Feature request
|
|
2
|
-
description: Propose a small improvement or new capability
|
|
3
|
-
labels: ["enhancement"]
|
|
4
|
-
body:
|
|
5
|
-
- type: markdown
|
|
6
|
-
attributes:
|
|
7
|
-
value: |
|
|
8
|
-
This template is for small, well-scoped improvements a focused
|
|
9
|
-
enhancement, a missing convenience, a quality-of-life fix.
|
|
10
|
-
|
|
11
|
-
For large features, architecture changes, or cross-cutting work,
|
|
12
|
-
open a planning issue or an ADR instead.
|
|
13
|
-
|
|
14
|
-
Do **not** include real secrets or production data use placeholders.
|
|
15
|
-
- type: dropdown
|
|
16
|
-
id: scope
|
|
17
|
-
attributes:
|
|
18
|
-
label: Scope
|
|
19
|
-
description: How big is this change? If it doesn't fit Small or Medium, use a planning issue instead.
|
|
20
|
-
options:
|
|
21
|
-
- Small a single file or component, no refactoring
|
|
22
|
-
- Medium touches a few files or a feature area, may need minor refactoring
|
|
23
|
-
validations:
|
|
24
|
-
required: true
|
|
25
|
-
- type: textarea
|
|
26
|
-
id: current-behavior
|
|
27
|
-
attributes:
|
|
28
|
-
label: Current behavior
|
|
29
|
-
description: How does it work today? Describe the existing behavior or limitation.
|
|
30
|
-
validations:
|
|
31
|
-
required: true
|
|
32
|
-
- type: textarea
|
|
33
|
-
id: problem
|
|
34
|
-
attributes:
|
|
35
|
-
label: Problem / motivation
|
|
36
|
-
description: What user or business need does this address? Why is the current behavior a problem?
|
|
37
|
-
validations:
|
|
38
|
-
required: true
|
|
39
|
-
- type: textarea
|
|
40
|
-
id: proposal
|
|
41
|
-
attributes:
|
|
42
|
-
label: Proposed solution
|
|
43
|
-
description: What would you like to happen?
|
|
44
|
-
validations:
|
|
45
|
-
required: true
|
|
46
|
-
- type: textarea
|
|
47
|
-
id: alternatives
|
|
48
|
-
attributes:
|
|
49
|
-
label: Alternatives considered
|
|
50
|
-
validations:
|
|
51
|
-
required: false
|
|
52
|
-
- type: textarea
|
|
53
|
-
id: acceptance
|
|
54
|
-
attributes:
|
|
55
|
-
label: Acceptance criteria
|
|
56
|
-
description: A checklist a reviewer can verify when this is done (include the tests).
|
|
57
|
-
placeholder: |
|
|
58
|
-
- [ ] ...
|
|
59
|
-
- [ ] Tests
|
|
60
|
-
validations:
|
|
61
|
-
required: false
|
|
62
|
-
- type: textarea
|
|
63
|
-
id: open-questions
|
|
64
|
-
attributes:
|
|
65
|
-
label: Open questions
|
|
66
|
-
description: Decisions a maintainer must make before this can be planned. Leave blank if none.
|
|
67
|
-
validations:
|
|
68
|
-
required: false
|
|
69
|
-
- type: textarea
|
|
70
|
-
id: related
|
|
71
|
-
attributes:
|
|
72
|
-
label: Related links
|
|
73
|
-
description: Links to related issues, PRs, discussions, or docs. Leave blank if none.
|
|
74
|
-
validations:
|
|
75
|
-
required: false
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose a small improvement or new capability
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
This template is for small, well-scoped improvements a focused
|
|
9
|
+
enhancement, a missing convenience, a quality-of-life fix.
|
|
10
|
+
|
|
11
|
+
For large features, architecture changes, or cross-cutting work,
|
|
12
|
+
open a planning issue or an ADR instead.
|
|
13
|
+
|
|
14
|
+
Do **not** include real secrets or production data use placeholders.
|
|
15
|
+
- type: dropdown
|
|
16
|
+
id: scope
|
|
17
|
+
attributes:
|
|
18
|
+
label: Scope
|
|
19
|
+
description: How big is this change? If it doesn't fit Small or Medium, use a planning issue instead.
|
|
20
|
+
options:
|
|
21
|
+
- Small a single file or component, no refactoring
|
|
22
|
+
- Medium touches a few files or a feature area, may need minor refactoring
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
- type: textarea
|
|
26
|
+
id: current-behavior
|
|
27
|
+
attributes:
|
|
28
|
+
label: Current behavior
|
|
29
|
+
description: How does it work today? Describe the existing behavior or limitation.
|
|
30
|
+
validations:
|
|
31
|
+
required: true
|
|
32
|
+
- type: textarea
|
|
33
|
+
id: problem
|
|
34
|
+
attributes:
|
|
35
|
+
label: Problem / motivation
|
|
36
|
+
description: What user or business need does this address? Why is the current behavior a problem?
|
|
37
|
+
validations:
|
|
38
|
+
required: true
|
|
39
|
+
- type: textarea
|
|
40
|
+
id: proposal
|
|
41
|
+
attributes:
|
|
42
|
+
label: Proposed solution
|
|
43
|
+
description: What would you like to happen?
|
|
44
|
+
validations:
|
|
45
|
+
required: true
|
|
46
|
+
- type: textarea
|
|
47
|
+
id: alternatives
|
|
48
|
+
attributes:
|
|
49
|
+
label: Alternatives considered
|
|
50
|
+
validations:
|
|
51
|
+
required: false
|
|
52
|
+
- type: textarea
|
|
53
|
+
id: acceptance
|
|
54
|
+
attributes:
|
|
55
|
+
label: Acceptance criteria
|
|
56
|
+
description: A checklist a reviewer can verify when this is done (include the tests).
|
|
57
|
+
placeholder: |
|
|
58
|
+
- [ ] ...
|
|
59
|
+
- [ ] Tests
|
|
60
|
+
validations:
|
|
61
|
+
required: false
|
|
62
|
+
- type: textarea
|
|
63
|
+
id: open-questions
|
|
64
|
+
attributes:
|
|
65
|
+
label: Open questions
|
|
66
|
+
description: Decisions a maintainer must make before this can be planned. Leave blank if none.
|
|
67
|
+
validations:
|
|
68
|
+
required: false
|
|
69
|
+
- type: textarea
|
|
70
|
+
id: related
|
|
71
|
+
attributes:
|
|
72
|
+
label: Related links
|
|
73
|
+
description: Links to related issues, PRs, discussions, or docs. Leave blank if none.
|
|
74
|
+
validations:
|
|
75
|
+
required: false
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Managed by @plainconceptsplatform/workflows. Source: loops/workflows/agent-docs-audit.md. Update with `workflows update --force`; consumer edits may be overwritten.
|
|
3
|
+
env:
|
|
4
|
+
# The model this worker's own session runs on. See agent-audit.md for why it names one.
|
|
5
|
+
AGENT_LEAD_MODEL: "forge/glm-5-2"
|
|
6
|
+
# Every harness tier on one model the CI's Forge account is granted; see agent-audit.md.
|
|
7
|
+
AGENT_TIER_MODEL: "plainconcepts/glm-5-2"
|
|
8
|
+
AGENT_FAST_MODEL: "plainconcepts/glm-5-2"
|
|
9
|
+
REPO_RULES: "Read-only documentation audit. Report only stale documentation you can prove with evidence from both the document and the code. Do not modify files, commit, push, or run write operations."
|
|
10
|
+
# What this repository counts as its entry documents, and what the scan leaves out. Archives,
|
|
11
|
+
# parked material and generated documents belong in the exclusions: a broken link in a record
|
|
12
|
+
# of the past is not drift.
|
|
13
|
+
DOCS_AUDIT_ENTRY_DOCS: "README.md,ARCHITECTURE.md,AGENTS.md,CLAUDE.md,CONTRIBUTING.md,docs/README.md"
|
|
14
|
+
DOCS_AUDIT_EXCLUDE: ".github/workflows/,.agents/,.claude/,.opencode/,node_modules/"
|
|
15
|
+
DOCS_AUDIT_FOCUS: "Components, modules or bounded contexts the documents list against the ones that exist. Counts that no longer hold. Infrastructure, hosting or tooling that was retired but is still described. Workflows, scripts and commands that no longer exist. Decisions superseded in practice that still read as current. Two documents stating the same fact differently."
|
|
16
|
+
# The Platform documentation standard, read before the agent starts. A repository that keeps
|
|
17
|
+
# its own may point this elsewhere. Empty skips the structure check.
|
|
18
|
+
DOCS_STANDARD_URL: "https://raw.githubusercontent.com/PlainConceptsPlatform/foundations/main/ai/DOCUMENTATION.md"
|
|
19
|
+
# No commit in this many days means nothing can have drifted since the last run, so a scheduled
|
|
20
|
+
# run stops before the model starts. 17 is the longest gap between runs on days 1 and 15.
|
|
21
|
+
DOCS_AUDIT_QUIET_DAYS: "17"
|
|
22
|
+
GIT_AUTHOR_NAME: "github-actions[bot]"
|
|
23
|
+
GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
|
|
24
|
+
GIT_COMMITTER_NAME: "github-actions[bot]"
|
|
25
|
+
GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com"
|
|
26
|
+
description: |
|
|
27
|
+
Read-only documentation audit. Checks that the repository's documentation still matches its
|
|
28
|
+
code and the Platform documentation standard. When it does not, files a single issue of
|
|
29
|
+
findings with evidence from both sides, labelled `docs-audit` + `refine`, so Refine sizes it
|
|
30
|
+
and splits it into one issue per finding. When the documentation is current, files nothing.
|
|
31
|
+
|
|
32
|
+
Router-only worker: triggered exclusively via workflow_call from work-router.yml.
|
|
33
|
+
Contract input: trigger-kind(scheduled|manual).
|
|
34
|
+
The router owns the fortnightly schedule and manual dispatch.
|
|
35
|
+
|
|
36
|
+
The `skip-if-match` below is backpressure: one unactioned report is enough, because a second
|
|
37
|
+
one would mostly restate the first.
|
|
38
|
+
|
|
39
|
+
name: "Agent: Docs Audit"
|
|
40
|
+
|
|
41
|
+
# Shared: network policy only. This workflow owns its Safe Outputs and OpenCode configuration.
|
|
42
|
+
# permissions, engine, model and runs-on cannot be shared , see shared/platform-defaults.md.
|
|
43
|
+
imports:
|
|
44
|
+
- github/gh-aw/.github/workflows/shared/opencode.md@v0.87.5
|
|
45
|
+
- shared/platform-defaults.md
|
|
46
|
+
- shared/opencode-ci.md
|
|
47
|
+
|
|
48
|
+
on:
|
|
49
|
+
workflow_call:
|
|
50
|
+
inputs:
|
|
51
|
+
trigger-kind:
|
|
52
|
+
description: "Docs audit trigger: scheduled or manual"
|
|
53
|
+
required: false
|
|
54
|
+
type: string
|
|
55
|
+
default: manual
|
|
56
|
+
|
|
57
|
+
# Rung 1. `-label:stale-audit` keeps this from becoming a stop: audit-close labels a report
|
|
58
|
+
# nobody actioned, which frees the slot and lists it in the "Needs a human" digest. Without it
|
|
59
|
+
# one abandoned report would disable this worker for good, with a green run every fortnight.
|
|
60
|
+
skip-if-match:
|
|
61
|
+
query: "is:issue is:open label:docs-audit -label:stale-audit"
|
|
62
|
+
max: 1
|
|
63
|
+
|
|
64
|
+
# gh-aw folds the top-level `if:` into activation without depending on the job it reads, so
|
|
65
|
+
# the reference would resolve to '' and the agent would never run.
|
|
66
|
+
needs: [recent_commits]
|
|
67
|
+
|
|
68
|
+
if: needs.recent_commits.outputs.changed == 'true'
|
|
69
|
+
|
|
70
|
+
runs-on: agents-arc
|
|
71
|
+
runs-on-slim: agents-arc
|
|
72
|
+
|
|
73
|
+
secrets:
|
|
74
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
75
|
+
|
|
76
|
+
engine:
|
|
77
|
+
id: opencode
|
|
78
|
+
version: "1.2.14"
|
|
79
|
+
env:
|
|
80
|
+
OPENAI_BASE_URL: https://forge.plainconcepts.com/v1
|
|
81
|
+
|
|
82
|
+
model: openai/glm-5-2
|
|
83
|
+
|
|
84
|
+
max-turns: 150
|
|
85
|
+
max-turn-cache-misses: 1500
|
|
86
|
+
max-ai-credits: 2500
|
|
87
|
+
|
|
88
|
+
permissions: read-all
|
|
89
|
+
|
|
90
|
+
steps:
|
|
91
|
+
- name: List what is already tracked
|
|
92
|
+
uses: ./.github/actions/list-open-issues
|
|
93
|
+
with:
|
|
94
|
+
token: ${{ github.token }}
|
|
95
|
+
repo: ${{ github.repository }}
|
|
96
|
+
- name: Collect documentation drift
|
|
97
|
+
uses: ./.github/actions/collect-doc-drift
|
|
98
|
+
with:
|
|
99
|
+
entry-docs: ${{ env.DOCS_AUDIT_ENTRY_DOCS }}
|
|
100
|
+
exclude: ${{ env.DOCS_AUDIT_EXCLUDE }}
|
|
101
|
+
# Fetched here rather than by the agent, whose network is closed. A standard that cannot be
|
|
102
|
+
# read costs the structure check, not the run: the prompt says to report it.
|
|
103
|
+
- name: Fetch the documentation standard
|
|
104
|
+
env:
|
|
105
|
+
STANDARD_PATH: /tmp/gh-aw/agent/documentation-standard.md
|
|
106
|
+
run: |
|
|
107
|
+
set -uo pipefail
|
|
108
|
+
mkdir -p "$(dirname "$STANDARD_PATH")"
|
|
109
|
+
if [ -n "$DOCS_STANDARD_URL" ] && curl -fsSL --max-time 30 "$DOCS_STANDARD_URL" -o "$STANDARD_PATH"; then
|
|
110
|
+
echo "Read the documentation standard from $DOCS_STANDARD_URL"
|
|
111
|
+
else
|
|
112
|
+
rm -f "$STANDARD_PATH"
|
|
113
|
+
echo "::warning::No documentation standard could be read from '${DOCS_STANDARD_URL}'. The audit runs without its structure check."
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
jobs:
|
|
117
|
+
# The cheap exit. A repository with no commits since the last run cannot have drifted, and a
|
|
118
|
+
# full agent run to say so would hold half of a two-machine fleet. A dispatch always runs: a
|
|
119
|
+
# person asking for an audit has a reason.
|
|
120
|
+
recent_commits:
|
|
121
|
+
runs-on: agents-arc
|
|
122
|
+
timeout-minutes: 5
|
|
123
|
+
permissions:
|
|
124
|
+
contents: read
|
|
125
|
+
outputs:
|
|
126
|
+
changed: ${{ steps.commits.outputs.changed }}
|
|
127
|
+
steps:
|
|
128
|
+
- name: Count recent commits on the default branch
|
|
129
|
+
id: commits
|
|
130
|
+
env:
|
|
131
|
+
GH_TOKEN: ${{ github.token }}
|
|
132
|
+
REPO: ${{ github.repository }}
|
|
133
|
+
TRIGGER_KIND: ${{ inputs.trigger-kind }}
|
|
134
|
+
QUIET_DAYS: ${{ env.DOCS_AUDIT_QUIET_DAYS }}
|
|
135
|
+
run: |
|
|
136
|
+
set -uo pipefail
|
|
137
|
+
if [ "$TRIGGER_KIND" != "scheduled" ]; then
|
|
138
|
+
echo "changed=true" >> "$GITHUB_OUTPUT"
|
|
139
|
+
exit 0
|
|
140
|
+
fi
|
|
141
|
+
since="$(date -u -d "${QUIET_DAYS} days ago" +%Y-%m-%dT%H:%M:%SZ)"
|
|
142
|
+
# An unanswered API call must not read as "nothing changed": that is a green run that
|
|
143
|
+
# audited nothing. Run the audit instead.
|
|
144
|
+
if ! commits="$(gh api "repos/${REPO}/commits?since=${since}&per_page=1" --jq 'length')"; then
|
|
145
|
+
echo "::warning::Could not list recent commits; running the audit anyway."
|
|
146
|
+
commits=1
|
|
147
|
+
fi
|
|
148
|
+
if [ "$commits" = "0" ]; then
|
|
149
|
+
echo "No commits since ${since}: nothing can have drifted, so the agent does not run."
|
|
150
|
+
echo "changed=false" >> "$GITHUB_OUTPUT"
|
|
151
|
+
else
|
|
152
|
+
echo "changed=true" >> "$GITHUB_OUTPUT"
|
|
153
|
+
fi
|
|
154
|
+
|
|
155
|
+
conclude:
|
|
156
|
+
needs: [activation, agent, safe_outputs]
|
|
157
|
+
if: >
|
|
158
|
+
needs.agent.result == 'success' &&
|
|
159
|
+
needs.safe_outputs.result == 'success' &&
|
|
160
|
+
needs.safe_outputs.outputs.process_safe_outputs_processed_count != '0'
|
|
161
|
+
runs-on: agents-arc
|
|
162
|
+
permissions:
|
|
163
|
+
contents: read
|
|
164
|
+
issues: write
|
|
165
|
+
steps:
|
|
166
|
+
- name: Checkout workflow actions
|
|
167
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
168
|
+
with:
|
|
169
|
+
persist-credentials: false
|
|
170
|
+
- name: Create bot token
|
|
171
|
+
id: app-token
|
|
172
|
+
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
|
173
|
+
with:
|
|
174
|
+
client-id: ${{ secrets.BOT_APP_ID }}
|
|
175
|
+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
|
|
176
|
+
# The safe_outputs job already created the issue. Only the labels are left, and they are
|
|
177
|
+
# applied with the App token so that `refine` reaches the router as a trusted event.
|
|
178
|
+
- name: Apply labels to the report
|
|
179
|
+
if: needs.safe_outputs.outputs.created_issue_number != ''
|
|
180
|
+
uses: ./.github/actions/add-issue-labels
|
|
181
|
+
with:
|
|
182
|
+
token: ${{ steps.app-token.outputs.token }}
|
|
183
|
+
issue-number: ${{ needs.safe_outputs.outputs.created_issue_number }}
|
|
184
|
+
labels: |
|
|
185
|
+
docs-audit
|
|
186
|
+
refine
|
|
187
|
+
|
|
188
|
+
# An agent that ended without a report or a noop would otherwise be a green run that audited
|
|
189
|
+
# nothing; see the same job in agent-audit.md.
|
|
190
|
+
empty_run:
|
|
191
|
+
needs: [agent, safe_outputs]
|
|
192
|
+
if: >
|
|
193
|
+
needs.agent.result == 'success' &&
|
|
194
|
+
needs.safe_outputs.outputs.process_safe_outputs_processed_count == '0'
|
|
195
|
+
runs-on: agents-arc
|
|
196
|
+
permissions:
|
|
197
|
+
contents: read
|
|
198
|
+
steps:
|
|
199
|
+
- name: Report a docs audit that produced no outcome
|
|
200
|
+
env:
|
|
201
|
+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
202
|
+
run: |
|
|
203
|
+
set -euo pipefail
|
|
204
|
+
echo "::error::The docs audit agent finished without emitting a report or a noop. Nothing was filed and no reason was given, so this run is a failure rather than a clean audit. ${RUN_URL}"
|
|
205
|
+
exit 1
|
|
206
|
+
|
|
207
|
+
safe-outputs:
|
|
208
|
+
# A failed run is already a red run. An issue per failure buries the real backlog.
|
|
209
|
+
report-failure-as-issue: false
|
|
210
|
+
threat-detection: false
|
|
211
|
+
create-issue:
|
|
212
|
+
max: 1
|
|
213
|
+
|
|
214
|
+
# Reads documents and the code they describe, and writes one issue. Unobserved so far: audit, the
|
|
215
|
+
# nearest worker, takes about 45 minutes over a whole repository, and this one reads less.
|
|
216
|
+
timeout-minutes: 60
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
1. This is a read-only documentation audit. Do not modify any file, do not commit, and do not
|
|
220
|
+
push. Adhere to ${{ env.REPO_RULES }}.
|
|
221
|
+
|
|
222
|
+
2. Read the facts already collected for you, so you do not re-derive them:
|
|
223
|
+
- `/tmp/gh-aw/agent/doc-drift.json`: `brokenLinks` and `missingPaths`, each with its file and
|
|
224
|
+
line, plus `missingEntryDocuments`. These are established; do not check them again.
|
|
225
|
+
- `/tmp/gh-aw/agent/documentation-standard.md`: the Platform documentation standard. If this
|
|
226
|
+
file does not exist, skip step 4 and say so in one line of the report.
|
|
227
|
+
- `/tmp/gh-aw/agent/open-issues.json`: every open issue with its title and labels.
|
|
228
|
+
|
|
229
|
+
3. Read the entry documents in `doc-drift.json`, then compare what they state with the code.
|
|
230
|
+
Look for: ${{ env.DOCS_AUDIT_FOCUS }}
|
|
231
|
+
|
|
232
|
+
Every finding needs evidence on both sides: the document's `file:line` and what it says, and
|
|
233
|
+
the `file:line` or directory that shows otherwise. A claim you cannot back with both is not a
|
|
234
|
+
finding. Prefer what misleads a reader acting on it over what is merely imprecise, and do not
|
|
235
|
+
report style, tone or missing polish.
|
|
236
|
+
|
|
237
|
+
4. Compare the repository's documentation structure with the standard. Report a required
|
|
238
|
+
section that is missing, or that exists and is empty. A section the standard marks as not
|
|
239
|
+
applicable to this kind of repository is not a finding.
|
|
240
|
+
|
|
241
|
+
5. Group the broken links and missing paths from step 2 into findings by document or by cause,
|
|
242
|
+
such as one renamed directory, rather than one finding per link. State their counts as they
|
|
243
|
+
appear in `doc-drift.json`.
|
|
244
|
+
|
|
245
|
+
6. Discard any finding already tracked in `open-issues.json`. Exact-title duplicates are rejected
|
|
246
|
+
for you; your job is the ones worded differently that mean the same thing.
|
|
247
|
+
|
|
248
|
+
Before filing, call `memory_smart_search` for prior documentation audits of this repository
|
|
249
|
+
and drop any finding that was reported and consciously not acted on. After you have decided
|
|
250
|
+
what to file, call `memory_save` once with the date and, for each finding, its file, a
|
|
251
|
+
one-line description and its disposition. Keep it short; it is read by the next audit.
|
|
252
|
+
|
|
253
|
+
7. If no finding is left, call `noop` and stop. Filing nothing is the right outcome when the
|
|
254
|
+
documentation is current.
|
|
255
|
+
|
|
256
|
+
8. Call `create_issue` **once** with title "Docs audit: <date>". Do NOT specify labels, the
|
|
257
|
+
conclude job applies them. List every finding, the most misleading first, each with:
|
|
258
|
+
- the document's `file:line` and the stale statement;
|
|
259
|
+
- the evidence from the code, with its `file:line` or path;
|
|
260
|
+
- what the document should say, or the section that has to be added.
|
|
261
|
+
|
|
262
|
+
The issue goes to Refine, which sizes it and splits it into one issue per finding, so write
|
|
263
|
+
each finding to survive that: self-contained, naming its own files, never "as above".
|
|
264
|
+
|
|
265
|
+
Refer to people by role, never by name, and include no personal contact details, even when
|
|
266
|
+
a document you are quoting contains them.
|