@xn-intenton-z2a/agentic-lib 7.1.44 → 7.1.46
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/bin/agentic-lib.js +32 -6
- package/package.json +1 -1
- package/src/agents/agent-issue-resolution.md +10 -0
- package/src/agents/agent-review-issue.md +4 -0
- package/src/agents/agent-supervisor.md +22 -6
- package/src/seeds/init.yml +32 -11
- package/src/seeds/missions/cron-engine.md +35 -0
- package/src/seeds/missions/dense-encoding.md +37 -0
- package/src/seeds/missions/empty.md +3 -0
- package/src/seeds/missions/fizz-buzz.md +26 -0
- package/src/seeds/missions/hamming-distance.md +26 -0
- package/src/seeds/missions/lunar-lander.md +36 -0
- package/src/seeds/missions/owl-ontology.md +34 -0
- package/src/seeds/missions/plot-code-lib.md +24 -0
- package/src/seeds/missions/roman-numerals.md +30 -0
- package/src/seeds/missions/string-utils.md +36 -0
- package/src/seeds/missions/time-series-lab.md +41 -0
- package/src/seeds/zero-MISSION.md +24 -12
- package/src/seeds/zero-package.json +1 -1
package/bin/agentic-lib.js
CHANGED
|
@@ -54,6 +54,7 @@ Options:
|
|
|
54
54
|
--reseed Clear features + activity log (keep source code)
|
|
55
55
|
--dry-run Show what would be done without making changes
|
|
56
56
|
--target <path> Target repository (default: current directory)
|
|
57
|
+
--mission <name> Mission seed name (default: hamming-distance) [purge only]
|
|
57
58
|
--model <name> Copilot SDK model (default: claude-sonnet-4)
|
|
58
59
|
|
|
59
60
|
Examples:
|
|
@@ -81,6 +82,8 @@ const targetPath = targetIdx >= 0 ? flags[targetIdx + 1] : process.cwd();
|
|
|
81
82
|
const target = resolve(targetPath);
|
|
82
83
|
const modelIdx = flags.indexOf("--model");
|
|
83
84
|
const model = modelIdx >= 0 ? flags[modelIdx + 1] : "claude-sonnet-4";
|
|
85
|
+
const missionIdx = flags.indexOf("--mission");
|
|
86
|
+
const mission = missionIdx >= 0 ? flags[missionIdx + 1] : "hamming-distance";
|
|
84
87
|
|
|
85
88
|
// ─── Task Commands ───────────────────────────────────────────────────
|
|
86
89
|
|
|
@@ -694,8 +697,12 @@ function initDirContents(srcSubdir, dstDir, label) {
|
|
|
694
697
|
console.log(`\n--- ${label} ---`);
|
|
695
698
|
const dir = resolve(srcDir, srcSubdir);
|
|
696
699
|
if (!existsSync(dir)) return;
|
|
697
|
-
for (const
|
|
698
|
-
|
|
700
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
701
|
+
if (entry.isDirectory()) {
|
|
702
|
+
initCopyDirRecursive(resolve(dir, entry.name), resolve(dstDir, entry.name), `${srcSubdir}/${entry.name}`);
|
|
703
|
+
} else {
|
|
704
|
+
initCopyFile(resolve(dir, entry.name), resolve(dstDir, entry.name), `${srcSubdir}/${entry.name}`);
|
|
705
|
+
}
|
|
699
706
|
}
|
|
700
707
|
}
|
|
701
708
|
|
|
@@ -825,7 +832,7 @@ function clearAndRecreateDir(dirPath, label) {
|
|
|
825
832
|
if (!dryRun) mkdirSync(fullPath, { recursive: true });
|
|
826
833
|
}
|
|
827
834
|
|
|
828
|
-
function initPurge(seedsDir) {
|
|
835
|
+
function initPurge(seedsDir, missionName) {
|
|
829
836
|
console.log("\n--- Purge: Reset Source Files to Seed State ---");
|
|
830
837
|
|
|
831
838
|
const { sourcePath, testsPath, examplesPath } = readTomlPaths();
|
|
@@ -833,11 +840,10 @@ function initPurge(seedsDir) {
|
|
|
833
840
|
clearAndRecreateDir(testsPath, testsPath);
|
|
834
841
|
clearAndRecreateDir(examplesPath, examplesPath);
|
|
835
842
|
|
|
836
|
-
// Copy seed files (including config TOML)
|
|
843
|
+
// Copy seed files (including config TOML) — MISSION.md handled separately via mission seed
|
|
837
844
|
const SEED_MAP = {
|
|
838
845
|
"zero-main.js": "src/lib/main.js",
|
|
839
846
|
"zero-main.test.js": "tests/unit/main.test.js",
|
|
840
|
-
"zero-MISSION.md": "MISSION.md",
|
|
841
847
|
"zero-SOURCES.md": "SOURCES.md",
|
|
842
848
|
"zero-package.json": "package.json",
|
|
843
849
|
"zero-README.md": "README.md",
|
|
@@ -850,6 +856,25 @@ function initPurge(seedsDir) {
|
|
|
850
856
|
initCopyFile(src, resolve(target, targetRel), `SEED: ${seedFile} → ${targetRel}`);
|
|
851
857
|
}
|
|
852
858
|
}
|
|
859
|
+
|
|
860
|
+
// Copy mission seed file as MISSION.md
|
|
861
|
+
const missionsDir = resolve(seedsDir, "missions");
|
|
862
|
+
const missionFile = resolve(missionsDir, `${missionName}.md`);
|
|
863
|
+
if (existsSync(missionFile)) {
|
|
864
|
+
initCopyFile(missionFile, resolve(target, "MISSION.md"), `MISSION: missions/${missionName}.md → MISSION.md`);
|
|
865
|
+
} else {
|
|
866
|
+
// List available missions and error
|
|
867
|
+
const available = existsSync(missionsDir)
|
|
868
|
+
? readdirSync(missionsDir)
|
|
869
|
+
.filter((f) => f.endsWith(".md"))
|
|
870
|
+
.map((f) => f.replace(/\.md$/, ""))
|
|
871
|
+
: [];
|
|
872
|
+
console.error(`\nERROR: Unknown mission "${missionName}".`);
|
|
873
|
+
if (available.length > 0) {
|
|
874
|
+
console.error(`Available missions: ${available.join(", ")}`);
|
|
875
|
+
}
|
|
876
|
+
process.exit(1);
|
|
877
|
+
}
|
|
853
878
|
}
|
|
854
879
|
|
|
855
880
|
function initPurgeGitHub() {
|
|
@@ -1026,6 +1051,7 @@ function runInit() {
|
|
|
1026
1051
|
console.log(`Target: ${target}`);
|
|
1027
1052
|
console.log(`Reseed: ${reseed}`);
|
|
1028
1053
|
console.log(`Purge: ${purge}`);
|
|
1054
|
+
if (purge) console.log(`Mission: ${mission}`);
|
|
1029
1055
|
console.log(`Mode: ${dryRun ? "DRY RUN" : "LIVE"}`);
|
|
1030
1056
|
console.log("");
|
|
1031
1057
|
|
|
@@ -1036,7 +1062,7 @@ function runInit() {
|
|
|
1036
1062
|
initScripts(agenticDir);
|
|
1037
1063
|
initConfig(seedsDir);
|
|
1038
1064
|
if (reseed) initReseed();
|
|
1039
|
-
if (purge) initPurge(seedsDir);
|
|
1065
|
+
if (purge) initPurge(seedsDir, mission);
|
|
1040
1066
|
if (purge) initPurgeGitHub();
|
|
1041
1067
|
|
|
1042
1068
|
console.log(`\n${initChanges} change(s)${dryRun ? " (dry run)" : ""}`);
|
package/package.json
CHANGED
|
@@ -11,3 +11,13 @@ of the codebase's primary purpose.
|
|
|
11
11
|
Do as much as you can all at once.
|
|
12
12
|
|
|
13
13
|
Follow the linting guidelines and the formatting guidelines from the included config.
|
|
14
|
+
|
|
15
|
+
## Evidence Gathering
|
|
16
|
+
|
|
17
|
+
When implementing features, also produce evidence artifacts under `docs/`:
|
|
18
|
+
- Example output files demonstrating the feature works (images, data files, text) → `docs/examples/`
|
|
19
|
+
- Machine-readable results (JSON/CSV) for downstream consumers (stats dashboards, infographics) → `docs/evidence/`
|
|
20
|
+
- Summary walkthroughs showing usage with real output → `docs/reports/`
|
|
21
|
+
|
|
22
|
+
Design the library API with hooks that make evidence capture easy: return structured result objects,
|
|
23
|
+
support `outputFile` options where appropriate, and emit results that observers can record.
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
Does the combination source file, test file, README file and dependencies file show a solution
|
|
2
2
|
with a reasonable likelihood of including a high-impact resolution to the following issue? Evaluate whether the solution delivers substantial user value, addresses core functionality needs, and directly enhances the product's primary purpose rather than implementing superficial improvements or excessive validation.
|
|
3
|
+
|
|
4
|
+
When reviewing, also check that evidence artifacts exist under `docs/` for implemented features.
|
|
5
|
+
If a feature works but has no evidence (no example outputs, test results, or walkthroughs in `docs/`),
|
|
6
|
+
note this in the review and suggest creating an issue to generate evidence.
|
|
@@ -40,13 +40,29 @@ When open issues with the `automated` label lack the `ready` label and are more
|
|
|
40
40
|
When recent workflow runs show an init completion, the repository has a fresh or updated mission.
|
|
41
41
|
Dispatch the discussions bot to announce the new mission to the community.
|
|
42
42
|
|
|
43
|
-
### Mission
|
|
44
|
-
When
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
### Mission Accomplished (bounded missions)
|
|
44
|
+
When ALL of the following conditions are met, the mission is accomplished:
|
|
45
|
+
1. All open issues are closed
|
|
46
|
+
2. Tests pass (CI gates commits, so this is usually the case)
|
|
47
|
+
3. The MISSION.md acceptance criteria are all satisfied
|
|
48
|
+
4. Evidence artifacts exist under `docs/` (example outputs, test results, or walkthroughs)
|
|
49
|
+
|
|
50
|
+
When all conditions are met:
|
|
51
|
+
1. `dispatch:agent-discussions-bot` — announce mission accomplished in the discussions thread
|
|
52
|
+
2. `set-schedule:off` — stop the supervisor. The mission is done.
|
|
53
|
+
3. Log `mission-accomplished` in the activity log.
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
### Ongoing Missions
|
|
56
|
+
If MISSION.md explicitly says "do not set schedule to off" or "ongoing mission", the mission never completes.
|
|
57
|
+
Instead, when activity is healthy, use `set-schedule:weekly` or `set-schedule:daily` to keep the pipeline running.
|
|
58
|
+
Never use `set-schedule:off` for ongoing missions.
|
|
59
|
+
|
|
60
|
+
### Mission Substantially Complete (bounded, but minor gaps)
|
|
61
|
+
When the transform agent has implemented all major features but minor polish remains
|
|
62
|
+
(e.g. missing README examples, incomplete edge case coverage):
|
|
63
|
+
1. `dispatch:agent-discussions-bot` — announce near-completion in the discussions thread
|
|
64
|
+
2. `set-schedule:weekly` — reduce to weekly maintenance check-ins
|
|
65
|
+
3. Check that `docs/` contains evidence of the library working before declaring done
|
|
50
66
|
|
|
51
67
|
## Guidelines
|
|
52
68
|
|
package/src/seeds/init.yml
CHANGED
|
@@ -28,8 +28,25 @@ on:
|
|
|
28
28
|
type: boolean
|
|
29
29
|
required: false
|
|
30
30
|
default: false
|
|
31
|
-
mission:
|
|
32
|
-
description: "Mission
|
|
31
|
+
mission-seed:
|
|
32
|
+
description: "Mission seed name (purge only)"
|
|
33
|
+
type: choice
|
|
34
|
+
required: false
|
|
35
|
+
default: "hamming-distance"
|
|
36
|
+
options:
|
|
37
|
+
- hamming-distance
|
|
38
|
+
- fizz-buzz
|
|
39
|
+
- roman-numerals
|
|
40
|
+
- lunar-lander
|
|
41
|
+
- string-utils
|
|
42
|
+
- dense-encoding
|
|
43
|
+
- plot-code-lib
|
|
44
|
+
- cron-engine
|
|
45
|
+
- owl-ontology
|
|
46
|
+
- time-series-lab
|
|
47
|
+
- empty
|
|
48
|
+
mission-text:
|
|
49
|
+
description: "Freeform mission text for MISSION.md (overrides mission-seed if provided)"
|
|
33
50
|
type: string
|
|
34
51
|
required: false
|
|
35
52
|
default: ""
|
|
@@ -70,8 +87,10 @@ jobs:
|
|
|
70
87
|
echo "mode=${MODE:-update}" >> $GITHUB_OUTPUT
|
|
71
88
|
DRY_RUN='${{ inputs.dry-run }}'
|
|
72
89
|
echo "dry-run=${DRY_RUN:-false}" >> $GITHUB_OUTPUT
|
|
73
|
-
|
|
74
|
-
echo "mission=${
|
|
90
|
+
MISSION_SEED='${{ inputs.mission-seed }}'
|
|
91
|
+
echo "mission-seed=${MISSION_SEED:-hamming-distance}" >> $GITHUB_OUTPUT
|
|
92
|
+
MISSION_TEXT='${{ inputs.mission-text }}'
|
|
93
|
+
echo "mission-text=${MISSION_TEXT}" >> $GITHUB_OUTPUT
|
|
75
94
|
SCHEDULE='${{ inputs.schedule }}'
|
|
76
95
|
echo "schedule=${SCHEDULE}" >> $GITHUB_OUTPUT
|
|
77
96
|
MODEL='${{ inputs.model }}'
|
|
@@ -79,7 +98,8 @@ jobs:
|
|
|
79
98
|
outputs:
|
|
80
99
|
mode: ${{ steps.normalise.outputs.mode }}
|
|
81
100
|
dry-run: ${{ steps.normalise.outputs.dry-run }}
|
|
82
|
-
mission: ${{ steps.normalise.outputs.mission }}
|
|
101
|
+
mission-seed: ${{ steps.normalise.outputs.mission-seed }}
|
|
102
|
+
mission-text: ${{ steps.normalise.outputs.mission-text }}
|
|
83
103
|
schedule: ${{ steps.normalise.outputs.schedule }}
|
|
84
104
|
model: ${{ steps.normalise.outputs.model }}
|
|
85
105
|
|
|
@@ -89,7 +109,8 @@ jobs:
|
|
|
89
109
|
env:
|
|
90
110
|
INIT_MODE: ${{ needs.params.outputs.mode }}
|
|
91
111
|
INIT_DRY_RUN: ${{ needs.params.outputs.dry-run }}
|
|
92
|
-
|
|
112
|
+
INIT_MISSION_SEED: ${{ needs.params.outputs.mission-seed }}
|
|
113
|
+
INIT_MISSION_TEXT: ${{ needs.params.outputs.mission-text }}
|
|
93
114
|
steps:
|
|
94
115
|
- uses: actions/checkout@v4
|
|
95
116
|
with:
|
|
@@ -114,15 +135,15 @@ jobs:
|
|
|
114
135
|
run: |
|
|
115
136
|
FLAGS="init"
|
|
116
137
|
if [ "$INIT_MODE" = "reseed" ]; then FLAGS="$FLAGS --reseed"; fi
|
|
117
|
-
if [ "$INIT_MODE" = "purge" ]; then FLAGS="$FLAGS --purge"; fi
|
|
138
|
+
if [ "$INIT_MODE" = "purge" ]; then FLAGS="$FLAGS --purge --mission $INIT_MISSION_SEED"; fi
|
|
118
139
|
if [ "$INIT_DRY_RUN" = "true" ]; then FLAGS="$FLAGS --dry-run"; fi
|
|
119
140
|
npx @xn-intenton-z2a/agentic-lib $FLAGS
|
|
120
141
|
|
|
121
|
-
- name: Write mission (if provided)
|
|
122
|
-
if: env.
|
|
142
|
+
- name: Write mission text (if provided, overrides seed)
|
|
143
|
+
if: env.INIT_MISSION_TEXT != ''
|
|
123
144
|
run: |
|
|
124
|
-
printf '# Mission\n\n%s\n' "$
|
|
125
|
-
echo "Wrote custom mission to MISSION.md"
|
|
145
|
+
printf '# Mission\n\n%s\n' "$INIT_MISSION_TEXT" > MISSION.md
|
|
146
|
+
echo "Wrote custom mission text to MISSION.md"
|
|
126
147
|
|
|
127
148
|
- run: npm install
|
|
128
149
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Mission
|
|
2
|
+
|
|
3
|
+
A JavaScript library that parses cron expressions, computes next run times, and checks schedule matches.
|
|
4
|
+
|
|
5
|
+
## Core Functions
|
|
6
|
+
|
|
7
|
+
- `parseCron(expression)` — parse a cron expression (standard 5-field, or 6-field with seconds) into a structured object. Supports ranges (`1-5`), lists (`1,3,5`), steps (`*/15`), and wildcards (`*`).
|
|
8
|
+
- `nextRun(expression, after?)` — compute the next run time after the given date (default: now). Returns a `Date`.
|
|
9
|
+
- `nextRuns(expression, count, after?)` — compute the next N run times. Returns an array of `Date`.
|
|
10
|
+
- `matches(expression, date)` — check if a date matches a cron expression. Returns boolean.
|
|
11
|
+
- `toString(parsed)` — convert a parsed cron object back to a cron string.
|
|
12
|
+
|
|
13
|
+
## Special Strings
|
|
14
|
+
|
|
15
|
+
Support these shortcuts: `@yearly` (`0 0 1 1 *`), `@monthly` (`0 0 1 * *`), `@weekly` (`0 0 * * 0`), `@daily` (`0 0 * * *`), `@hourly` (`0 * * * *`).
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
- Handle edge cases: DST transitions, month-end boundaries (e.g. "30th of February"), leap years.
|
|
20
|
+
- Validate expressions: throw on invalid syntax with a descriptive error message.
|
|
21
|
+
- No external dependencies required (but allowed if beneficial).
|
|
22
|
+
- Export all functions as named exports from `src/lib/main.js`.
|
|
23
|
+
- Comprehensive unit tests covering field combinations, special strings, edge cases, and invalid input.
|
|
24
|
+
- README with usage examples.
|
|
25
|
+
|
|
26
|
+
## Acceptance Criteria
|
|
27
|
+
|
|
28
|
+
- [ ] `parseCron("*/15 * * * *")` returns a valid parsed object
|
|
29
|
+
- [ ] `nextRun("0 9 * * 1")` returns the next Monday at 09:00
|
|
30
|
+
- [ ] `matches("0 0 25 12 *", new Date("2025-12-25"))` returns `true`
|
|
31
|
+
- [ ] `nextRuns("@daily", 7)` returns 7 consecutive daily dates
|
|
32
|
+
- [ ] DST transitions handled correctly (no skipped or duplicated runs)
|
|
33
|
+
- [ ] Invalid expressions throw descriptive errors
|
|
34
|
+
- [ ] All unit tests pass
|
|
35
|
+
- [ ] README documents usage with examples
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Mission
|
|
2
|
+
|
|
3
|
+
A JavaScript library that explores the frontier of binary-to-text encoding density using printable characters. The benchmark: produce the shortest possible printable representation of a v7 UUID.
|
|
4
|
+
|
|
5
|
+
## Core Functions
|
|
6
|
+
|
|
7
|
+
- `encode(buffer, encoding)` / `decode(str, encoding)` — encode/decode arbitrary binary data using a named encoding.
|
|
8
|
+
- `encodeUUID(uuid)` / `decodeUUID(str)` — shorthand for UUID encoding (strip dashes, encode the 16 bytes).
|
|
9
|
+
- `createEncoding(name, charset)` — define a custom encoding from a character set string.
|
|
10
|
+
- `listEncodings()` — return available encodings with their bit density and charset info.
|
|
11
|
+
|
|
12
|
+
## Built-in Encodings
|
|
13
|
+
|
|
14
|
+
The library should implement progressively denser encodings:
|
|
15
|
+
|
|
16
|
+
- `base62` — `[0-9a-zA-Z]`, ~5.95 bits/char, URL-safe, 22 chars for a UUID
|
|
17
|
+
- `base85` (Ascii85/Z85) — ~6.41 bits/char, 20 chars for a UUID
|
|
18
|
+
- `base91` — ~6.50 bits/char, ~20 chars for a UUID
|
|
19
|
+
- Optionally: custom higher bases cherry-picking from safe printable Unicode
|
|
20
|
+
|
|
21
|
+
## Requirements
|
|
22
|
+
|
|
23
|
+
- Round-trip property: `decode(encode(x, enc), enc)` must equal `x` for all inputs and all encodings.
|
|
24
|
+
- No control characters, no ambiguous characters (0/O, 1/l/I in contexts where they matter).
|
|
25
|
+
- Test across edge cases: all-zero bytes, all-0xFF bytes, single byte, empty buffer.
|
|
26
|
+
- Compare encoded UUID lengths across all encodings.
|
|
27
|
+
- Export all functions as named exports from `src/lib/main.js`.
|
|
28
|
+
- README with UUID encoding comparison table.
|
|
29
|
+
|
|
30
|
+
## Acceptance Criteria
|
|
31
|
+
|
|
32
|
+
- [ ] At least 3 working encodings (base62, base85, one higher)
|
|
33
|
+
- [ ] Round-trip correct for arbitrary binary data including edge cases
|
|
34
|
+
- [ ] UUID encoding shorter than base64 (< 24 chars) for the densest encoding
|
|
35
|
+
- [ ] `listEncodings()` returns encoding metadata
|
|
36
|
+
- [ ] All unit tests pass
|
|
37
|
+
- [ ] README shows UUID encoding comparison table
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Mission
|
|
2
|
+
|
|
3
|
+
A JavaScript library exporting FizzBuzz functions. This is the simplest possible mission — if the pipeline can't complete this and stop, something is fundamentally broken.
|
|
4
|
+
|
|
5
|
+
## Core Functions
|
|
6
|
+
|
|
7
|
+
- `fizzBuzz(n)` — return an array of strings from 1 to n, replacing multiples of 3 with "Fizz", multiples of 5 with "Buzz", and multiples of both with "FizzBuzz".
|
|
8
|
+
- `fizzBuzzSingle(n)` — return the FizzBuzz string for a single positive integer.
|
|
9
|
+
|
|
10
|
+
## Requirements
|
|
11
|
+
|
|
12
|
+
- Handle edge cases: `n = 0` returns an empty array, negative numbers throw `RangeError`, non-integers throw `TypeError`.
|
|
13
|
+
- Export both functions as named exports from `src/lib/main.js`.
|
|
14
|
+
- Comprehensive unit tests covering normal operation and all edge cases.
|
|
15
|
+
- README with usage examples.
|
|
16
|
+
|
|
17
|
+
## Acceptance Criteria
|
|
18
|
+
|
|
19
|
+
- [ ] `fizzBuzz(15)` returns the correct 15-element array ending with "FizzBuzz"
|
|
20
|
+
- [ ] `fizzBuzzSingle(3)` returns "Fizz"
|
|
21
|
+
- [ ] `fizzBuzzSingle(5)` returns "Buzz"
|
|
22
|
+
- [ ] `fizzBuzzSingle(15)` returns "FizzBuzz"
|
|
23
|
+
- [ ] `fizzBuzzSingle(7)` returns "7"
|
|
24
|
+
- [ ] `fizzBuzz(0)` returns `[]`
|
|
25
|
+
- [ ] All unit tests pass
|
|
26
|
+
- [ ] README documents usage with examples
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Mission
|
|
2
|
+
|
|
3
|
+
A JavaScript library exporting Hamming distance functions.
|
|
4
|
+
|
|
5
|
+
## Core Functions
|
|
6
|
+
|
|
7
|
+
- `hammingDistance(a, b)` — compute the Hamming distance between two strings of equal length (number of positions where characters differ). Throw an error if the strings have different lengths.
|
|
8
|
+
- `hammingDistanceBits(x, y)` — compute the Hamming distance between two non-negative integers (count the number of differing bits).
|
|
9
|
+
|
|
10
|
+
## Requirements
|
|
11
|
+
|
|
12
|
+
- Handle Unicode strings correctly (compare code points, not UTF-16 code units).
|
|
13
|
+
- Validate inputs: throw `TypeError` for non-string/non-integer arguments, `RangeError` for unequal-length strings or negative integers.
|
|
14
|
+
- Export both functions as named exports from `src/lib/main.js`.
|
|
15
|
+
- Comprehensive unit tests covering normal cases, edge cases (empty strings, zero, large integers), and error cases.
|
|
16
|
+
- README with usage examples and API documentation.
|
|
17
|
+
|
|
18
|
+
## Acceptance Criteria
|
|
19
|
+
|
|
20
|
+
- [ ] `hammingDistance("karolin", "kathrin")` returns `3`
|
|
21
|
+
- [ ] `hammingDistance("", "")` returns `0`
|
|
22
|
+
- [ ] `hammingDistance("a", "bb")` throws `RangeError`
|
|
23
|
+
- [ ] `hammingDistanceBits(1, 4)` returns `2` (binary: 001 vs 100)
|
|
24
|
+
- [ ] `hammingDistanceBits(0, 0)` returns `0`
|
|
25
|
+
- [ ] All unit tests pass
|
|
26
|
+
- [ ] README documents usage with examples
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Mission
|
|
2
|
+
|
|
3
|
+
A JavaScript library that simulates a lunar lander descent and provides an autopilot controller.
|
|
4
|
+
|
|
5
|
+
## Physics Model (1D simplified)
|
|
6
|
+
|
|
7
|
+
- Initial altitude: 1000m, initial velocity: 40 m/s (toward surface), fuel: 25 units
|
|
8
|
+
- Gravity: adds 2 m/s per tick to velocity (increasing downward speed)
|
|
9
|
+
- Thrust: each fuel unit burned reduces velocity by 4 m/s
|
|
10
|
+
- Landing: altitude reaches 0. Safe if velocity ≤ 4 m/s, crash if > 4 m/s
|
|
11
|
+
|
|
12
|
+
## Core Functions
|
|
13
|
+
|
|
14
|
+
- `createLander(opts?)` — create a lander state object with configurable initial conditions (altitude, velocity, fuel). Defaults to the values above.
|
|
15
|
+
- `step(lander, thrust)` — advance one tick, burn `thrust` fuel units (clamped to available fuel), return a new state object. The state is immutable.
|
|
16
|
+
- `simulate(lander, controller)` — run to completion using a controller function `(state) => thrustUnits`. Returns an array of states (the trace).
|
|
17
|
+
- `autopilot(state)` — a built-in controller that lands safely. This is the algorithmically interesting part.
|
|
18
|
+
- `score(trace)` — score a landing: 0 for crash, higher for less fuel used + lower landing velocity.
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
- The autopilot must land safely across a range of initial conditions: altitude 500–2000m, velocity 20–80 m/s, fuel 10–50 units.
|
|
23
|
+
- State objects are plain objects: `{ altitude, velocity, fuel, tick, landed, crashed }`.
|
|
24
|
+
- Export all functions as named exports from `src/lib/main.js`.
|
|
25
|
+
- Comprehensive unit tests including physics correctness, autopilot safety across parameter ranges, and edge cases (zero fuel, already landed).
|
|
26
|
+
- README with example simulation output showing a successful landing trace.
|
|
27
|
+
|
|
28
|
+
## Acceptance Criteria
|
|
29
|
+
|
|
30
|
+
- [ ] `step()` correctly applies gravity and thrust physics
|
|
31
|
+
- [ ] `autopilot` lands safely with default initial conditions
|
|
32
|
+
- [ ] `autopilot` lands safely across at least 10 different (altitude, velocity, fuel) combinations
|
|
33
|
+
- [ ] `score()` returns 0 for crashes, positive for safe landings
|
|
34
|
+
- [ ] `simulate()` returns a complete trace from start to landing
|
|
35
|
+
- [ ] All unit tests pass
|
|
36
|
+
- [ ] README shows example simulation output
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Mission
|
|
2
|
+
|
|
3
|
+
A JavaScript library that manages a simple OWL-like ontology stored as JSON-LD files in a `data/` directory. The pipeline should both build the library AND populate it with example ontology data over successive transform cycles.
|
|
4
|
+
|
|
5
|
+
This is an ongoing mission. Do not set schedule to off.
|
|
6
|
+
|
|
7
|
+
## Core Functions
|
|
8
|
+
|
|
9
|
+
- `defineClass(name, superclass?)` — define an ontology class, optionally as a subclass.
|
|
10
|
+
- `defineProperty(name, domain, range, opts?)` — define a property linking two classes.
|
|
11
|
+
- `addIndividual(className, id, properties)` — add an instance of a class with property values.
|
|
12
|
+
- `query(pattern)` — basic pattern matching over the ontology (e.g. find all instances of a class, find by property value).
|
|
13
|
+
- `load(dir?)` — load ontology from JSON-LD files in the data directory.
|
|
14
|
+
- `save(dir?)` — persist the ontology to JSON-LD files.
|
|
15
|
+
- `stats()` — return counts of classes, properties, and individuals.
|
|
16
|
+
|
|
17
|
+
## Requirements
|
|
18
|
+
|
|
19
|
+
- Store data as JSON-LD files in `data/` (one file per class or a single graph file — implementer's choice).
|
|
20
|
+
- The library should be usable both programmatically and to build up ontology data over time.
|
|
21
|
+
- Export all functions as named exports from `src/lib/main.js`.
|
|
22
|
+
- Include seed ontology data (e.g. a simple animal taxonomy) to demonstrate the library works.
|
|
23
|
+
- Unit tests covering CRUD operations, querying, and persistence.
|
|
24
|
+
- README with usage examples.
|
|
25
|
+
|
|
26
|
+
## Acceptance Criteria
|
|
27
|
+
|
|
28
|
+
- [ ] Can define classes and properties
|
|
29
|
+
- [ ] Can add individuals and query them
|
|
30
|
+
- [ ] Data persists to and loads from JSON-LD files
|
|
31
|
+
- [ ] At least one example ontology (e.g. animals) is populated in `data/`
|
|
32
|
+
- [ ] `stats()` returns correct counts
|
|
33
|
+
- [ ] All unit tests pass
|
|
34
|
+
- [ ] README documents the API with examples
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Mission
|
|
2
|
+
|
|
3
|
+
_"Be a go-to plot library with a CLI, be the jq of formulae visualisations."_
|
|
4
|
+
|
|
5
|
+
**plot-code-lib** is a JavaScript library and CLI tool designed to:
|
|
6
|
+
- Transform and given range and a simple expression syntax for (pick an existing open standard) to time series data.
|
|
7
|
+
- Read and write the time series data in a standard format (pick an existing open standard).
|
|
8
|
+
- Make use of libraries for formula parsing, time series generation, plotting, and persistence in image formats.
|
|
9
|
+
- Generate SVG and PNG plots from the time series data and save these as files.
|
|
10
|
+
- Variations on this example: `node run start -- --expression "y=sin(x)" --range "x=-1:-1,y=-1:-1" --file output.svg` .
|
|
11
|
+
- Showcase all the features of the library via a CLI by dry running tp generate example commands and output in the README.md file.
|
|
12
|
+
|
|
13
|
+
`plot-code-lib` facilitate the creation of plots from mathematical expressions and time series data. It will take a
|
|
14
|
+
mathematical expression and a range of values and generate a plot in SVG or PNG format.
|
|
15
|
+
|
|
16
|
+
## Acceptance Criteria
|
|
17
|
+
|
|
18
|
+
- [ ] Library parses mathematical expressions (e.g. `y=sin(x)`)
|
|
19
|
+
- [ ] Generates time series data from expression and range
|
|
20
|
+
- [ ] Produces SVG output files
|
|
21
|
+
- [ ] Produces PNG output files
|
|
22
|
+
- [ ] CLI interface works with `--expression`, `--range`, `--file` flags
|
|
23
|
+
- [ ] README showcases example commands and output
|
|
24
|
+
- [ ] All unit tests pass
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Mission
|
|
2
|
+
|
|
3
|
+
A JavaScript library for converting between integers and Roman numeral strings.
|
|
4
|
+
|
|
5
|
+
## Core Functions
|
|
6
|
+
|
|
7
|
+
- `toRoman(n)` — convert an integer (1–3999) to its Roman numeral representation using subtractive notation (IV, IX, XL, XC, CD, CM).
|
|
8
|
+
- `fromRoman(s)` — convert a Roman numeral string back to an integer.
|
|
9
|
+
|
|
10
|
+
## Requirements
|
|
11
|
+
|
|
12
|
+
- Throw `RangeError` for numbers outside 1–3999.
|
|
13
|
+
- Throw `TypeError` for invalid Roman numeral strings.
|
|
14
|
+
- Handle subtractive notation correctly (e.g. IV = 4, not IIII).
|
|
15
|
+
- The round-trip property must hold: `fromRoman(toRoman(n)) === n` for all valid n.
|
|
16
|
+
- Export both functions as named exports from `src/lib/main.js`.
|
|
17
|
+
- Comprehensive unit tests including boundary values (1, 3999), subtractive cases, and invalid inputs.
|
|
18
|
+
- README with usage examples and conversion table.
|
|
19
|
+
|
|
20
|
+
## Acceptance Criteria
|
|
21
|
+
|
|
22
|
+
- [ ] `toRoman(1994)` returns `"MCMXCIV"`
|
|
23
|
+
- [ ] `fromRoman("MCMXCIV")` returns `1994`
|
|
24
|
+
- [ ] `toRoman(4)` returns `"IV"`
|
|
25
|
+
- [ ] `fromRoman(toRoman(n)) === n` for all n in 1–3999
|
|
26
|
+
- [ ] `toRoman(0)` throws `RangeError`
|
|
27
|
+
- [ ] `toRoman(4000)` throws `RangeError`
|
|
28
|
+
- [ ] `fromRoman("IIII")` throws or returns `4` (accept either; document the choice)
|
|
29
|
+
- [ ] All unit tests pass
|
|
30
|
+
- [ ] README documents usage with examples
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Mission
|
|
2
|
+
|
|
3
|
+
A JavaScript library of string utility functions. This is a bag-of-functions problem — each function is independent.
|
|
4
|
+
|
|
5
|
+
## Core Functions
|
|
6
|
+
|
|
7
|
+
Export each as a named function from `src/lib/main.js`:
|
|
8
|
+
|
|
9
|
+
- `slugify(str)` — convert to URL-friendly slug (lowercase, hyphens, strip non-alphanumeric)
|
|
10
|
+
- `truncate(str, maxLength, suffix?)` — truncate with suffix (default "…"), don't break mid-word
|
|
11
|
+
- `camelCase(str)` — convert to camelCase
|
|
12
|
+
- `kebabCase(str)` — convert to kebab-case
|
|
13
|
+
- `titleCase(str)` — capitalise first letter of each word
|
|
14
|
+
- `wordWrap(str, width)` — wrap text at word boundaries to given width
|
|
15
|
+
- `stripHtml(str)` — remove HTML tags, decode common entities
|
|
16
|
+
- `escapeRegex(str)` — escape special regex characters
|
|
17
|
+
- `pluralize(word, count)` — basic English pluralisation (add "s", handle "y"→"ies", "s"→"ses", etc.)
|
|
18
|
+
- `levenshteinDistance(a, b)` — compute edit distance between two strings
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
- Handle edge cases: empty strings, null/undefined (return empty string), Unicode characters.
|
|
23
|
+
- No external dependencies required (but allowed if beneficial).
|
|
24
|
+
- Comprehensive unit tests for each function including edge cases.
|
|
25
|
+
- README with usage examples for each function.
|
|
26
|
+
|
|
27
|
+
## Acceptance Criteria
|
|
28
|
+
|
|
29
|
+
- [ ] All 10 functions are exported and work correctly
|
|
30
|
+
- [ ] `slugify("Hello World!")` returns `"hello-world"`
|
|
31
|
+
- [ ] `truncate("Hello World", 8)` returns `"Hello…"`
|
|
32
|
+
- [ ] `camelCase("foo-bar-baz")` returns `"fooBarBaz"`
|
|
33
|
+
- [ ] `levenshteinDistance("kitten", "sitting")` returns `3`
|
|
34
|
+
- [ ] Edge cases (empty string, null, Unicode) handled gracefully
|
|
35
|
+
- [ ] All unit tests pass
|
|
36
|
+
- [ ] README documents all functions with examples
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Mission
|
|
2
|
+
|
|
3
|
+
A JavaScript library that finds, normalises, refreshes, and analyses temporal data. The repo's `data/` directory accumulates CSV/JSON datasets over successive transform cycles.
|
|
4
|
+
|
|
5
|
+
This is an ongoing mission. Do not set schedule to off.
|
|
6
|
+
|
|
7
|
+
## Core Capabilities
|
|
8
|
+
|
|
9
|
+
- **Discover** — find publicly available time series data (APIs, open data portals) and fetch snapshots into `data/`.
|
|
10
|
+
- **Normalise** — parse heterogeneous date/time formats, resample to uniform intervals, handle missing values.
|
|
11
|
+
- **Refresh** — on each transform cycle, update existing datasets with newer observations (append, not replace).
|
|
12
|
+
- **Forecast** — implement basic forecasting: moving average, exponential smoothing, linear regression.
|
|
13
|
+
- **Correlate** — find relationships between datasets: cross-correlation, lag analysis.
|
|
14
|
+
- **Report** — generate a `REPORT.md` summarising datasets, trends, and discovered correlations.
|
|
15
|
+
|
|
16
|
+
## Core Functions
|
|
17
|
+
|
|
18
|
+
- `discover(sources?)` — search for and download time series data into `data/`.
|
|
19
|
+
- `load(file)` — load a CSV or JSON dataset, auto-detect date format.
|
|
20
|
+
- `normalise(dataset, interval)` — resample to uniform intervals, interpolate missing values.
|
|
21
|
+
- `refresh(file)` — update an existing dataset with newer data from its source.
|
|
22
|
+
- `forecast(dataset, method, horizon)` — predict future values using the specified method.
|
|
23
|
+
- `correlate(datasetA, datasetB)` — compute cross-correlation between two time series.
|
|
24
|
+
- `report(datasets)` — generate a markdown summary report.
|
|
25
|
+
|
|
26
|
+
## Requirements
|
|
27
|
+
|
|
28
|
+
- Export all functions as named exports from `src/lib/main.js`.
|
|
29
|
+
- Store datasets in `data/` as CSV or JSON with consistent schema.
|
|
30
|
+
- Each dataset file should include metadata (source URL, last updated, interval).
|
|
31
|
+
- Unit tests covering normalisation, forecasting accuracy, and correlation.
|
|
32
|
+
- README with usage examples.
|
|
33
|
+
|
|
34
|
+
## Acceptance Criteria
|
|
35
|
+
|
|
36
|
+
- [ ] Can load and normalise at least one real-world dataset
|
|
37
|
+
- [ ] Forecast produces reasonable predictions (tested against known data)
|
|
38
|
+
- [ ] `data/` directory contains at least one dataset
|
|
39
|
+
- [ ] `REPORT.md` is generated with dataset summaries
|
|
40
|
+
- [ ] All unit tests pass
|
|
41
|
+
- [ ] README documents the API with examples
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
# Mission
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
A JavaScript library exporting Hamming distance functions.
|
|
4
|
+
|
|
5
|
+
## Core Functions
|
|
6
|
+
|
|
7
|
+
- `hammingDistance(a, b)` — compute the Hamming distance between two strings of equal length (number of positions where characters differ). Throw an error if the strings have different lengths.
|
|
8
|
+
- `hammingDistanceBits(x, y)` — compute the Hamming distance between two non-negative integers (count the number of differing bits).
|
|
9
|
+
|
|
10
|
+
## Requirements
|
|
11
|
+
|
|
12
|
+
- Handle Unicode strings correctly (compare code points, not UTF-16 code units).
|
|
13
|
+
- Validate inputs: throw `TypeError` for non-string/non-integer arguments, `RangeError` for unequal-length strings or negative integers.
|
|
14
|
+
- Export both functions as named exports from `src/lib/main.js`.
|
|
15
|
+
- Comprehensive unit tests covering normal cases, edge cases (empty strings, zero, large integers), and error cases.
|
|
16
|
+
- README with usage examples and API documentation.
|
|
17
|
+
|
|
18
|
+
## Acceptance Criteria
|
|
19
|
+
|
|
20
|
+
- [ ] `hammingDistance("karolin", "kathrin")` returns `3`
|
|
21
|
+
- [ ] `hammingDistance("", "")` returns `0`
|
|
22
|
+
- [ ] `hammingDistance("a", "bb")` throws `RangeError`
|
|
23
|
+
- [ ] `hammingDistanceBits(1, 4)` returns `2` (binary: 001 vs 100)
|
|
24
|
+
- [ ] `hammingDistanceBits(0, 0)` returns `0`
|
|
25
|
+
- [ ] All unit tests pass
|
|
26
|
+
- [ ] README documents usage with examples
|