@xn-intenton-z2a/agentic-lib 7.1.67 → 7.1.69
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/.github/workflows/agentic-lib-workflow.yml +22 -2
- package/agentic-lib.toml +3 -3
- package/package.json +1 -1
- package/src/actions/agentic-step/config-loader.js +4 -3
- package/src/actions/agentic-step/index.js +2 -2
- package/src/actions/agentic-step/tasks/review-issue.js +15 -0
- package/src/actions/agentic-step/tasks/transform.js +35 -0
- package/src/agents/agent-apply-fix.md +9 -6
- package/src/agents/agent-discussion-bot.md +2 -2
- package/src/agents/agent-issue-resolution.md +39 -15
- package/src/agents/agent-maintain-features.md +3 -2
- package/src/agents/agent-maintain-library.md +13 -14
- package/src/agents/agent-ready-issue.md +7 -7
- package/src/agents/agent-review-issue.md +10 -2
- package/src/agents/agent-supervisor.md +5 -5
- package/src/agents/agentic-lib.yml +3 -0
- package/src/seeds/zero-index.html +45 -7
- package/src/seeds/zero-main.js +21 -1
- package/src/seeds/zero-main.test.js +17 -2
- package/src/seeds/zero-package.json +4 -4
- package/src/seeds/zero-web.test.js +16 -0
|
@@ -721,15 +721,35 @@ jobs:
|
|
|
721
721
|
run: |
|
|
722
722
|
npm run build:web 2>/dev/null || echo "No build:web script"
|
|
723
723
|
|
|
724
|
+
- name: Run tests before committing
|
|
725
|
+
id: pre-commit-test
|
|
726
|
+
if: steps.issue.outputs.issue-number != ''
|
|
727
|
+
run: |
|
|
728
|
+
CONFIG="${{ needs.params.outputs.config-path }}"
|
|
729
|
+
TEST_CMD=$(grep -E '^\s*test\s*=' "$CONFIG" 2>/dev/null | sed 's/.*=\s*"\(.*\)"/\1/' | head -1)
|
|
730
|
+
TEST_CMD="${TEST_CMD:-npm ci && npm test}"
|
|
731
|
+
echo "Running: $TEST_CMD"
|
|
732
|
+
set +e
|
|
733
|
+
eval "$TEST_CMD" 2>&1 | tail -30
|
|
734
|
+
EXIT_CODE=$?
|
|
735
|
+
set -e
|
|
736
|
+
if [ $EXIT_CODE -ne 0 ]; then
|
|
737
|
+
echo "tests-passed=false" >> $GITHUB_OUTPUT
|
|
738
|
+
echo "WARNING: Tests failed (exit $EXIT_CODE) — skipping commit and PR"
|
|
739
|
+
else
|
|
740
|
+
echo "tests-passed=true" >> $GITHUB_OUTPUT
|
|
741
|
+
echo "Tests passed"
|
|
742
|
+
fi
|
|
743
|
+
|
|
724
744
|
- name: Commit and push
|
|
725
|
-
if: github.repository != 'xn-intenton-z2a/agentic-lib' && steps.issue.outputs.issue-number != '' && needs.params.outputs.dry-run != 'true'
|
|
745
|
+
if: github.repository != 'xn-intenton-z2a/agentic-lib' && steps.issue.outputs.issue-number != '' && needs.params.outputs.dry-run != 'true' && steps.pre-commit-test.outputs.tests-passed == 'true'
|
|
726
746
|
uses: ./.github/agentic-lib/actions/commit-if-changed
|
|
727
747
|
with:
|
|
728
748
|
commit-message: "agentic-step: transform issue #${{ steps.issue.outputs.issue-number }}"
|
|
729
749
|
push-ref: ${{ steps.branch.outputs.branchName }}
|
|
730
750
|
|
|
731
751
|
- name: Create PR and attempt merge
|
|
732
|
-
if: github.repository != 'xn-intenton-z2a/agentic-lib' && steps.issue.outputs.issue-number != '' && needs.params.outputs.dry-run != 'true'
|
|
752
|
+
if: github.repository != 'xn-intenton-z2a/agentic-lib' && steps.issue.outputs.issue-number != '' && needs.params.outputs.dry-run != 'true' && steps.pre-commit-test.outputs.tests-passed == 'true'
|
|
733
753
|
uses: actions/github-script@v8
|
|
734
754
|
with:
|
|
735
755
|
script: |
|
package/agentic-lib.toml
CHANGED
|
@@ -70,7 +70,7 @@ infinite-sessions = false # set to true for long sessions with compaction
|
|
|
70
70
|
# Fast & cheap — CI testing, quick validation, budget-conscious iteration.
|
|
71
71
|
reasoning-effort = "low" # low | medium | high | none
|
|
72
72
|
infinite-sessions = false # enable session compaction for long runs
|
|
73
|
-
transformation-budget =
|
|
73
|
+
transformation-budget = 16 # max code-changing cycles per run
|
|
74
74
|
max-feature-files = 3 # max feature files included in prompts
|
|
75
75
|
max-source-files = 3 # max source files included in prompts
|
|
76
76
|
max-source-chars = 1000 # max chars of each source file's content included in prompts
|
|
@@ -91,7 +91,7 @@ library-limit = 8 # max library entries in library/ directo
|
|
|
91
91
|
# Balanced — good results without excessive cost. Default for consumer repos.
|
|
92
92
|
reasoning-effort = "medium" # low | medium | high | none
|
|
93
93
|
infinite-sessions = true # enable session compaction for long runs
|
|
94
|
-
transformation-budget =
|
|
94
|
+
transformation-budget = 32 # max code-changing cycles per run
|
|
95
95
|
max-feature-files = 10 # max feature files included in prompts
|
|
96
96
|
max-source-files = 10 # max source files included in prompts
|
|
97
97
|
max-source-chars = 5000 # max chars of each source file's content included in prompts
|
|
@@ -112,7 +112,7 @@ library-limit = 32 # max library entries in library/ directo
|
|
|
112
112
|
# Thorough — maximum context, highest quality. For complex missions.
|
|
113
113
|
reasoning-effort = "high" # low | medium | high | none
|
|
114
114
|
infinite-sessions = true # enable session compaction for long runs
|
|
115
|
-
transformation-budget =
|
|
115
|
+
transformation-budget = 128 # max code-changing cycles per run
|
|
116
116
|
max-feature-files = 50 # max feature files included in prompts
|
|
117
117
|
max-source-files = 50 # max source files included in prompts
|
|
118
118
|
max-source-chars = 20000 # max chars of each source file's content included in prompts
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@ import { parse as parseToml } from "smol-toml";
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
// Keys whose paths are writable by agents
|
|
38
|
-
const WRITABLE_KEYS = ["source", "tests", "features", "dependencies", "docs", "readme", "examples"];
|
|
38
|
+
const WRITABLE_KEYS = ["source", "tests", "features", "dependencies", "docs", "readme", "examples", "web"];
|
|
39
39
|
|
|
40
40
|
// Default paths — every key that task handlers might access
|
|
41
41
|
const PATH_DEFAULTS = {
|
|
@@ -50,6 +50,7 @@ const PATH_DEFAULTS = {
|
|
|
50
50
|
library: "library/",
|
|
51
51
|
librarySources: "SOURCES.md",
|
|
52
52
|
contributing: "CONTRIBUTING.md",
|
|
53
|
+
web: "src/web/",
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
// Default limits for path-specific constraints
|
|
@@ -63,7 +64,7 @@ const LIMIT_DEFAULTS = {
|
|
|
63
64
|
const FALLBACK_TUNING = {
|
|
64
65
|
reasoningEffort: "medium",
|
|
65
66
|
infiniteSessions: true,
|
|
66
|
-
transformationBudget:
|
|
67
|
+
transformationBudget: 32,
|
|
67
68
|
featuresScan: 10,
|
|
68
69
|
sourceScan: 10,
|
|
69
70
|
sourceContent: 5000,
|
|
@@ -92,7 +93,7 @@ function parseTuningProfile(profileSection) {
|
|
|
92
93
|
return {
|
|
93
94
|
reasoningEffort: profileSection["reasoning-effort"] || "medium",
|
|
94
95
|
infiniteSessions: profileSection["infinite-sessions"] ?? true,
|
|
95
|
-
transformationBudget: profileSection["transformation-budget"] ||
|
|
96
|
+
transformationBudget: profileSection["transformation-budget"] || 32,
|
|
96
97
|
featuresScan: profileSection["max-feature-files"] || 10,
|
|
97
98
|
sourceScan: profileSection["max-source-files"] || 10,
|
|
98
99
|
sourceContent: profileSection["max-source-chars"] || 5000,
|
|
@@ -101,7 +101,7 @@ async function run() {
|
|
|
101
101
|
|
|
102
102
|
// Compute limits status for enriched logging
|
|
103
103
|
const limitsStatus = [
|
|
104
|
-
{ name: "transformation-budget", valueNum: 0, capacityNum: config.transformationBudget || 0, value: `0/${config.transformationBudget || 0}`, remaining: `${config.transformationBudget || 0}
|
|
104
|
+
{ name: "transformation-budget", valueNum: 0, capacityNum: config.transformationBudget || 0, value: `0/${config.transformationBudget || 0}`, remaining: `${config.transformationBudget || 0}`, status: "" },
|
|
105
105
|
{ name: "max-feature-issues", valueNum: 0, capacityNum: config.featureDevelopmentIssuesWipLimit, value: `?/${config.featureDevelopmentIssuesWipLimit}`, remaining: "?", status: "" },
|
|
106
106
|
{ name: "max-maintenance-issues", valueNum: 0, capacityNum: config.maintenanceIssuesWipLimit, value: `?/${config.maintenanceIssuesWipLimit}`, remaining: "?", status: "" },
|
|
107
107
|
{ name: "max-attempts-per-issue", valueNum: 0, capacityNum: config.attemptsPerIssue, value: `?/${config.attemptsPerIssue}`, remaining: "?", status: task === "resolve-issue" ? "" : "n/a" },
|
|
@@ -122,7 +122,7 @@ async function run() {
|
|
|
122
122
|
const profileName = config.tuning?.profileName || "unknown";
|
|
123
123
|
|
|
124
124
|
// Transformation cost: 1 for code-changing tasks, 0 otherwise
|
|
125
|
-
const COST_TASKS = ["transform", "fix-code"];
|
|
125
|
+
const COST_TASKS = ["transform", "fix-code", "maintain-features", "maintain-library"];
|
|
126
126
|
const isNop = result.outcome === "nop" || result.outcome === "error";
|
|
127
127
|
const transformationCost = COST_TASKS.includes(task) && !isNop ? 1 : 0;
|
|
128
128
|
|
|
@@ -46,6 +46,13 @@ async function reviewSingleIssue({ octokit, repo, config, targetIssueNumber, ins
|
|
|
46
46
|
sortByMtime: true,
|
|
47
47
|
clean: true,
|
|
48
48
|
});
|
|
49
|
+
const webFiles = scanDirectory(config.paths.web?.path || "src/web/", [".html", ".css", ".js"], {
|
|
50
|
+
fileLimit: t.sourceScan || 20,
|
|
51
|
+
contentLimit: t.sourceContent || 5000,
|
|
52
|
+
recursive: true,
|
|
53
|
+
sortByMtime: true,
|
|
54
|
+
clean: true,
|
|
55
|
+
});
|
|
49
56
|
const docsFiles = scanDirectory(config.paths.documentation?.path || "docs/", [".md"], {
|
|
50
57
|
fileLimit: t.featuresScan || 10,
|
|
51
58
|
contentLimit: t.documentSummary || 2000,
|
|
@@ -66,6 +73,14 @@ async function reviewSingleIssue({ octokit, repo, config, targetIssueNumber, ins
|
|
|
66
73
|
`## Current Tests (${testFiles.length} files)`,
|
|
67
74
|
...testFiles.map((f) => `### ${f.name}\n\`\`\`\n${f.content}\n\`\`\``),
|
|
68
75
|
"",
|
|
76
|
+
...(webFiles.length > 0
|
|
77
|
+
? [
|
|
78
|
+
`## Website Files (${webFiles.length} files)`,
|
|
79
|
+
"The website in `src/web/` uses the JS library.",
|
|
80
|
+
...webFiles.map((f) => `### ${f.name}\n\`\`\`\n${f.content}\n\`\`\``),
|
|
81
|
+
"",
|
|
82
|
+
]
|
|
83
|
+
: []),
|
|
69
84
|
...(docsFiles.length > 0
|
|
70
85
|
? [`## Documentation (${docsFiles.length} files)`, ...docsFiles.map((f) => `- ${f.name}`), ""]
|
|
71
86
|
: []),
|
|
@@ -41,6 +41,13 @@ export async function transform(context) {
|
|
|
41
41
|
clean: true,
|
|
42
42
|
outline: true,
|
|
43
43
|
});
|
|
44
|
+
const webFiles = scanDirectory(config.paths.web?.path || "src/web/", [".html", ".css", ".js"], {
|
|
45
|
+
fileLimit: t.sourceScan || 10,
|
|
46
|
+
contentLimit: t.sourceContent || 5000,
|
|
47
|
+
recursive: true,
|
|
48
|
+
sortByMtime: true,
|
|
49
|
+
clean: true,
|
|
50
|
+
});
|
|
44
51
|
|
|
45
52
|
const { data: rawIssues } = await octokit.rest.issues.listForRepo({
|
|
46
53
|
...repo,
|
|
@@ -79,6 +86,7 @@ export async function transform(context) {
|
|
|
79
86
|
mission,
|
|
80
87
|
features,
|
|
81
88
|
sourceFiles,
|
|
89
|
+
webFiles,
|
|
82
90
|
openIssues,
|
|
83
91
|
tuning: t,
|
|
84
92
|
});
|
|
@@ -107,6 +115,16 @@ export async function transform(context) {
|
|
|
107
115
|
`## Current Source Files (${sourceFiles.length})`,
|
|
108
116
|
...sourceFiles.map((f) => `### ${f.name}\n\`\`\`\n${f.content}\n\`\`\``),
|
|
109
117
|
"",
|
|
118
|
+
...(webFiles.length > 0
|
|
119
|
+
? [
|
|
120
|
+
`## Website Files (${webFiles.length})`,
|
|
121
|
+
"The website in `src/web/` uses the JS library.",
|
|
122
|
+
"When transforming source code, also update the website to use the library's new/changed features.",
|
|
123
|
+
"The `lib-meta.js` file (generated by `npm run build:web` from `package.json`) provides `name`, `version`, and `description` exports to the browser.",
|
|
124
|
+
...webFiles.map((f) => `### ${f.name}\n\`\`\`\n${f.content}\n\`\`\``),
|
|
125
|
+
"",
|
|
126
|
+
]
|
|
127
|
+
: []),
|
|
110
128
|
`## Open Issues (${openIssues.length})`,
|
|
111
129
|
...openIssues.slice(0, t.issuesScan || 20).map((i) => summariseIssue(i, t.issueBodyLimit || 500)),
|
|
112
130
|
"",
|
|
@@ -202,6 +220,7 @@ async function transformTdd({
|
|
|
202
220
|
mission,
|
|
203
221
|
features,
|
|
204
222
|
sourceFiles,
|
|
223
|
+
webFiles,
|
|
205
224
|
openIssues,
|
|
206
225
|
tuning: t,
|
|
207
226
|
}) {
|
|
@@ -229,6 +248,14 @@ async function transformTdd({
|
|
|
229
248
|
`## Current Source Files (${sourceFiles.length})`,
|
|
230
249
|
...sourceFiles.map((f) => `### ${f.name}\n\`\`\`\n${f.content}\n\`\`\``),
|
|
231
250
|
"",
|
|
251
|
+
...(webFiles.length > 0
|
|
252
|
+
? [
|
|
253
|
+
`## Website Files (${webFiles.length})`,
|
|
254
|
+
"The website in `src/web/` uses the JS library.",
|
|
255
|
+
...webFiles.map((f) => `### ${f.name}\n\`\`\`\n${f.content}\n\`\`\``),
|
|
256
|
+
"",
|
|
257
|
+
]
|
|
258
|
+
: []),
|
|
232
259
|
`## Open Issues (${openIssues.length})`,
|
|
233
260
|
...openIssues.slice(0, t.issuesScan || 20).map((i) => summariseIssue(i, t.issueBodyLimit || 500)),
|
|
234
261
|
"",
|
|
@@ -273,6 +300,14 @@ async function transformTdd({
|
|
|
273
300
|
`## Current Source Files (${sourceFiles.length})`,
|
|
274
301
|
...sourceFiles.map((f) => `### ${f.name}\n\`\`\`\n${f.content}\n\`\`\``),
|
|
275
302
|
"",
|
|
303
|
+
...(webFiles.length > 0
|
|
304
|
+
? [
|
|
305
|
+
`## Website Files (${webFiles.length})`,
|
|
306
|
+
"The website in `src/web/` uses the JS library. Update it to reflect any new features.",
|
|
307
|
+
...webFiles.map((f) => `### ${f.name}\n\`\`\`\n${f.content}\n\`\`\``),
|
|
308
|
+
"",
|
|
309
|
+
]
|
|
310
|
+
: []),
|
|
276
311
|
formatPathsSection(writablePaths, readOnlyPaths, _config),
|
|
277
312
|
"",
|
|
278
313
|
"## Output Artifacts",
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
You are providing the entire new content of source files, test files, documentation files,
|
|
2
2
|
and other necessary files with all necessary changes applied to resolve a possible build or test
|
|
3
|
-
problem.
|
|
4
|
-
|
|
5
|
-
value you may re-implement it or remove it.
|
|
3
|
+
problem. Fix the root cause. If the problem is in an area of the code with little
|
|
4
|
+
relevance to the mission you may re-implement it or remove it.
|
|
6
5
|
|
|
7
|
-
Apply the contributing guidelines to your response
|
|
8
|
-
and direction of the contributing guidelines. Prioritize changes that deliver substantial user value
|
|
9
|
-
and maintain the integrity of the codebase's primary purpose.
|
|
6
|
+
Apply the contributing guidelines to your response.
|
|
10
7
|
|
|
11
8
|
You may complete the implementation of a feature and/or bring the code output in line with the README
|
|
12
9
|
or other documentation. Do as much as you can all at once so that the build runs (even with nothing
|
|
13
10
|
to build) and the tests pass and the main at least doesn't output an error.
|
|
14
11
|
|
|
12
|
+
Your goal is mission complete — if the mission can be fully accomplished while fixing this issue,
|
|
13
|
+
do it. Don't limit yourself to the minimal fix when you can deliver the whole mission in one pass.
|
|
14
|
+
|
|
15
|
+
The repository has a website in `src/web/` that uses the JS library. If a fix affects library
|
|
16
|
+
exports or behaviour, also update the website files to stay in sync.
|
|
17
|
+
|
|
15
18
|
## Merge Conflict Resolution
|
|
16
19
|
|
|
17
20
|
When resolving merge conflicts (files containing <<<<<<< / ======= / >>>>>>> markers):
|
|
@@ -57,11 +57,11 @@ Users can ask for new features or mission changes through this discussion thread
|
|
|
57
57
|
|
|
58
58
|
- **Feature requests** — When a user says "add feature X" or "I want Y", acknowledge the request and pass it to the supervisor to create a GitHub issue. The pipeline will pick it up and implement it.
|
|
59
59
|
- **Re-seed requests** — When a user says "change the mission to Z" or "re-seed with plot-code-lib", explain that this requires running `npx @xn-intenton-z2a/agentic-lib init --purge --mission <name>`. List the available missions if asked: hamming-distance, fizz-buzz, roman-numerals, string-utils, dense-encoding, cron-engine, owl-ontology, plot-code-lib, time-series-lab, lunar-lander, empty. Note that re-seeding resets all source code, issues, and discussions.
|
|
60
|
-
- **Website feedback** — The project has a website published via GitHub Pages. If a user comments on the website, pass feedback to the supervisor to create an issue for the pipeline to address.
|
|
60
|
+
- **Website feedback** — The project has a website that uses the JS library, published via GitHub Pages. If a user comments on the website, pass feedback to the supervisor to create an issue for the pipeline to address.
|
|
61
61
|
|
|
62
62
|
## Website Awareness
|
|
63
63
|
|
|
64
|
-
The repository publishes a website via GitHub Pages that
|
|
64
|
+
The repository publishes a website via GitHub Pages that uses the JS library. The URL follows the pattern `https://<owner>.github.io/<repo>/`. The website imports the library and displays its output. When discussing the project, mention the website as a way to see the library in action.
|
|
65
65
|
|
|
66
66
|
## Conversation Style
|
|
67
67
|
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
You are providing the entire new content of source files, test files, documentation files, and other necessary
|
|
2
|
-
files with all necessary changes applied to deliver the resolution to an issue.
|
|
3
|
-
|
|
4
|
-
Implement as much as you can and refer to the projects features and mission statement when expanding the code
|
|
2
|
+
files with all necessary changes applied to deliver the resolution to an issue.
|
|
3
|
+
Implement as much as you can and refer to the project's features and mission statement when expanding the code
|
|
5
4
|
beyond the scope of the original issue. Implement whole features and do not leave stubbed out or pretended code.
|
|
6
5
|
|
|
7
|
-
Apply the contributing guidelines to your response
|
|
8
|
-
of the contributing guidelines. Prioritize changes that deliver user value and maintain the integrity
|
|
9
|
-
of the codebase's primary purpose.
|
|
6
|
+
Apply the contributing guidelines to your response.
|
|
10
7
|
|
|
11
|
-
Do as much as you can all at once.
|
|
8
|
+
Do as much as you can all at once. Your goal is mission complete — if the mission can be fully
|
|
9
|
+
accomplished in this single transform, it should be. Deliver all acceptance criteria, tests, website,
|
|
10
|
+
docs, and README in one pass. Only leave work for a follow-up if it genuinely cannot fit.
|
|
11
|
+
|
|
12
|
+
## Tests Must Pass
|
|
13
|
+
|
|
14
|
+
Your changes MUST leave all existing tests passing. If you change function signatures, return values, or
|
|
15
|
+
output formats, you MUST also update the corresponding tests. The mission's acceptance criteria are the
|
|
16
|
+
source of truth for expected values — if tests and acceptance criteria disagree, fix the tests to match
|
|
17
|
+
the acceptance criteria and fix the code to pass those tests.
|
|
18
|
+
|
|
19
|
+
When writing both tests and implementation:
|
|
20
|
+
- Write tests that match the acceptance criteria in MISSION.md exactly (casing, types, error classes)
|
|
21
|
+
- Ensure the implementation passes those tests before delivering
|
|
22
|
+
- Do not write tests with different expectations than the implementation produces
|
|
12
23
|
|
|
13
24
|
Follow the linting guidelines and the formatting guidelines from the included config.
|
|
14
25
|
|
|
@@ -22,16 +33,29 @@ When implementing features, also produce evidence artifacts under `docs/`:
|
|
|
22
33
|
Design the library API with hooks that make evidence capture easy: return structured result objects,
|
|
23
34
|
support `outputFile` options where appropriate, and emit results that observers can record.
|
|
24
35
|
|
|
25
|
-
## Website
|
|
36
|
+
## Website
|
|
37
|
+
|
|
38
|
+
The repository has a website in `src/web/` that uses the JS library. It is published to GitHub Pages
|
|
39
|
+
automatically (from `docs/` via `npm run build:web`).
|
|
40
|
+
|
|
41
|
+
### How the library connects to the website
|
|
42
|
+
|
|
43
|
+
- `src/lib/main.js` is the JS library — it exports functions, `name`, `version`, `description`, and `getIdentity()`
|
|
44
|
+
- `npm run build:web` copies `src/web/*` to `docs/` and generates `docs/lib-meta.js` from `package.json`
|
|
45
|
+
- `src/web/index.html` imports `lib-meta.js` via `<script type="module">` to display the library's identity
|
|
46
|
+
- The website should import and call library functions — not just describe them
|
|
47
|
+
|
|
48
|
+
### What to do with the website
|
|
49
|
+
|
|
50
|
+
- **Use the library**: Import the library (or its browser-compatible parts) and call its functions on the page
|
|
51
|
+
- **Show real results**: Display actual output from library functions, not placeholder text
|
|
52
|
+
- When you add or change library functions, update the website to reflect them
|
|
26
53
|
|
|
27
|
-
|
|
28
|
-
published to GitHub Pages automatically (from `docs/` via `npm run build:web`).
|
|
54
|
+
### Guidelines
|
|
29
55
|
|
|
30
|
-
- `src/web/index.html` is the main page —
|
|
56
|
+
- `src/web/index.html` is the main page — update it as the library grows
|
|
31
57
|
- You may add CSS, JS, images, or additional HTML pages in `src/web/`
|
|
32
|
-
- The website should demonstrate what the library does in a way a visitor can see and interact with
|
|
33
58
|
- Keep it self-contained (no external CDN dependencies unless essential)
|
|
34
59
|
- Link back to the repository for source code and mission details
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
- The website tests in `tests/unit/web.test.js` verify the HTML exists and is structurally valid — you may extend them
|
|
60
|
+
- The website tests in `tests/unit/web.test.js` verify structure and library wiring — extend them as needed
|
|
61
|
+
- The website is not the mission — it supports the library. Don't over-invest in the website at the expense of the library
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Please generate the name and specification for a software feature which will be added or updated to action the supplied feature prompt.
|
|
2
|
-
|
|
2
|
+
Features must advance the mission stated in MISSION.md. Aim for achievable outcomes within a single repository, not a grandiose vision or bloated feature set.
|
|
3
3
|
|
|
4
4
|
You may only create features to only change the source file, test file, README file, dependencies file, and examples directory content. You may not create features that request new files, delete existing files, or change the other files provided in the prompt context.
|
|
5
5
|
If there are more than the maximum number of features in the repository, you may delete a feature but preferably, you should identify an existing feature that is most similar or related to the new feature and modify it to incorporate aspects of the new feature.
|
|
@@ -12,7 +12,7 @@ Don't use any quote escape sequences in the feature text.
|
|
|
12
12
|
Generally, the whole document might need to be extracted and stored as JSON so be careful to avoid any JSON escape
|
|
13
13
|
sequences in any part of the document. Use spacing to make it readable and avoid complex Markdown formatting.
|
|
14
14
|
|
|
15
|
-
The feature will be iterated upon to incrementally
|
|
15
|
+
The feature will be iterated upon to incrementally advance the mission. New features should be thematically distinct from other features.
|
|
16
16
|
If a significant feature of the repository is not present in the current feature set, please add it either to a new feature or an existing feature.
|
|
17
17
|
Before adding a new feature ensure that this feature is distinct from any other feature in the repository, otherwise update an existing feature.
|
|
18
18
|
When updating an existing feature, ensure that the existing aspects are not omitted in the response, provide the full feature spec.
|
|
@@ -27,3 +27,4 @@ Features must be achievable in a single software repository not part of a corpor
|
|
|
27
27
|
The feature spec should be a multiline markdown with a few level 1 headings.
|
|
28
28
|
The feature must be compatible with the mission statement in MISSION.md and ideally realise part of the value in the mission.
|
|
29
29
|
The feature must be something that can be realised in a single source file (as below), ideally just as a library, CLI tool or possibly an HTTP API in combination with infrastructure as code deployment.
|
|
30
|
+
The repository also has a website in `src/web/` that uses the JS library. When proposing features, consider both the library API and how the feature could be shown on the website.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
Extract and condense the
|
|
2
|
-
Before adding a new document, ensure that this document is distinct from any other document in the library, otherwise update an existing document.
|
|
1
|
+
Extract and condense the technical details from the supplied crawl result that are relevant to the mission.
|
|
2
|
+
Before adding a new document, ensure that this document is distinct from any other document in the library, otherwise update an existing document.
|
|
3
3
|
The document name should be one or two words in SCREAMING_SNAKECASE.
|
|
4
4
|
|
|
5
|
-
You should extract a section from the sources file to create the document. Each document should contain
|
|
5
|
+
You should extract a section from the sources file to create the document. Each document should contain actionable technical content. Focus on:
|
|
6
6
|
|
|
7
7
|
1. A normalised extract of the crawled content containing:
|
|
8
|
-
a. The
|
|
9
|
-
b. A focused table of contents listing the specific technical topics
|
|
10
|
-
c. The actual detailed information for each item in the table of contents
|
|
11
|
-
2. A supplementary details section containing the
|
|
8
|
+
a. The key technical points that directly enable implementation, not summaries of them
|
|
9
|
+
b. A focused table of contents listing the specific technical topics covered
|
|
10
|
+
c. The actual detailed information for each item in the table of contents
|
|
11
|
+
2. A supplementary details section containing the technical specifications and implementation details that complement the crawled content
|
|
12
12
|
3. A reference details section containing the critical API specifications, complete SDK method signatures with parameters
|
|
13
13
|
and return types, exact implementation patterns, specific configuration options with their values
|
|
14
14
|
and effects, concrete best practices with implementation examples, step-by-step troubleshooting procedures, and
|
|
15
|
-
detailed instructional material.
|
|
16
|
-
4. A detailed digest containing the
|
|
15
|
+
detailed instructional material. Do not describe what specifications exist, include the actual specifications themselves.
|
|
16
|
+
4. A detailed digest containing the technical content from the source section in SOURCES.md and the date when the
|
|
17
17
|
content was retrieved (current date)
|
|
18
18
|
5. Attribution information and data size obtained during crawling
|
|
19
19
|
|
|
@@ -24,8 +24,7 @@ Don't use any quote escape sequences in the normalised extract.
|
|
|
24
24
|
Generally, the whole document might need to be extracted and stored as JSON so be careful to avoid any JSON escape
|
|
25
25
|
sequences in any part of the document. Use spacing to make it readable and avoid complex Markdown formatting.
|
|
26
26
|
|
|
27
|
-
For the normalised extract, extract the
|
|
28
|
-
directly usable format
|
|
29
|
-
Do not describe what information exists, include the actual information itself. The content must be specific
|
|
30
|
-
|
|
31
|
-
technical details that thoroughly explain the implementation while prioritizing content that delivers substantial user value.
|
|
27
|
+
For the normalised extract, extract the technical information from the crawled data and present it in a condensed,
|
|
28
|
+
directly usable format.
|
|
29
|
+
Do not describe what information exists, include the actual information itself. The content must be specific and technical.
|
|
30
|
+
Each item in the table of contents must have the technical details that thoroughly explain the implementation.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
Please review the GitHub issue and determine if it should be enhanced, closed or if no operation is needed.
|
|
1
|
+
Please review the GitHub issue and determine if it should be enhanced, closed or if no operation is needed.
|
|
2
2
|
|
|
3
|
-
If the issue is relevant to the mission statement and features
|
|
3
|
+
If the issue is relevant to the mission statement and features:
|
|
4
4
|
|
|
5
5
|
1. Decide if the issue should be refined, closed or if no operation is needed.
|
|
6
|
-
2. Update the issue description with testable acceptance criteria
|
|
7
|
-
3. Enhance the issue by adding relevant library documents as issue comments that support implementation
|
|
6
|
+
2. Update the issue description with testable acceptance criteria derived from MISSION.md. Include ALL of: implementation, tests matching MISSION.md acceptance criteria, website updates, docs/evidence, and README. The issue should ask for mission complete — if the entire mission can be accomplished in a single transform, the acceptance criteria should cover everything. Only scope down if the mission is genuinely too large for one pass.
|
|
7
|
+
3. Enhance the issue by adding relevant library documents as issue comments that support implementation.
|
|
8
8
|
|
|
9
|
-
If the issue is irrelevant to the mission statement or features
|
|
9
|
+
If the issue is irrelevant to the mission statement or features:
|
|
10
10
|
|
|
11
|
-
1. Set the action to close the issue and supply an appropriate comment explaining why it doesn't
|
|
11
|
+
1. Set the action to close the issue and supply an appropriate comment explaining why it doesn't advance the mission.
|
|
12
12
|
|
|
13
|
-
Input validation issues that don't
|
|
13
|
+
Input validation issues that don't advance the mission should be closed, and in particular, issues mentioning handling of NaN are probably worthless and should be closed.
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
Does the combination source file, test file, README file and dependencies file
|
|
2
|
-
|
|
1
|
+
Does the combination source file, test file, website files, README file and dependencies file resolve the following issue? Check that the solution satisfies the issue's acceptance criteria and moves the mission toward complete.
|
|
2
|
+
|
|
3
|
+
If the mission could have been fully accomplished in this transform but the solution only partially addresses it, note this gap and suggest a follow-up issue for the remaining work.
|
|
4
|
+
|
|
5
|
+
When reviewing, check that:
|
|
6
|
+
- Tests and implementation are consistent — test expectations must match what the code actually returns (casing, types, formats)
|
|
7
|
+
- Tests match the acceptance criteria in MISSION.md — the mission is the source of truth
|
|
8
|
+
- If tests expect different values than the code produces, create an issue to fix the mismatch
|
|
9
|
+
|
|
10
|
+
Note: The repository has a website in `src/web/` that uses the JS library. When reviewing, check that website files are updated alongside library changes.
|
|
3
11
|
|
|
4
12
|
When reviewing, also check that evidence artifacts exist under `docs/` for implemented features.
|
|
5
13
|
If a feature works but has no evidence (no example outputs, test results, or walkthroughs in `docs/`),
|
|
@@ -2,7 +2,7 @@ You are the supervisor of an autonomous coding repository. Your job is to advanc
|
|
|
2
2
|
|
|
3
3
|
## Priority Order
|
|
4
4
|
|
|
5
|
-
1. **
|
|
5
|
+
1. **Always strive for mission complete** — every action you take should aim to finish the mission. Create one comprehensive issue that targets the entire mission (all acceptance criteria, tests, website, docs, README). Only create a second issue if the first transform couldn't complete everything, and scope it to the remaining work. Do not create issues just to fill a quota.
|
|
6
6
|
2. **Dispatch transform when ready issues exist** — transform is where code gets written. Always prefer it over maintain when there are open issues with the `ready` label.
|
|
7
7
|
3. **Dispatch review after transform** — when recent workflow runs show a transform completion, dispatch review to close resolved issues and add `ready` labels to new issues. This keeps the pipeline flowing.
|
|
8
8
|
4. **Fix failing PRs** — dispatch fix-code for any PR with failing checks (include pr-number).
|
|
@@ -12,12 +12,12 @@ You are the supervisor of an autonomous coding repository. Your job is to advanc
|
|
|
12
12
|
|
|
13
13
|
1. **Check what's already in progress** — don't duplicate work. If the workflow is already running, don't dispatch another.
|
|
14
14
|
2. **Prioritise code generation** — the goal is working code. Prefer actions that produce code (dev-only, fix) over metadata (maintain, label).
|
|
15
|
-
3. **
|
|
15
|
+
3. **Right-size the work** — break the mission into chunks just big enough to reliably deliver. One comprehensive issue is better than many small ones. Only create a follow-up issue when the previous transform has landed and gaps remain.
|
|
16
16
|
4. **Respect limits** — don't create issues beyond the WIP limit shown in the context. Don't dispatch workflows that will fail due to missing prerequisites.
|
|
17
17
|
|
|
18
18
|
## When to use each action
|
|
19
19
|
|
|
20
|
-
- **github:create-issue** — When open issues < WIP limit.
|
|
20
|
+
- **github:create-issue** — When open issues < WIP limit. Create comprehensive issues that ask for maximum implementation in a single transform. Each issue should request: implementation code, matching tests, website updates, docs/evidence, and README changes. The first issue should aim to deliver the entire mission (all acceptance criteria, tests, website, docs). If a follow-up issue is needed, it should address whatever the first transform didn't complete. Always include relevant labels (`automated`, `enhancement`).
|
|
21
21
|
- **dispatch:agentic-lib-workflow | mode: dev-only | issue-number: \<N\>** — When there are open issues with the `ready` label and no workflow is currently running.
|
|
22
22
|
- **dispatch:agentic-lib-workflow | mode: review-only** — After observing a recent transform completion, or when there are unenhanced issues needing the `ready` label.
|
|
23
23
|
- **dispatch:agentic-lib-workflow | mode: maintain-only** — When features are below their limit AND no maintain appears in the last 3 workflow runs.
|
|
@@ -38,7 +38,7 @@ When open issues with the `automated` label lack the `ready` label and are more
|
|
|
38
38
|
### Mission Initialised (init completed)
|
|
39
39
|
When recent workflow runs show an init completion, the repository has a fresh or updated mission.
|
|
40
40
|
Dispatch the discussions bot to announce the new mission to the community.
|
|
41
|
-
Include the website URL in the announcement — the site is at `https://<owner>.github.io/<repo
|
|
41
|
+
Include the website URL in the announcement — the site is at `https://<owner>.github.io/<repo>/` and runs the library.
|
|
42
42
|
|
|
43
43
|
### Mission Accomplished (bounded missions)
|
|
44
44
|
When ALL of the following conditions are met, the mission is accomplished:
|
|
@@ -48,7 +48,7 @@ When ALL of the following conditions are met, the mission is accomplished:
|
|
|
48
48
|
4. Evidence artifacts exist under `docs/` (example outputs, test results, or walkthroughs)
|
|
49
49
|
|
|
50
50
|
When all conditions are met:
|
|
51
|
-
1. `dispatch:agentic-lib-bot` — announce mission accomplished in the discussions thread. Include the website URL (`https://<owner>.github.io/<repo>/`)
|
|
51
|
+
1. `dispatch:agentic-lib-bot` — announce mission accomplished in the discussions thread. Include the website URL (`https://<owner>.github.io/<repo>/`) where users can see the finished product.
|
|
52
52
|
2. `set-schedule:off` — stop the workflow. The mission is done.
|
|
53
53
|
3. Log `mission-accomplished` in the activity log.
|
|
54
54
|
|
|
@@ -4,21 +4,59 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>repository0</title>
|
|
7
|
+
<meta property="og:title" content="repository0">
|
|
8
|
+
<meta property="og:description" content="An autonomous repository powered by agentic-lib">
|
|
9
|
+
<meta property="og:type" content="website">
|
|
7
10
|
<style>
|
|
8
11
|
body { font-family: system-ui, -apple-system, sans-serif; max-width: 800px; margin: 0 auto; padding: 2rem; color: #333; }
|
|
9
12
|
h1 { border-bottom: 2px solid #eee; padding-bottom: 0.5rem; }
|
|
10
13
|
a { color: #0366d6; }
|
|
11
|
-
.
|
|
14
|
+
.identity { background: #f6f8fa; padding: 1rem; border-radius: 6px; margin: 1rem 0; font-family: monospace; }
|
|
15
|
+
.identity dt { font-weight: bold; color: #666; }
|
|
16
|
+
.identity dd { margin: 0 0 0.5rem 0; font-size: 1.1rem; }
|
|
17
|
+
.social { display: flex; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; }
|
|
18
|
+
.social a { display: inline-block; padding: 0.4rem 0.8rem; border: 1px solid #ddd; border-radius: 4px; text-decoration: none; font-size: 0.9rem; }
|
|
19
|
+
.social a:hover { background: #f6f8fa; }
|
|
20
|
+
#demo-output { background: #1e1e1e; color: #d4d4d4; padding: 1rem; border-radius: 6px; font-family: monospace; white-space: pre-wrap; min-height: 2rem; }
|
|
12
21
|
</style>
|
|
13
22
|
</head>
|
|
14
23
|
<body>
|
|
15
|
-
<h1>repository0</h1>
|
|
16
|
-
<div class="
|
|
17
|
-
<
|
|
24
|
+
<h1 id="lib-name">repository0</h1>
|
|
25
|
+
<div class="identity">
|
|
26
|
+
<dl>
|
|
27
|
+
<dt>Version</dt>
|
|
28
|
+
<dd id="lib-version">loading...</dd>
|
|
29
|
+
<dt>Description</dt>
|
|
30
|
+
<dd id="lib-description">loading...</dd>
|
|
31
|
+
</dl>
|
|
32
|
+
</div>
|
|
33
|
+
<h2>Output</h2>
|
|
34
|
+
<div id="demo-output">Loading library...</div>
|
|
35
|
+
<h2>Links</h2>
|
|
36
|
+
<div class="social">
|
|
37
|
+
<a id="share-github" href="https://github.com/xn-intenton-z2a/repository0" target="_blank" rel="noopener">GitHub</a>
|
|
38
|
+
<a id="share-twitter" href="#" target="_blank" rel="noopener">X/Twitter</a>
|
|
39
|
+
<a id="share-linkedin" href="#" target="_blank" rel="noopener">LinkedIn</a>
|
|
18
40
|
</div>
|
|
19
41
|
<h2>About</h2>
|
|
20
|
-
<p>See <a href="https://github.com/xn-intenton-z2a/repository0">the repository</a> for source code and mission details.</p>
|
|
21
|
-
<
|
|
22
|
-
|
|
42
|
+
<p>This website uses the library. See <a href="https://github.com/xn-intenton-z2a/repository0">the repository</a> for source code and mission details.</p>
|
|
43
|
+
<script type="module">
|
|
44
|
+
try {
|
|
45
|
+
const { name, version, description } = await import('./lib-meta.js');
|
|
46
|
+
document.getElementById('lib-name').textContent = name;
|
|
47
|
+
document.getElementById('lib-version').textContent = version;
|
|
48
|
+
document.getElementById('lib-description').textContent = description || '(no description)';
|
|
49
|
+
document.getElementById('demo-output').textContent = JSON.stringify({ name, version, description }, null, 2);
|
|
50
|
+
document.title = name + ' v' + version;
|
|
51
|
+
const pageUrl = encodeURIComponent(window.location.href);
|
|
52
|
+
const text = encodeURIComponent('Check out ' + name + ' v' + version + ' — ' + description);
|
|
53
|
+
document.getElementById('share-twitter').href = 'https://x.com/intent/tweet?url=' + pageUrl + '&text=' + text;
|
|
54
|
+
document.getElementById('share-linkedin').href = 'https://www.linkedin.com/sharing/share-offsite/?url=' + pageUrl;
|
|
55
|
+
} catch (e) {
|
|
56
|
+
document.getElementById('lib-version').textContent = '(build required)';
|
|
57
|
+
document.getElementById('lib-description').textContent = 'Run npm run build:web to generate library metadata';
|
|
58
|
+
document.getElementById('demo-output').textContent = 'Library not yet built. Run: npm run build:web';
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
23
61
|
</body>
|
|
24
62
|
</html>
|
package/src/seeds/zero-main.js
CHANGED
|
@@ -3,10 +3,30 @@
|
|
|
3
3
|
// Copyright (C) 2025-2026 Polycode Limited
|
|
4
4
|
// src/lib/main.js
|
|
5
5
|
|
|
6
|
+
import { createRequire } from "module";
|
|
6
7
|
import { fileURLToPath } from "url";
|
|
7
8
|
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
const pkg = require("../../package.json");
|
|
11
|
+
|
|
12
|
+
export const name = pkg.name;
|
|
13
|
+
export const version = pkg.version;
|
|
14
|
+
export const description = pkg.description;
|
|
15
|
+
|
|
16
|
+
export function getIdentity() {
|
|
17
|
+
return { name, version, description };
|
|
18
|
+
}
|
|
19
|
+
|
|
8
20
|
export function main(args) {
|
|
9
|
-
|
|
21
|
+
if (args?.includes("--version")) {
|
|
22
|
+
console.log(version);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (args?.includes("--identity")) {
|
|
26
|
+
console.log(JSON.stringify(getIdentity(), null, 2));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
console.log(`${name}@${version}`);
|
|
10
30
|
}
|
|
11
31
|
|
|
12
32
|
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// Copyright (C) 2025-2026 Polycode Limited
|
|
3
|
-
import { describe, test } from "vitest";
|
|
4
|
-
import { main } from "../../src/lib/main.js";
|
|
3
|
+
import { describe, test, expect } from "vitest";
|
|
4
|
+
import { main, getIdentity, name, version, description } from "../../src/lib/main.js";
|
|
5
5
|
|
|
6
6
|
describe("Main Output", () => {
|
|
7
7
|
test("should terminate without error", () => {
|
|
@@ -9,3 +9,18 @@ describe("Main Output", () => {
|
|
|
9
9
|
main();
|
|
10
10
|
});
|
|
11
11
|
});
|
|
12
|
+
|
|
13
|
+
describe("Library Identity", () => {
|
|
14
|
+
test("exports name, version, and description", () => {
|
|
15
|
+
expect(typeof name).toBe("string");
|
|
16
|
+
expect(typeof version).toBe("string");
|
|
17
|
+
expect(typeof description).toBe("string");
|
|
18
|
+
expect(name.length).toBeGreaterThan(0);
|
|
19
|
+
expect(version).toMatch(/^\d+\.\d+\.\d+/);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test("getIdentity returns correct structure", () => {
|
|
23
|
+
const identity = getIdentity();
|
|
24
|
+
expect(identity).toEqual({ name, version, description });
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
"main": "src/lib/main.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "npm run build:web",
|
|
9
|
-
"build:web": "mkdir -p docs && touch docs/.nojekyll && cp -r src/web/* docs/ 2>/dev/null ||
|
|
9
|
+
"build:web": "mkdir -p docs && touch docs/.nojekyll && cp -r src/web/* docs/ 2>/dev/null || true && node --input-type=commonjs -p \"var p=require('./package.json');['name','version','description'].map(function(k){return 'export const '+k+' = '+JSON.stringify(p[k])+';'}).join('\\n')\" > docs/lib-meta.js",
|
|
10
10
|
"test": "vitest --run tests/unit/*.test.js",
|
|
11
11
|
"test:unit": "vitest --run --coverage tests/unit/*.test.js",
|
|
12
|
-
"start": "
|
|
13
|
-
"start:
|
|
12
|
+
"start": "npm run build:web && npx serve docs",
|
|
13
|
+
"start:cli": "node src/lib/main.js"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [],
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@xn-intenton-z2a/agentic-lib": "^7.1.
|
|
19
|
+
"@xn-intenton-z2a/agentic-lib": "^7.1.69"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@vitest/coverage-v8": "^4.0.18",
|
|
@@ -14,4 +14,20 @@ describe("Website", () => {
|
|
|
14
14
|
expect(html).toContain("<html");
|
|
15
15
|
expect(html).toContain("</html>");
|
|
16
16
|
});
|
|
17
|
+
|
|
18
|
+
test("index.html imports the library via lib-meta.js", () => {
|
|
19
|
+
const html = readFileSync("src/web/index.html", "utf8");
|
|
20
|
+
expect(html).toContain("lib-meta.js");
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test("index.html displays library identity elements", () => {
|
|
24
|
+
const html = readFileSync("src/web/index.html", "utf8");
|
|
25
|
+
expect(html).toContain("lib-name");
|
|
26
|
+
expect(html).toContain("lib-version");
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test("index.html has social share links", () => {
|
|
30
|
+
const html = readFileSync("src/web/index.html", "utf8");
|
|
31
|
+
expect(html).toMatch(/share.*(twitter|x\.com|linkedin)/is);
|
|
32
|
+
});
|
|
17
33
|
});
|