pi-ext
bugabingas pi extensions
owned by admin
style(the-system): apply repository formatting
f7797f53dc151b8c66c690cf434db076da12c812
Oliver Jan Krylow <oliver@bugabinga.net> ·
SSH signature · not checked
Browse filesCompare with HEAD
Changed files (6)
extensions/the-system/__tests__/artifact-slot-tool.test.ts
Modified 33 33 const render = (component
: {
render(width
: number)
: string[] })
=> 34 34 component.
render(
120).
join(
"\n");
35 35 const renderContext = (expanded
: boolean, lastComponent
?: unknown)
=> 36 - ({ expanded, lastComponent, isError:
false }
as never);
36 + ({ expanded, lastComponent, isError:
false })
as never;
38 38 describe(
"system_slot", ()
=> {
39 39 it(
"derives semantic slugs and reserves unique IDs on demand", ()
=> {
extensions/the-system/__tests__/board-runtime.test.ts
Modified 10 10 const render = (component
: {
render(width
: number)
: string[] })
=> 11 11 component.
render(
120).
join(
"\n");
12 12 const renderContext = (expanded
: boolean, lastComponent
?: unknown)
=> 13 - ({ expanded, lastComponent, isError:
false }
as never);
13 + ({ expanded, lastComponent, isError:
false })
as never;
16 16 id:
"PX-SPEC-SPEC0001",
extensions/the-system/__tests__/harness.test.ts
Modified56 56 expect(t.session.
getActiveToolNames()).
toContain(
"system_slot");
57 57 await extension.commands
59 - .
handler(
"exec continue", t.session.extensionRunner.
createCommandContext());
61 + t.session.extensionRunner.
createCommandContext(),
60 63 expect(t.session.
getActiveToolNames()).not.
toContain(
"system_slot");
61 64 expect(t.session.systemPrompt).not.
toContain(
"- system_slot:");
extensions/the-system/__tests__/the-system.test.ts
Modified237 237 agentSettled?.({}, ctx);
238 238 assert.
ok(
!activeTools.
includes(
"system_board_propose"));
239 239 assert.
deepEqual(
240 - JSON.
parse(
readFileSync(path.
join(project,
".system/board.json"),
"utf8")),
241 + readFileSync(path.
join(project,
".system/board.json"),
"utf8"),
241 243 { schemaVersion:
0, items: {} },
266 268 assert.
ok(
!activeTools.
includes(
"system_slot"));
270 - "discovers vertical slicing generally and format skills only in valid projects",
273 - | ((event
: { cwd
: string })
=> Promise<
unknown>)
275 - registerTheSystem({
276 - registerCommand() {},
278 - on(event
: string,
handler: (
...args
: never[])
=> unknown) {
279 - if (
event === "resources_discover") discover
= handler
as never;
282 - const skills
= path.
resolve(
import.
meta.dirname,
"../skills");
283 - const genericSkills
= [path.
join(skills,
"vertical-slices")];
284 - const inactive
= temp();
285 - assert.
deepEqual(
await discover?.({ cwd: inactive }), {
286 - skillPaths: genericSkills,
288 - mkdirSync(path.
join(inactive,
".system"));
289 - assert.
deepEqual(
await discover?.({ cwd: inactive }), {
290 - skillPaths: genericSkills,
292 - const active
= temp();
293 - validSystem(active);
294 - assert.
deepEqual(
await discover?.({ cwd: active }), {
297 - path.
join(skills,
"the-system-gfm"),
298 - path.
join(skills,
"the-system-tex"),
299 - path.
join(skills,
"the-system-mermaid"),
304 - ".system/config.json",
305 - '{"prefix":"PX","schemaVersion":4}',
307 - assert.
deepEqual(
await discover?.({ cwd: active }), {
308 - skillPaths: genericSkills,
271 + it(
"discovers vertical slicing generally and format skills only in valid projects",
async ()
=> {
272 + let discover
: ((event
: { cwd
: string })
=> Promise<
unknown>)
| undefined;
273 + registerTheSystem({
274 + registerCommand() {},
276 + on(event
: string,
handler: (
...args
: never[])
=> unknown) {
277 + if (
event === "resources_discover") discover
= handler
as never;
280 + const skills
= path.
resolve(
import.
meta.dirname,
"../skills");
281 + const genericSkills
= [path.
join(skills,
"vertical-slices")];
282 + const inactive
= temp();
283 + assert.
deepEqual(
await discover?.({ cwd: inactive }), {
284 + skillPaths: genericSkills,
286 + mkdirSync(path.
join(inactive,
".system"));
287 + assert.
deepEqual(
await discover?.({ cwd: inactive }), {
288 + skillPaths: genericSkills,
290 + const active
= temp();
291 + validSystem(active);
292 + assert.
deepEqual(
await discover?.({ cwd: active }), {
295 + path.
join(skills,
"the-system-gfm"),
296 + path.
join(skills,
"the-system-tex"),
297 + path.
join(skills,
"the-system-mermaid"),
300 + write(active,
".system/config.json",
'{"prefix":"PX","schemaVersion":4}');
301 + assert.
deepEqual(
await discover?.({ cwd: active }), {
302 + skillPaths: genericSkills,
313 306 it(
"reports schema mismatches with schema-0 init instructions", ()
=> {
314 307 const project
= temp();
637 630 for (
const instruction
of [
"",
"login flow"])
638 631 await command.
handler(
`${subcommand} ${instruction}`, {
640 - waitForIdle:
async ()
=> assert.
fail(
"lifecycle command must not wait"),
633 + waitForIdle:
async ()
=> 634 + assert.
fail(
"lifecycle command must not wait"),
641 635 ui: {
notify() {} },
643 637 for (
const message
of sent)
652 646 assert.
match(execPrompt,
/never apply automatically/);
653 647 const assessPrompt
= 654 648 sent.
find((item)
=> item.
includes(
"# /system assess"))
?? "";
655 - assert.
match(assessPrompt,
/Submit the assessment through system_board_propose/);
651 + /Submit the assessment through system_board_propose/,
656 653 assert.
doesNotMatch(assessPrompt,
/empty items list/);
657 654 const phasePrompt
= 658 655 sent.
find((item)
=> item.
includes(
"# /system phase\n"))
?? "";
extensions/the-system/__tests__/workflow-skills.test.ts
Modified39 39 /current instructions contain The System Markdown contract/,
41 41 assert.
match(skill,
/already been selected/);
42 - assert.
doesNotMatch(skill.
split(
"---",
3)[
1]
?? "",
/bundle|create|author/);
42 + assert.
doesNotMatch(
43 + skill.
split(
"---",
3)[
1]
?? "",
44 + /bundle|create|author/,
extensions/the-system/system.ts
Modified435 435 return preflightCurrentPhase(
root, target, kind, input, ui);
436 436 if (CORE_PATHS.
has(relative)) {
437 437 if (targetStats
&& !targetStats.
isFile())
438 - return blocked(
`The System expected a regular owned file at ${relative}.`);
439 + `The System expected a regular owned file at ${relative}.`,
439 441 let content
: string;
441 443 content
= candidateContent(target, kind, input);
449 451 `The System candidate validation failed: ${relative} exceeds the ${CORE_BYTE_LIMIT}-byte core limit.`,
452 - ? approveOwnedMutation(relative, kind, ui)
453 + return targetStats
? approveOwnedMutation(relative, kind, ui)
: undefined;
455 455 const location
= governedDocumentPath(relative);