mirror of
https://github.com/wassname/pi-plan.git
synced 2026-09-26 14:10:23 +08:00
Rename contract tests to real-parsers tests
Co-Authored-By: Claude <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
@@ -9,7 +9,7 @@ All model-facing text is in `src/prompts.ts`, in conversation order.
|
||||
Run `npm test`, `npm run typecheck` and `npm run lint` before committing.
|
||||
|
||||
- `test/harness.ts` fakes Pi, the scheduler commands and the pi-subagents event owner.
|
||||
- `test/contracts.test.ts` checks the fakes against the real scheduler core and pi-subagents parsers. Update it when those dependencies change.
|
||||
- `test/real-parsers.test.ts` checks the fakes against the real scheduler core and pi-subagents parsers. Update it when those dependencies change.
|
||||
- Test data flow, ownership and lifecycle. Do not assert exact prompt wording.
|
||||
|
||||
For a real load check without a model:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Real scheduler and pi-subagents parsers: the fakes in harness.ts must match these contracts.
|
||||
// Checks the fakes in harness.ts against the real scheduler core and pi-subagents parsers.
|
||||
import { createRequire } from "node:module";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { registerRuntimeAgentEventListener } from "../node_modules/pi-subagents/src/agents/runtime-agent-events.ts";
|
||||
@@ -8,7 +8,7 @@ import { marker, wakeToken } from "../src/loop.js";
|
||||
|
||||
const core = createRequire(import.meta.url)("@jl1990/pi-scheduler/extensions/scheduler/scheduler-core.cjs");
|
||||
|
||||
describe("pi-scheduler contract", () => {
|
||||
describe("real pi-scheduler core", () => {
|
||||
it("our /schedule payload creates a recurring session prompt whose receipt carries the marker", () => {
|
||||
const parsed = core.splitScheduleCommand(`prompt every 1h :: ${marker("abc-1")}`, new Date());
|
||||
const task = core.createScheduledTask({ action: parsed.action, type: parsed.type, schedule: parsed.schedule, prompt: parsed.payload, scope: "session", sessionFile: "/s.jsonl", cwd: "/" }, new Date());
|
||||
@@ -22,7 +22,7 @@ describe("pi-scheduler contract", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("pi-subagents contract", () => {
|
||||
describe("real pi-subagents parsers", () => {
|
||||
it("registers the judge agent and emits a request the real parser accepts", async () => {
|
||||
const listeners = new Map<string, Array<(data: unknown) => void>>();
|
||||
const events = {
|
||||
Reference in New Issue
Block a user