@c4a/context-cli 0.7.35 → 0.7.36

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 (28) hide show
  1. package/cli.js +40 -7
  2. package/indexers/contracts/profile-contract.json +245 -245
  3. package/indexers/release-manifest.json +1 -1
  4. package/package.json +12 -12
  5. package/plugins/VERSION +1 -1
  6. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  7. package/plugins/claude/commands/context.md +41 -3
  8. package/plugins/claude/skills/context-plan/SKILL.md +18 -6
  9. package/plugins/claude/skills/context-plan/references/project-planning.md +74 -10
  10. package/plugins/claude/skills/context-plan/templates/PLAN.md +9 -4
  11. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  12. package/plugins/codex/skills/context/SKILL.md +41 -3
  13. package/plugins/codex/skills/context-plan/SKILL.md +18 -6
  14. package/plugins/codex/skills/context-plan/references/project-planning.md +74 -10
  15. package/plugins/codex/skills/context-plan/templates/PLAN.md +9 -4
  16. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  17. package/plugins/cursor/commands/c4a-context.md +41 -3
  18. package/plugins/cursor/skills/context-plan/SKILL.md +18 -6
  19. package/plugins/cursor/skills/context-plan/references/project-planning.md +74 -10
  20. package/plugins/cursor/skills/context-plan/templates/PLAN.md +9 -4
  21. package/plugins/skills/context/SKILL.md +41 -3
  22. package/plugins/skills/context-plan/SKILL.md +18 -6
  23. package/plugins/skills/context-plan/references/project-planning.md +74 -10
  24. package/plugins/skills/context-plan/templates/PLAN.md +9 -4
  25. package/providers/context/codes.yaml +1 -1
  26. package/providers/context/graphs/workspace.yaml +1 -1
  27. package/providers/context/manifest.json +6 -6
  28. package/providers/context/provider.yaml +1 -1
package/cli.js CHANGED
@@ -79425,6 +79425,33 @@ var init_productionStage = __esm(() => {
79425
79425
  terminal = new Set(["accepted", "excluded", "replaced"]);
79426
79426
  });
79427
79427
 
79428
+ // src/project/productionSourceSummary.ts
79429
+ function productionSourceSummary(stage) {
79430
+ const pending = new Set(stage.pending_scopes);
79431
+ const unavailable = new Set(stage.gaps.map((gap) => gap.scope));
79432
+ return {
79433
+ stage_source_count: new Set(stage.scopes.map((source2) => source2.scope)).size,
79434
+ pending_scope_count: pending.size,
79435
+ unavailable_source_count: unavailable.size,
79436
+ pending_without_read_failure_count: [...pending].filter((scope2) => !unavailable.has(scope2)).length,
79437
+ planned_article_count: new Set(stage.tasks.filter((task) => !["excluded", "replaced"].includes(task.status)).map((task) => task.path)).size,
79438
+ unavailable_sources: stage.gaps,
79439
+ meaning: "Pending scopes are remaining investigation, not missing knowledge or failed captures. Unavailable sources have current material/baseline read failures; inspect their reasons. Counts can overlap and must not be added. Restore required code dependencies even for document-led work."
79440
+ };
79441
+ }
79442
+ function productionSourceSummaryMarkdown(stage) {
79443
+ const summary = productionSourceSummary(stage);
79444
+ return [
79445
+ "## Source availability and progress",
79446
+ "",
79447
+ `Stage sources: ${summary.stage_source_count}; pending investigation scopes: ${summary.pending_scope_count}; sources with read failures: ${summary.unavailable_source_count}; pending scopes without read failures: ${summary.pending_without_read_failure_count}; planned articles: ${summary.planned_article_count}.`,
79448
+ summary.meaning,
79449
+ "",
79450
+ ...summary.unavailable_sources.map((gap) => `- ${gap.scope}: ${gap.reason}`),
79451
+ ""
79452
+ ];
79453
+ }
79454
+
79428
79455
  // src/project/productionStageStore.ts
79429
79456
  var exports_productionStageStore = {};
79430
79457
  __export(exports_productionStageStore, {
@@ -79544,8 +79571,7 @@ function productionPlanMarkdown(stage) {
79544
79571
  "Then present the updated report and apply context.gate.work_start_scope; an old decision does not approve changed article goals.",
79545
79572
  ""
79546
79573
  ] : [],
79547
- ...stage.gaps.map((gap) => `- ${gap.scope}: ${gap.reason}`),
79548
- ""
79574
+ ...productionSourceSummaryMarkdown(stage)
79549
79575
  ].join(`
79550
79576
  `);
79551
79577
  }
@@ -81069,8 +81095,9 @@ async function resolveProductionExclusions(requirements, readBaseline) {
81069
81095
  import { randomUUID as randomUUID3 } from "node:crypto";
81070
81096
  import { readFile as readFile34, access as access3 } from "node:fs/promises";
81071
81097
  import { join as join39 } from "node:path";
81072
- function refreshRequired(stage, message) {
81098
+ function refreshRequired(stage, message, detail = {}) {
81073
81099
  return new ContextError(ExitCode.UserError, message, {
81100
+ ...detail,
81074
81101
  category: ErrorCategory.UserInputInvalid,
81075
81102
  reason_code: "production-planning-refresh-required",
81076
81103
  next_action: { command: `context action prepare-current --revision ${stage} --format json` }
@@ -81169,6 +81196,7 @@ Restore the authorized source and retry preparation.
81169
81196
  `Existing reader topics: ${join39(directory, "guidance/existing-articles.md")}`,
81170
81197
  `Stage: ${stage.id}`,
81171
81198
  "",
81199
+ ...productionSourceSummaryMarkdown(stage),
81172
81200
  ...scopes.map((scope2) => `- ${scope2.scope}: ${join39(directory, productionSourceFile(scope2.scope))}`),
81173
81201
  "",
81174
81202
  "Use code skeletons and document outlines to identify the authorized capability families and document tasks, then selectively read full material to decide reader topics. Navigation is not a complete feature inventory. Keep unchecked scope pending; do not parse all code or maintain per-symbol disposition just to plan.",
@@ -81192,7 +81220,7 @@ Restore the authorized source and retry preparation.
81192
81220
  capabilities: productionCapabilitiesSchema.parse({}),
81193
81221
  materials: { ...prepared.materials, sources: sourceMaterials, guidance }
81194
81222
  });
81195
- return { stage_state: "active", next: { directory, mode: "single-agent" } };
81223
+ return { stage_state: "active", source_summary: productionSourceSummary(stage), next: { directory, mode: "single-agent" } };
81196
81224
  });
81197
81225
  }
81198
81226
  async function submitProductionPlan(input) {
@@ -81220,9 +81248,12 @@ async function submitProductionPlan(input) {
81220
81248
  throw new TypeError("Pending investigation must name unique authorized stage scopes");
81221
81249
  }
81222
81250
  if (stage.gaps.some((gap) => !pendingScopes.includes(gap.scope)))
81223
- throw refreshRequired(stage.id, "Keep unresolved material gaps in pending_scopes; restore the source if unavailable, then prepare the current stage to refresh its material snapshot");
81251
+ throw refreshRequired(stage.id, "Keep unresolved material gaps in pending_scopes. These are current material/baseline read failures, not evidence that knowledge was never captured. Restore required dependencies before preparing their snapshots; do not label every pending source as unavailable.", {
81252
+ source_summary: productionSourceSummary(stage),
81253
+ missing_pending_scopes: [...new Set(stage.gaps.filter((gap) => !pendingScopes.includes(gap.scope)).map((gap) => gap.scope))]
81254
+ });
81224
81255
  if (plan.articles.some((article) => article.sources.some((scope2) => stage.gaps.some((gap) => gap.scope === scope2)))) {
81225
- throw refreshRequired(stage.id, "An article requires unavailable material in the captured stage. Restore the source if needed, then prepare the current stage; independent source plans may proceed");
81256
+ throw refreshRequired(stage.id, "An article requires unavailable material in the captured stage. Restore the required source, including code dependencies of document-led work, then prepare the current stage; independent source plans may proceed.", { source_summary: productionSourceSummary(stage) });
81226
81257
  }
81227
81258
  for (const source2 of stage.scopes)
81228
81259
  if (!stage.gaps.some((gap) => gap.scope === source2.scope) && await productionSourceBaseline(input.projectRoot, source2.scope) !== source2.baseline) {
@@ -102470,6 +102501,7 @@ async function projectStatusSummary(status, projectRoot) {
102470
102501
  packages: status.packages.map((item) => ({ name: item.name, state: item.state })),
102471
102502
  meaning: status.evidenceStatus === "not-checked" ? "Progress only: workspace verification and delivery freshness were not checked. Delivery actions validate their inputs; context verify performs an explicit audit." : "Approved pages may not yet be built. Package freshness describes dist; task completion describes the current stage only."
102472
102503
  },
102504
+ counts_scope: "Workspace inventory, not this request’s additions or article workload. Captured documents, approved articles, pending investigation and source-read failures are different measures; source ready counts alone do not explain failure causes.",
102473
102505
  counts: {
102474
102506
  sources: status.sourceSummary,
102475
102507
  draftCandidates: status.draftCandidates,
@@ -106412,7 +106444,8 @@ async function acknowledgeCurrentWorkflowResources(input) {
106412
106444
  resourceAcknowledgement: {
106413
106445
  protocol: "context.workflow.resource-receipts.v1",
106414
106446
  acknowledged: directResources.length,
106415
- receiptReference: `@${join92(found.projectRoot, continuation.path)}`
106447
+ receiptReference: `@${join92(found.projectRoot, continuation.path)}`,
106448
+ message: "Read the returned workflow and follow its selected command unchanged, including revision and resource-receipt arguments. Do not pre-chain an earlier write command or replace this result with status without receipts. Acknowledgement does not necessarily change the revision; reread only changed or unavailable required content."
106416
106449
  }
106417
106450
  };
106418
106451
  }