@agent-plan/core 0.2.25 → 0.2.27

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.
Files changed (66) hide show
  1. package/dist/description-freshness.d.ts +37 -0
  2. package/dist/description-freshness.d.ts.map +1 -0
  3. package/dist/description-freshness.js +84 -0
  4. package/dist/display-status.d.ts +3 -3
  5. package/dist/display-status.d.ts.map +1 -1
  6. package/dist/display-status.js +5 -4
  7. package/dist/handoff-context.d.ts +222 -1
  8. package/dist/handoff-context.d.ts.map +1 -1
  9. package/dist/handoff-context.js +461 -11
  10. package/dist/index.d.ts +8 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +8 -1
  13. package/dist/naming.d.ts +3 -0
  14. package/dist/naming.d.ts.map +1 -1
  15. package/dist/naming.js +7 -0
  16. package/dist/package-version.d.ts +2 -0
  17. package/dist/package-version.d.ts.map +1 -1
  18. package/dist/package-version.js +1 -1
  19. package/dist/payload-fallback.d.ts +38 -0
  20. package/dist/payload-fallback.d.ts.map +1 -0
  21. package/dist/payload-fallback.js +79 -0
  22. package/dist/plan-store.d.ts +192 -36
  23. package/dist/plan-store.d.ts.map +1 -1
  24. package/dist/plan-store.js +1048 -126
  25. package/dist/planner-rules.d.ts.map +1 -1
  26. package/dist/planner-rules.js +9 -3
  27. package/dist/planner-skill.d.ts +24 -0
  28. package/dist/planner-skill.d.ts.map +1 -0
  29. package/dist/planner-skill.js +113 -0
  30. package/dist/project-context-migration.d.ts +47 -0
  31. package/dist/project-context-migration.d.ts.map +1 -0
  32. package/dist/project-context-migration.js +168 -0
  33. package/dist/read-tracking.d.ts +47 -13
  34. package/dist/read-tracking.d.ts.map +1 -1
  35. package/dist/read-tracking.js +88 -33
  36. package/dist/recap.d.ts.map +1 -1
  37. package/dist/recap.js +34 -9
  38. package/dist/refs.d.ts +6 -1
  39. package/dist/refs.d.ts.map +1 -1
  40. package/dist/refs.js +25 -0
  41. package/dist/renderer.d.ts.map +1 -1
  42. package/dist/renderer.js +24 -2
  43. package/dist/requirement-macro-tasks.d.ts +18 -0
  44. package/dist/requirement-macro-tasks.d.ts.map +1 -0
  45. package/dist/requirement-macro-tasks.js +55 -0
  46. package/dist/runtime-diagnostics.d.ts +34 -0
  47. package/dist/runtime-diagnostics.d.ts.map +1 -0
  48. package/dist/runtime-diagnostics.js +39 -0
  49. package/dist/schema.d.ts +1575 -290
  50. package/dist/schema.d.ts.map +1 -1
  51. package/dist/schema.js +89 -4
  52. package/dist/task-context.d.ts +41 -2
  53. package/dist/task-context.d.ts.map +1 -1
  54. package/dist/task-context.js +102 -4
  55. package/dist/task-selection.d.ts +44 -1
  56. package/dist/task-selection.d.ts.map +1 -1
  57. package/dist/task-selection.js +158 -7
  58. package/dist/task-start-outcome.d.ts +1 -1
  59. package/dist/task-start-outcome.d.ts.map +1 -1
  60. package/dist/task-start-outcome.js +1 -0
  61. package/dist/write-coordination.d.ts +27 -0
  62. package/dist/write-coordination.d.ts.map +1 -0
  63. package/dist/write-coordination.js +223 -0
  64. package/package.json +3 -1
  65. package/planner-skill.md +226 -0
  66. package/skills/grill-me/SKILL.md +10 -0
@@ -1 +1 @@
1
- {"version":3,"file":"planner-rules.d.ts","sourceRoot":"","sources":["../src/planner-rules.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,uBAAuB,EAAE,MAAM,EA2B3C,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAUD;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAW/E"}
1
+ {"version":3,"file":"planner-rules.d.ts","sourceRoot":"","sources":["../src/planner-rules.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,uBAAuB,EAAE,MAAM,EA6B3C,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAWD;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAW/E"}
@@ -10,10 +10,12 @@ import { join } from "node:path";
10
10
  * AGENTS.md governs ONLY the development of the agent-plan extension and must
11
11
  * not duplicate these rules.
12
12
  */
13
- const DETAIL_WRITING_RULE = "Write relevant points (decisions, constraints, current state, file:line refs, edge cases) into the task/phase/feature description or notes as soon as they emerge. For starting, resuming, or switching, call the lifecycle tool first so valid session attestations can be reused. If it denies the operation, perform only the missing or stale full reads listed in nextActions, in that exact order, then retry; read linked requirements explicitly only when requested. Cite entities with composite IDs, not bare UUIDs.";
14
- const EXPECTED_OPERATIONAL_RULE = "When you begin work, task_start and task_switch enforce session-scoped context reads and return precise missing/stale read actions when needed. Read any relevant phase handoff as additional context, then update the planner before and after significant changes. If you change an architectural decision, document it explicitly.";
13
+ const DETAIL_WRITING_RULE = "Write relevant points (decisions, constraints, current state, file:line refs, edge cases) into the task/phase/feature description or notes as soon as they emerge. For starting, resuming, or switching, call the lifecycle tool first so valid session attestations can be reused. If it denies the operation, perform only the missing or stale full reads listed in nextActions, in any order within the current session, then retry; read linked requirements explicitly only when requested. Cite entities with composite IDs, not bare UUIDs.";
14
+ const EXPECTED_OPERATIONAL_RULE = "When you begin work, task_start and task_switch enforce session-scoped context reads plus a Project Guidelines read when that project section exists and is missing or stale for the current session. Read any relevant phase handoff as additional context, then update the planner before and after significant changes. If you change an architectural decision, document it explicitly.";
15
15
  const LEGACY_DETAIL_WRITING_RULE = "Write relevant points (decisions, constraints, current state, file:line refs, edge cases) into the task/phase/feature description or notes as soon as they emerge. Before starting, resuming, or switching to a task, read task_get(full=true), then its parent phase_get(full=true), then its parent feature_get(full=true), in that exact order; read linked requirements explicitly when present. Cite entities with composite IDs, not bare UUIDs.";
16
16
  const LEGACY_EXPECTED_OPERATIONAL_RULE = "When you begin work, task_start and task_switch enforce the required ordered full reads. Read any relevant phase handoff as additional context, then update the planner before and after significant changes. If you change an architectural decision, document it explicitly.";
17
+ const LEGACY_PROJECT_GUIDELINES_RULE = "When a project defines the canonical Project Guidelines section, read it on planner load and before starting or switching task work whenever the current-session attestation is missing or stale. Keep coding standards, formatting, styling, and other project-specific rules from that section in working memory while executing the task.";
18
+ const PROJECT_GUIDELINES_RULE = "When a project defines the canonical Project Guidelines section, read it on planner load and before starting or switching task work whenever the current-session attestation is missing or stale. Keep coding standards, formatting, styling, verification process, best practices, and other project-specific rules only in Project Guidelines. Requirements are separate declarative user, business, or system outcomes with no lifecycle status; never store guidelines or agent behavior in Requirements. Nested Requirement macro-tasks retain implementation status.";
17
19
  export const PLANNER_EXTENSION_RULES = [
18
20
  // §1 — source of truth
19
21
  "Keep the planner as the single operational source of truth while working: read the relevant planner state before starting; update it when an activity starts, changes state, blocks, or concludes; and record next steps, blockers, and decisions in the relevant planner entities. Never leave work only in the conversation.",
@@ -21,6 +23,8 @@ export const PLANNER_EXTENSION_RULES = [
21
23
  "Respect the task lifecycle strictly. Always call task_start before touching code, and task_complete with durable evidence of shipped work, verification (including partial verification), remaining/unverified work, files, and decisions when a deliverable is done. Never enter in-progress or done through task_update. Sync state changes (start/complete/block) to the planner at the exact moment they happen — never batch updates at session end. If task_start is denied, the task remains planned: satisfy the stated read prerequisites and retry, and never claim work started without an explicit successful start result. A task marked in-progress means you are actually working on it; if you stop, close or block it with a motivation in statusLog. Derived feature/phase status is computed from tasks, not stored in JSON.",
22
24
  // §3 — markdown not source of truth
23
25
  "Do not treat markdown as the source of truth for the plan. The plan's primary source is structured data in .planner/; markdown is a generated, human/agent-readable view.",
26
+ // §4 — project guidelines
27
+ PROJECT_GUIDELINES_RULE,
24
28
  // §5 — plan location
25
29
  "The plan lives in .planner/ within the target project. Whether .planner/ is git-tracked is at the project's discretion.",
26
30
  // §6 — discuss per phase
@@ -32,7 +36,7 @@ export const PLANNER_EXTENSION_RULES = [
32
36
  // §10 — references
33
37
  "Reference entities with human, unique, composite IDs — Feature 'F001 - Name', Phase 'P001(F001) - Title', Task 'T003 - Number'. Short forms P003/T007 and the 5-char global shortId (e.g. UUXD1) are also valid. Never reference raw UUIDs. To locate an entity, use the compact list tools (feature_list/phase_list/task_list), not by reading .planner/*.json files.",
34
38
  // §12 — handoff
35
- "Handoff is per-phase (phase.handoff), not a file. Write it only on explicit user request and only after the exact feature+phase target is confirmed. Run handoff_prepare for that phase, reconcile all still-relevant existing content into one active handoff, and synchronize durable task/phase/feature context in the same handoff_write operation. A pending handoff never blocks task_start and is archived only when the phase completes or the user explicitly clears it; refreshing it must not create superseded copies.",
39
+ "Handoff is per-phase (phase.handoff), not a file. Write it only on explicit user request and only after the exact feature+phase target is confirmed. Run handoff_prepare before drafting, use its exact scaffold, review conversation/approvals, planner and sibling context, diff/implementation, verification/runtime evidence, and peer-agent/network messages, then inventory concrete files, symbols, ownership/completion state, work not started, runtime wiring, preservation constraints, proof observations, related planned work, operator actions, and ordered resume steps. Every inventory item must appear in the handoff or a validated supporting document. Reconcile all still-relevant existing content and synchronize durable task/phase/feature context in the same handoff_write operation. A pending handoff never blocks task_start; every canonical terminal phase outcome archives it automatically, explicit clear also archives it, and refresh must not create superseded copies.",
36
40
  // §12 — operational hygiene
37
41
  "Operational hygiene: start the task (task_start) before thinking about implementation; complete it (task_complete) as part of delivering the deliverable, not after; motivate every block so a third party can understand the impediment.",
38
42
  // Planner startup
@@ -48,6 +52,8 @@ function normalizeLegacyRules(rules) {
48
52
  return DETAIL_WRITING_RULE;
49
53
  if (rule === LEGACY_EXPECTED_OPERATIONAL_RULE)
50
54
  return EXPECTED_OPERATIONAL_RULE;
55
+ if (rule === LEGACY_PROJECT_GUIDELINES_RULE)
56
+ return PROJECT_GUIDELINES_RULE;
51
57
  return rule;
52
58
  });
53
59
  }
@@ -0,0 +1,24 @@
1
+ export type PlannerSkillSyncStatus = "created" | "current" | "updated" | "customized";
2
+ export interface PlannerSkillSyncResult {
3
+ path: string;
4
+ status: PlannerSkillSyncStatus;
5
+ content: string;
6
+ canonicalHash: string;
7
+ customized: boolean;
8
+ message: string;
9
+ }
10
+ export declare function plannerSkillHash(content: string): string;
11
+ export declare function renderManagedPlannerSkill(content: string): string;
12
+ export declare function managedPlannerSkillBody(content: string): string;
13
+ export declare function loadCanonicalPlannerSkill(): Promise<string>;
14
+ export declare function loadCanonicalGrillMeSkill(): Promise<string>;
15
+ /** Create or safely refresh `.planner/SKILL.md`. */
16
+ export declare function syncProjectPlannerSkill(plannerRoot: string): Promise<PlannerSkillSyncResult>;
17
+ /** Create or safely refresh `.planner/skills/grill-me/SKILL.md`. */
18
+ export declare function syncProjectGrillMeSkill(plannerRoot: string): Promise<PlannerSkillSyncResult>;
19
+ /**
20
+ * Load the project-local Ideas discussion skill, safely creating/upgrading the
21
+ * managed copy first. Customized project copies are returned unchanged.
22
+ */
23
+ export declare function loadProjectGrillMeSkill(plannerRoot: string): Promise<string>;
24
+ //# sourceMappingURL=planner-skill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-skill.d.ts","sourceRoot":"","sources":["../src/planner-skill.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC;AAEtF,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,sBAAsB,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAcD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,MAAM,CAAC,CAEjE;AAED,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,MAAM,CAAC,CAEjE;AAyED,oDAAoD;AACpD,wBAAsB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAYlG;AAED,oEAAoE;AACpE,wBAAsB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAYlG;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAElF"}
@@ -0,0 +1,113 @@
1
+ import { createHash } from "node:crypto";
2
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
3
+ import { dirname, join } from "node:path";
4
+ const MANAGED_SKILL_HEADER = /^<!-- agent-plan-managed-skill sha256:([a-f0-9]{64}) -->\n/;
5
+ const CANONICAL_SKILL_URL = new URL("../planner-skill.md", import.meta.url);
6
+ const CANONICAL_GRILL_ME_SKILL_URL = new URL("../skills/grill-me/SKILL.md", import.meta.url);
7
+ function normalizeSkillContent(content) {
8
+ return `${content.replace(/\r\n/g, "\n").trimEnd()}\n`;
9
+ }
10
+ export function plannerSkillHash(content) {
11
+ return createHash("sha256").update(normalizeSkillContent(content), "utf8").digest("hex");
12
+ }
13
+ export function renderManagedPlannerSkill(content) {
14
+ const normalized = normalizeSkillContent(content);
15
+ return `<!-- agent-plan-managed-skill sha256:${plannerSkillHash(normalized)} -->\n${normalized}`;
16
+ }
17
+ export function managedPlannerSkillBody(content) {
18
+ return normalizeSkillContent(content.replace(MANAGED_SKILL_HEADER, ""));
19
+ }
20
+ export async function loadCanonicalPlannerSkill() {
21
+ return normalizeSkillContent(await readFile(CANONICAL_SKILL_URL, "utf8"));
22
+ }
23
+ export async function loadCanonicalGrillMeSkill() {
24
+ return normalizeSkillContent(await readFile(CANONICAL_GRILL_ME_SKILL_URL, "utf8"));
25
+ }
26
+ async function syncManagedProjectSkill(path, canonical, messages) {
27
+ const canonicalHash = plannerSkillHash(canonical);
28
+ const managedCanonical = renderManagedPlannerSkill(canonical);
29
+ const existing = await readFile(path, "utf8").catch(() => null);
30
+ if (existing == null) {
31
+ await mkdir(dirname(path), { recursive: true });
32
+ await writeFile(path, managedCanonical, "utf8");
33
+ return {
34
+ path,
35
+ status: "created",
36
+ content: canonical,
37
+ canonicalHash,
38
+ customized: false,
39
+ message: messages.created,
40
+ };
41
+ }
42
+ if (normalizeSkillContent(existing) === normalizeSkillContent(managedCanonical)) {
43
+ return {
44
+ path,
45
+ status: "current",
46
+ content: canonical,
47
+ canonicalHash,
48
+ customized: false,
49
+ message: messages.current,
50
+ };
51
+ }
52
+ // Adopt an exact unmarked canonical copy. This supports projects that copied
53
+ // a canonical skill before managed headers were introduced.
54
+ if (!MANAGED_SKILL_HEADER.test(existing) && normalizeSkillContent(existing) === canonical) {
55
+ await writeFile(path, managedCanonical, "utf8");
56
+ return {
57
+ path,
58
+ status: "updated",
59
+ content: canonical,
60
+ canonicalHash,
61
+ customized: false,
62
+ message: messages.adopted,
63
+ };
64
+ }
65
+ const marker = existing.match(MANAGED_SKILL_HEADER);
66
+ const existingBody = managedPlannerSkillBody(existing);
67
+ if (marker && plannerSkillHash(existingBody) === marker[1]) {
68
+ await writeFile(path, managedCanonical, "utf8");
69
+ return {
70
+ path,
71
+ status: "updated",
72
+ content: canonical,
73
+ canonicalHash,
74
+ customized: false,
75
+ message: messages.updated,
76
+ };
77
+ }
78
+ return {
79
+ path,
80
+ status: "customized",
81
+ content: existingBody,
82
+ canonicalHash,
83
+ customized: true,
84
+ message: messages.customized,
85
+ };
86
+ }
87
+ /** Create or safely refresh `.planner/SKILL.md`. */
88
+ export async function syncProjectPlannerSkill(plannerRoot) {
89
+ return syncManagedProjectSkill(join(plannerRoot, "SKILL.md"), await loadCanonicalPlannerSkill(), {
90
+ created: "Created the canonical project-local planner skill.",
91
+ current: "The project-local planner skill matches the canonical version.",
92
+ adopted: "Adopted and marked the unmodified canonical planner skill.",
93
+ updated: "Updated the unmodified project-local planner skill to the current canonical version.",
94
+ customized: "Preserved the customized .planner/SKILL.md. Reconcile it manually with the current canonical Agent Plan guide; Agent Plan did not overwrite project instructions.",
95
+ });
96
+ }
97
+ /** Create or safely refresh `.planner/skills/grill-me/SKILL.md`. */
98
+ export async function syncProjectGrillMeSkill(plannerRoot) {
99
+ return syncManagedProjectSkill(join(plannerRoot, "skills", "grill-me", "SKILL.md"), await loadCanonicalGrillMeSkill(), {
100
+ created: "Created the canonical project-local grill-me skill for Ideas discussions.",
101
+ current: "The project-local grill-me skill matches the canonical version.",
102
+ adopted: "Adopted and marked the unmodified canonical grill-me skill.",
103
+ updated: "Updated the unmodified project-local grill-me skill to the current canonical version.",
104
+ customized: "Preserved the customized .planner/skills/grill-me/SKILL.md. Reconcile it manually with the current canonical Agent Plan skill; Agent Plan did not overwrite project instructions.",
105
+ });
106
+ }
107
+ /**
108
+ * Load the project-local Ideas discussion skill, safely creating/upgrading the
109
+ * managed copy first. Customized project copies are returned unchanged.
110
+ */
111
+ export async function loadProjectGrillMeSkill(plannerRoot) {
112
+ return (await syncProjectGrillMeSkill(plannerRoot)).content;
113
+ }
@@ -0,0 +1,47 @@
1
+ import type { AcceptedDecision, Project } from "./schema.js";
2
+ export declare const LEGACY_PROJECT_CONTEXT_MIGRATION_VERSION = 1;
3
+ export type LegacyGuidelineSource = "global-rules" | "before-phase-start" | "before-task-start" | "after-phase-complete";
4
+ export interface LegacyGuidelineAddition {
5
+ source: LegacyGuidelineSource;
6
+ text: string;
7
+ }
8
+ export type LegacyDecisionAddition = Omit<AcceptedDecision, "acceptedAt">;
9
+ export interface LegacyProjectContextMigrationPreview {
10
+ version: number;
11
+ hasLegacyContext: boolean;
12
+ guidelinesChanged: boolean;
13
+ acceptedDecisionsChanged: boolean;
14
+ guidelineAdditions: LegacyGuidelineAddition[];
15
+ acceptedDecisionAdditions: LegacyDecisionAddition[];
16
+ skippedGuidelineDuplicates: number;
17
+ skippedDecisionDuplicates: number;
18
+ resultingGuidelinesContent: string;
19
+ legacyCounts: {
20
+ globalRules: number;
21
+ workflowRules: number;
22
+ decisions: number;
23
+ };
24
+ fieldsClearedOnApply: Array<"globalRules" | "workflowRules" | "decisions">;
25
+ }
26
+ export interface LegacyProjectContextMigrationResult {
27
+ applied: boolean;
28
+ preview: LegacyProjectContextMigrationPreview;
29
+ project: Project;
30
+ }
31
+ export interface PlannerSessionPreparationResult {
32
+ changed: boolean;
33
+ project: Project;
34
+ legacyProjectContext: {
35
+ migrated: boolean;
36
+ version: number;
37
+ guidelinesAdded: number;
38
+ acceptedDecisionsAdded: number;
39
+ duplicatesSkipped: number;
40
+ clearedFields: Array<"globalRules" | "workflowRules" | "decisions">;
41
+ summary: string;
42
+ };
43
+ }
44
+ export declare function plannerSessionPreparationResult(result: LegacyProjectContextMigrationResult): PlannerSessionPreparationResult;
45
+ export declare function previewLegacyProjectContextMigration(project: Project): LegacyProjectContextMigrationPreview;
46
+ export declare function applyLegacyProjectContextMigration(project: Project, acceptedAt: string): LegacyProjectContextMigrationResult;
47
+ //# sourceMappingURL=project-context-migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-context-migration.d.ts","sourceRoot":"","sources":["../src/project-context-migration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAiB,MAAM,aAAa,CAAC;AAE5E,eAAO,MAAM,wCAAwC,IAAI,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAC7B,cAAc,GACd,oBAAoB,GACpB,mBAAmB,GACnB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAE1E,MAAM,WAAW,oCAAoC;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,g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 +1,168 @@
1
+ import { createHash } from "node:crypto";
2
+ export const LEGACY_PROJECT_CONTEXT_MIGRATION_VERSION = 1;
3
+ export function plannerSessionPreparationResult(result) {
4
+ const guidelinesAdded = result.preview.guidelineAdditions.length;
5
+ const acceptedDecisionsAdded = result.preview.acceptedDecisionAdditions.length;
6
+ const duplicatesSkipped = result.preview.skippedGuidelineDuplicates + result.preview.skippedDecisionDuplicates;
7
+ const summary = result.applied
8
+ ? `Migrated legacy project context: ${guidelinesAdded} guideline${guidelinesAdded === 1 ? "" : "s"}, ${acceptedDecisionsAdded} accepted decision${acceptedDecisionsAdded === 1 ? "" : "s"}, ${duplicatesSkipped} duplicate${duplicatesSkipped === 1 ? "" : "s"} skipped.`
9
+ : "Legacy project context is already canonical; no migration was needed.";
10
+ return {
11
+ changed: result.applied,
12
+ project: result.project,
13
+ legacyProjectContext: {
14
+ migrated: result.applied,
15
+ version: result.preview.version,
16
+ guidelinesAdded,
17
+ acceptedDecisionsAdded,
18
+ duplicatesSkipped,
19
+ clearedFields: result.preview.fieldsClearedOnApply,
20
+ summary,
21
+ },
22
+ };
23
+ }
24
+ const SOURCE_LABELS = {
25
+ "global-rules": "Global rules",
26
+ "before-phase-start": "Before phase start",
27
+ "before-task-start": "Before task start",
28
+ "after-phase-complete": "After phase complete",
29
+ };
30
+ function normalizeComparable(value) {
31
+ return value
32
+ .trim()
33
+ .replace(/^[\s#>*+-]+/, "")
34
+ .replace(/\s+/g, " ")
35
+ .toLocaleLowerCase("en-US");
36
+ }
37
+ function guidelineKeys(content) {
38
+ return new Set(content
39
+ .split(/\r?\n/)
40
+ .map(normalizeComparable)
41
+ .filter(Boolean));
42
+ }
43
+ function workflowEntries(workflowRules) {
44
+ return [
45
+ ...workflowRules.beforePhaseStart.map((text) => ({ source: "before-phase-start", text })),
46
+ ...workflowRules.beforeTaskStart.map((text) => ({ source: "before-task-start", text })),
47
+ ...workflowRules.afterPhaseComplete.map((text) => ({ source: "after-phase-complete", text })),
48
+ ];
49
+ }
50
+ function renderGuidelineAdditions(existing, additions) {
51
+ if (additions.length === 0)
52
+ return existing.trim();
53
+ const lines = ["## Migrated legacy project rules", ""];
54
+ for (const source of Object.keys(SOURCE_LABELS)) {
55
+ const entries = additions.filter((entry) => entry.source === source);
56
+ if (entries.length === 0)
57
+ continue;
58
+ lines.push(`### ${SOURCE_LABELS[source]}`, ...entries.map((entry) => `- ${entry.text}`), "");
59
+ }
60
+ const rendered = lines.join("\n").trim();
61
+ return existing.trim() ? `${existing.trim()}\n\n${rendered}` : rendered;
62
+ }
63
+ function decisionKey(value) {
64
+ if (typeof value === "string")
65
+ return normalizeComparable(value);
66
+ return normalizeComparable(value.decision || value.title);
67
+ }
68
+ function legacyDecisionId(decision) {
69
+ return `legacy-project-decision-${createHash("sha256").update(decisionKey(decision), "utf8").digest("hex").slice(0, 16)}`;
70
+ }
71
+ function legacyDecisionTitle(decision) {
72
+ const firstLine = decision.trim().split(/\r?\n/, 1)[0] ?? decision.trim();
73
+ return firstLine.length <= 100 ? firstLine : `${firstLine.slice(0, 97).trimEnd()}...`;
74
+ }
75
+ export function previewLegacyProjectContextMigration(project) {
76
+ const legacyGuidelines = [
77
+ ...project.globalRules.map((text) => ({ source: "global-rules", text })),
78
+ ...workflowEntries(project.workflowRules),
79
+ ];
80
+ const existingGuidelines = guidelineKeys(project.projectGuidelines.content);
81
+ const seenGuidelines = new Set(existingGuidelines);
82
+ const guidelineAdditions = [];
83
+ let skippedGuidelineDuplicates = 0;
84
+ for (const entry of legacyGuidelines) {
85
+ const text = entry.text.trim();
86
+ const key = normalizeComparable(text);
87
+ if (!key || seenGuidelines.has(key)) {
88
+ skippedGuidelineDuplicates += 1;
89
+ continue;
90
+ }
91
+ seenGuidelines.add(key);
92
+ guidelineAdditions.push({ ...entry, text });
93
+ }
94
+ const seenDecisions = new Set(project.acceptedDecisions.map(decisionKey));
95
+ const acceptedDecisionAdditions = [];
96
+ let skippedDecisionDuplicates = 0;
97
+ for (const legacyDecision of project.decisions) {
98
+ const decision = legacyDecision.trim();
99
+ const key = decisionKey(decision);
100
+ if (!key || seenDecisions.has(key)) {
101
+ skippedDecisionDuplicates += 1;
102
+ continue;
103
+ }
104
+ seenDecisions.add(key);
105
+ acceptedDecisionAdditions.push({
106
+ id: legacyDecisionId(decision),
107
+ title: legacyDecisionTitle(decision),
108
+ decision,
109
+ rationale: "Migrated from the legacy project decisions collection.",
110
+ implementationNotes: "Review and enrich this structured decision when additional rationale or implementation detail is available.",
111
+ });
112
+ }
113
+ const workflowRuleCount = project.workflowRules.beforePhaseStart.length
114
+ + project.workflowRules.beforeTaskStart.length
115
+ + project.workflowRules.afterPhaseComplete.length;
116
+ const fieldsClearedOnApply = [];
117
+ if (project.globalRules.length > 0)
118
+ fieldsClearedOnApply.push("globalRules");
119
+ if (workflowRuleCount > 0)
120
+ fieldsClearedOnApply.push("workflowRules");
121
+ if (project.decisions.length > 0)
122
+ fieldsClearedOnApply.push("decisions");
123
+ return {
124
+ version: LEGACY_PROJECT_CONTEXT_MIGRATION_VERSION,
125
+ hasLegacyContext: fieldsClearedOnApply.length > 0,
126
+ guidelinesChanged: guidelineAdditions.length > 0,
127
+ acceptedDecisionsChanged: acceptedDecisionAdditions.length > 0,
128
+ guidelineAdditions,
129
+ acceptedDecisionAdditions,
130
+ skippedGuidelineDuplicates,
131
+ skippedDecisionDuplicates,
132
+ resultingGuidelinesContent: renderGuidelineAdditions(project.projectGuidelines.content, guidelineAdditions),
133
+ legacyCounts: {
134
+ globalRules: project.globalRules.length,
135
+ workflowRules: workflowRuleCount,
136
+ decisions: project.decisions.length,
137
+ },
138
+ fieldsClearedOnApply,
139
+ };
140
+ }
141
+ export function applyLegacyProjectContextMigration(project, acceptedAt) {
142
+ const preview = previewLegacyProjectContextMigration(project);
143
+ if (!preview.hasLegacyContext)
144
+ return { applied: false, preview, project };
145
+ const acceptedDecisions = [
146
+ ...project.acceptedDecisions,
147
+ ...preview.acceptedDecisionAdditions.map((decision) => ({ ...decision, acceptedAt })),
148
+ ];
149
+ return {
150
+ applied: true,
151
+ preview,
152
+ project: {
153
+ ...project,
154
+ projectGuidelines: {
155
+ ...project.projectGuidelines,
156
+ content: preview.resultingGuidelinesContent,
157
+ },
158
+ globalRules: [],
159
+ workflowRules: {
160
+ beforePhaseStart: [],
161
+ beforeTaskStart: [],
162
+ afterPhaseComplete: [],
163
+ },
164
+ decisions: [],
165
+ acceptedDecisions,
166
+ },
167
+ };
168
+ }
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Session-scoped, ordered context-read enforcement for agent lifecycle operations.
2
+ * Session-scoped context-read enforcement for agent lifecycle operations.
3
3
  *
4
- * The first complete read for a task must be task(full) → phase(full) →
5
- * feature(full), with linked requirements read independently. A persisted
6
- * sessionInfo attestation may satisfy later checks in the same session while
7
- * the entity's context revision remains at or before its attestation timestamp.
4
+ * Task/phase/feature reads and linked requirements remain explicit, but fresh
5
+ * in-session reads may be performed in any order. Persisted sessionInfo
6
+ * attestations may satisfy later checks while the entity's current revision
7
+ * remains at or before the attested timestamp.
8
8
  */
9
9
  type SessionInfoEntry = {
10
10
  sessionId: string;
@@ -15,11 +15,30 @@ type ReadTrackedEntity = {
15
15
  descriptionUpdatedAt?: string;
16
16
  sessionInfo?: SessionInfoEntry[];
17
17
  };
18
- export type ContextReadEntityKind = "task" | "phase" | "feature";
18
+ type ProjectGuidelinesTrackedProject = {
19
+ projectGuidelines?: {
20
+ content?: string;
21
+ updatedAt?: string;
22
+ sessionInfo?: SessionInfoEntry[];
23
+ };
24
+ };
25
+ export type ContextReadEntityKind = "task" | "phase" | "feature" | "requirement";
26
+ export type CanonicalFullReadEntityKind = "task" | "phase" | "feature";
27
+ type CanonicalReadEntity = ReadTrackedEntity & {
28
+ id: string;
29
+ acceptedDecisions?: Array<{
30
+ id: string;
31
+ title: string;
32
+ decision: string;
33
+ rationale: string;
34
+ implementationNotes: string;
35
+ acceptedAt: string;
36
+ }>;
37
+ };
19
38
  export type RequiredContextRead = {
20
39
  kind: ContextReadEntityKind;
21
40
  id: string;
22
- state: "missing" | "stale" | "out-of-order";
41
+ state: "missing" | "stale";
23
42
  };
24
43
  export type ContextReadEligibility = {
25
44
  eligible: boolean;
@@ -43,6 +62,12 @@ export interface SessionContextReadInput {
43
62
  export declare function markFeatureRead(featureId: string): void;
44
63
  /** Record a full feature read for an explicit harness session. */
45
64
  export declare function markFeatureReadForSessionId(sessionId: string, featureId: string): void;
65
+ /**
66
+ * Record a canonical feature/phase/task full read only after its visible tool
67
+ * content contains every field of every Accepted Decision. This prevents an
68
+ * adapter from certifying a title-only or otherwise incomplete decision read.
69
+ */
70
+ export declare function markCanonicalFullReadForSessionId(sessionId: string, kind: CanonicalFullReadEntityKind, entity: CanonicalReadEntity, deliveredContent: string): void;
46
71
  /** Record a full phase read in the default compatibility session. */
47
72
  export declare function markPhaseRead(phaseId: string, _featureId?: string): void;
48
73
  /** Record a full phase read for an explicit harness session. */
@@ -56,12 +81,15 @@ export declare function markRequirementRead(requirementId: string): void;
56
81
  /** Record that a requirement was explicitly read for an explicit session. */
57
82
  export declare function markRequirementReadForSessionId(sessionId: string, requirementId: string): void;
58
83
  /**
59
- * Combine valid persisted attestations with fresh in-memory reads. The initial
60
- * uncached lineage still requires task phase feature ordering, while a
61
- * stale or missing individual entity can be reread without discarding valid
62
- * parent attestations from the same harness session.
84
+ * Combine valid persisted attestations with fresh in-memory reads. An entity read
85
+ * in the current session satisfies eligibility regardless of sequence order,
86
+ * so agents can read task, phase, and feature in any order; only persisted
87
+ * attestations are checked for revision freshness (stale) and missing entities
88
+ * remain reported as missing.
63
89
  */
64
90
  export declare function contextReadEligibilityForSession(input: SessionContextReadInput): ContextReadEligibility;
91
+ export type ProjectGuidelinesReadState = "not-required" | "missing" | "stale" | "valid";
92
+ export declare function projectGuidelinesReadStateForSession(project: ProjectGuidelinesTrackedProject, sessionId: string): ProjectGuidelinesReadState;
65
93
  /** Return true only when the persisted attestation covers the current revisions. */
66
94
  export declare function hasValidSessionAttestation(input: SessionContextReadInput): boolean;
67
95
  /** Compatibility check for the default session and in-memory reads only. */
@@ -69,9 +97,15 @@ export declare function contextReadEligibility(taskId: string, phaseId: string,
69
97
  /** Legacy parent-read check retained for callers that only need independent parent state. */
70
98
  export declare function hasReadParents(featureId: string | undefined, phaseId: string): boolean;
71
99
  /**
72
- * Whether linked requirements are read in memory or have valid persisted
73
- * attestations for the current session and entity revisions.
100
+ * Report the exact linked requirements whose delivered read evidence is missing
101
+ * or stale for this session. A broad requirement inventory must not call the
102
+ * mark function; only a target-scoped response that actually includes the
103
+ * linked requirement records may create fresh in-memory evidence.
74
104
  */
105
+ export declare function requirementReadEligibilityForSession(sessionId: string, requirementIds: string[], requirements?: Array<ReadTrackedEntity & {
106
+ id: string;
107
+ }>): ContextReadEligibility;
108
+ /** Whether every linked requirement has fresh delivered read evidence. */
75
109
  export declare function hasReadRequirementsForSession(sessionId: string, requirementIds: string[], requirements?: Array<ReadTrackedEntity & {
76
110
  id: string;
77
111
  }>): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"read-tracking.d.ts","sourceRoot":"","sources":["../src/read-tracking.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,KAAK,gBAAgB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAClC,CAAC;AAUF,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEjE,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,sB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