From c580b7113e69af8221d8d39228b702cf67de01dc Mon Sep 17 00:00:00 2001 From: wassname <1103714+wassname@users.noreply.github.com> Date: Thu, 24 Sep 2026 09:24:56 +0800 Subject: [PATCH] Rename contract tests to real-parsers tests Co-Authored-By: Claude <288921227+claudypoo@users.noreply.github.com> --- AGENTS.md | 2 +- test/{contracts.test.ts => real-parsers.test.ts} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename test/{contracts.test.ts => real-parsers.test.ts} (93%) diff --git a/AGENTS.md b/AGENTS.md index 0f6e8b6..ef03a5d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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: diff --git a/test/contracts.test.ts b/test/real-parsers.test.ts similarity index 93% rename from test/contracts.test.ts rename to test/real-parsers.test.ts index d2a25d8..565310a 100644 --- a/test/contracts.test.ts +++ b/test/real-parsers.test.ts @@ -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 void>>(); const events = {