codecartographer-pi 0.17.0 → 0.18.0
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.
- package/.codecarto/GUIDE.md +3 -3
- package/.codecarto/findings/architecture/SKILL.md +1 -0
- package/.codecarto/findings/contracts/SKILL.md +1 -0
- package/.codecarto/findings/defect-scan/SKILL.md +15 -1
- package/.codecarto/findings/defect-scan/passes/01-logic-and-correctness.md +1 -1
- package/.codecarto/findings/defect-scan/passes/02-error-handling.md +1 -1
- package/.codecarto/findings/defect-scan/passes/03-concurrency-and-resources.md +1 -1
- package/.codecarto/findings/defect-scan/passes/04-security-and-trust.md +1 -1
- package/.codecarto/findings/defect-scan/passes/05-api-contract-violations.md +2 -1
- package/.codecarto/findings/defect-scan/passes/06-config-and-environment.md +1 -1
- package/.codecarto/findings/defect-scan-mechanical/SKILL.md +3 -2
- package/.codecarto/findings/defect-scan-semantic/SKILL.md +2 -0
- package/.codecarto/findings/porting/SKILL.md +2 -1
- package/.codecarto/findings/protocols/SKILL.md +1 -0
- package/.codecarto/findings/reimplementation-spec/SKILL.md +1 -1
- package/.codecarto/skills/spec-delta-application/SKILL.md +1 -1
- package/.codecarto/templates/amendment.yaml +3 -3
- package/.codecarto/templates/architecture-map.md +1 -1
- package/.codecarto/templates/defect-report.md +23 -0
- package/.codecarto/templates/mechanical-defects.md +22 -0
- package/.codecarto/templates/reverse-engineering-bundle.md +2 -2
- package/.codecarto/templates/semantic-defects.md +26 -0
- package/.codecarto/templates/spike-report.md +2 -2
- package/.codecarto/workflow/VALIDATE.md +1 -1
- package/.codecarto/workflow/pipeline-defect-scan.yaml +2 -0
- package/.codecarto/workflow/pipeline-full-with-audit.yaml +3 -1
- package/.codecarto/workflow/pipeline-full-with-deep-audit.yaml +5 -1
- package/.codecarto/workflow/pipeline-scout-first.yaml +5 -1
- package/.codecarto/workflow/scaffold-version.yaml +1 -1
- package/README.md +14 -10
- package/agent-skill/codecartographer/SKILL.md +1 -1
- package/agent-skill/codecartographer/references/deep-audit-synthesis.md +4 -1
- package/agent-skill/codecartographer/references/library.md +3 -3
- package/agent-skill/codecartographer/references/orchestration.md +1 -1
- package/agent-skill/codecartographer/references/phase-recovery.md +1 -1
- package/dist/core/amendment.d.ts +5 -0
- package/dist/core/amendment.js +23 -4
- package/dist/core/completion.d.ts +5 -0
- package/dist/core/completion.js +18 -2
- package/dist/core/dashboard.js +5 -3
- package/dist/core/findings.d.ts +59 -0
- package/dist/core/findings.js +145 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/library.d.ts +139 -1
- package/dist/core/library.js +291 -40
- package/dist/core/orchestrator-config.d.ts +6 -0
- package/dist/core/orchestrator-config.js +2 -0
- package/dist/core/pipeline.js +15 -0
- package/dist/core/prompts.js +1 -1
- package/dist/core/status.d.ts +2 -1
- package/dist/core/status.js +33 -11
- package/dist/core/types.d.ts +6 -0
- package/dist/core/utils.d.ts +14 -0
- package/dist/core/utils.js +30 -0
- package/dist/core/workspace.d.ts +16 -0
- package/dist/core/workspace.js +42 -22
- package/dist/core/yaml.js +19 -4
- package/dist/extensions/codecarto/auto-runner.d.ts +2 -0
- package/dist/extensions/codecarto/broadside-flags.d.ts +7 -2
- package/dist/extensions/codecarto/broadside-flags.js +22 -9
- package/dist/extensions/codecarto/dashboard-narrator.js +1 -1
- package/dist/extensions/codecarto/index.js +379 -20
- package/dist/extensions/codecarto/phase-compaction.js +4 -0
- package/dist/mcp-server/server.js +127 -10
- package/package.json +2 -2
|
@@ -17,7 +17,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
17
17
|
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError, } from "@modelcontextprotocol/sdk/types.js";
|
|
18
18
|
import { mkdir, readFile, readdir, rename, writeFile } from "node:fs/promises";
|
|
19
19
|
import { basename, isAbsolute, join } from "node:path";
|
|
20
|
-
import { buildPhasePrompt, buildSkillPrompt, buildValidationSummary, BROADSIDE_DIR, broadsideDirFor, BROADSIDE_LENS_IDS, BROADSIDE_SKILL_NAME, canonicalPath, copyPackagedWorkspace, collectResultText, completeValidatedPhase, computePerPhaseTotals, computeTotals, createEmptyStatus, DEFAULT_PIPELINE_PATH, deriveSlug, discoverLibrary, describeScaffoldStaleness, estimateSubmitText, getLens, getNextEligiblePhase, getPipelineLabel, getWorkspaceState, isValidSlug, isWithinPathResolved, listBatchModels, listEntries, listGuideTopics, loadBroadsideConfig, modelsText, readGuide, listSkillNames, loadCodecartoConfig, loadUsage, loadYamlFile, normalizeForComparison, PACKAGE_VERSION, packagedWorkspaceDir, pathExists, PhasePreflightError, publishEntry, reindex as libraryReindex, refreshScaffold, resolvePhase, resolvePipelineChoice, readBroadsideSkill, runBroadsideCollect, runBroadsideStatus, runBroadsideSubmit, seedOrchestratorFiles, statusText, stringifySimpleYaml, switchPipeline, validatePhaseOutput, writeLibraryConfig, } from "../core/index.js";
|
|
20
|
+
import { buildPhasePrompt, buildSkillPrompt, buildValidationSummary, BROADSIDE_DIR, broadsideDirFor, BROADSIDE_LENS_IDS, BROADSIDE_SKILL_NAME, canonicalPath, copyPackagedWorkspace, collectResultText, completeValidatedPhase, computePerPhaseTotals, computeTotals, createEmptyStatus, DEFAULT_PIPELINE_PATH, deriveSlug, discoverLibrary, describeScaffoldStaleness, detectProvenanceConflicts, estimateSubmitText, getLens, getNextEligiblePhase, getPipelineLabel, getWorkspaceState, isValidSlug, isWithinPathResolved, listBatchModels, listEntries, listGuideTopics, loadBroadsideConfig, modelsText, readGuide, listSkillNames, loadCodecartoConfig, loadUsage, loadYamlFile, normalizeForComparison, PACKAGE_VERSION, packagedWorkspaceDir, pathExists, PhasePreflightError, previewPublishVersion, publishEntry, reindex as libraryReindex, refreshScaffold, resolvePhase, resolvePipelineChoice, readBroadsideSkill, runBroadsideCollect, runBroadsideStatus, runBroadsideSubmit, seedOrchestratorFiles, statusText, stringifySimpleYaml, switchPipeline, validatePhaseOutput, writeLibraryConfig, } from "../core/index.js";
|
|
21
21
|
import { applyAmendment } from "../core/amendment.js";
|
|
22
22
|
import { appendUsageRun } from "../core/usage.js";
|
|
23
23
|
import { initLibrary } from "../core/library.js";
|
|
@@ -262,7 +262,7 @@ export async function handleComplete(args) {
|
|
|
262
262
|
if (validation.overall === "FAIL" || validation.overall === "MISSING") {
|
|
263
263
|
throw new McpError(ErrorCode.InvalidRequest, `Cannot complete ${validation.phaseId}: validation is ${validation.overall}.\n${buildValidationSummary(validation).join("\n")}`);
|
|
264
264
|
}
|
|
265
|
-
const { updatedState, closeoutNotice, orchestratorCheckpoint } = await completeValidatedPhase(cwd, validation, "codecarto_complete").catch((error) => {
|
|
265
|
+
const { updatedState, closeoutNotice, orchestratorCheckpoint, warnings } = await completeValidatedPhase(cwd, validation, "codecarto_complete").catch((error) => {
|
|
266
266
|
throw new McpError(ErrorCode.InvalidParams, error instanceof Error ? error.message : String(error));
|
|
267
267
|
});
|
|
268
268
|
// Record the run in the usage log (issue #100). MCP hosts execute phases in
|
|
@@ -303,6 +303,10 @@ export async function handleComplete(args) {
|
|
|
303
303
|
lines.push(orchestratorCheckpoint);
|
|
304
304
|
if (dashboardPath)
|
|
305
305
|
lines.push(`Dashboard refreshed: ${dashboardPath}`);
|
|
306
|
+
for (const warning of validation.warnings ?? [])
|
|
307
|
+
lines.push(`NOTE: ${warning} Non-gating.`);
|
|
308
|
+
for (const warning of warnings)
|
|
309
|
+
lines.push(`NOTE: ${warning} Non-gating.`);
|
|
306
310
|
return textResult(lines.join("\n"), {
|
|
307
311
|
completedPhase: validation.phaseId,
|
|
308
312
|
validation: validation.overall,
|
|
@@ -310,6 +314,7 @@ export async function handleComplete(args) {
|
|
|
310
314
|
closeoutNotice,
|
|
311
315
|
orchestratorCheckpoint,
|
|
312
316
|
dashboardPath,
|
|
317
|
+
warnings: [...(validation.warnings ?? []), ...warnings],
|
|
313
318
|
});
|
|
314
319
|
}
|
|
315
320
|
export async function handleSkill(args) {
|
|
@@ -365,6 +370,17 @@ async function resolveLibraryPath(args) {
|
|
|
365
370
|
}
|
|
366
371
|
throw new McpError(ErrorCode.InvalidParams, "library_path is required (pass it explicitly, or pass cwd and configure library.path in ~/.codecarto/config.yaml or .codecarto/workflow/config.yaml).");
|
|
367
372
|
}
|
|
373
|
+
/**
|
|
374
|
+
* The configuration `codecarto_config` reports for the same `cwd`: workspace
|
|
375
|
+
* over user-global when a cwd is given, user-global alone otherwise. Publish
|
|
376
|
+
* reads its gate from here so the value the config tool displays is the value
|
|
377
|
+
* the publish tool enforces.
|
|
378
|
+
*/
|
|
379
|
+
async function loadEffectiveConfig(cwd) {
|
|
380
|
+
return typeof cwd === "string" && cwd.trim() !== ""
|
|
381
|
+
? loadCodecartoConfig(join(cwd.trim(), ".codecarto"))
|
|
382
|
+
: loadUserConfig();
|
|
383
|
+
}
|
|
368
384
|
function asStringArray(value, fieldName) {
|
|
369
385
|
if (!Array.isArray(value)) {
|
|
370
386
|
throw new McpError(ErrorCode.InvalidParams, `${fieldName} must be an array of strings`);
|
|
@@ -472,6 +488,33 @@ async function resolveDefaultsFromWorkspace(cwd, overrides) {
|
|
|
472
488
|
}
|
|
473
489
|
return { pipeline, namespace };
|
|
474
490
|
}
|
|
491
|
+
// ---------- library provenance reporting ----------
|
|
492
|
+
function conflictEntryLabel(conflict) {
|
|
493
|
+
return conflict.namespace ? `${conflict.namespace}/${conflict.slug}` : conflict.slug;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* The report block appended to the list and reindex text results when an
|
|
497
|
+
* entry's versions disagree about source_repo (#148). Empty when there is
|
|
498
|
+
* nothing to report, so a healthy library's output does not change. Repair
|
|
499
|
+
* is manual by design: the framework does not rename or renumber versions,
|
|
500
|
+
* because entry paths are ABI.
|
|
501
|
+
*/
|
|
502
|
+
function provenanceConflictLines(conflicts) {
|
|
503
|
+
if (conflicts.length === 0)
|
|
504
|
+
return [];
|
|
505
|
+
const lines = [
|
|
506
|
+
"",
|
|
507
|
+
`Provenance conflicts — ${conflicts.length} ${conflicts.length === 1 ? "entry" : "entries"} whose versions disagree about source_repo:`,
|
|
508
|
+
];
|
|
509
|
+
for (const conflict of conflicts) {
|
|
510
|
+
const others = conflict.disagreeing_versions
|
|
511
|
+
.map((v) => `v${v.version} records ${v.source_repo}`)
|
|
512
|
+
.join("; ");
|
|
513
|
+
lines.push(` ${conflictEntryLabel(conflict)}: the index advertises ${conflict.source_repo} (v${conflict.latest_version}), but ${others}.`);
|
|
514
|
+
}
|
|
515
|
+
lines.push("These entries were merged by a slug collision before publish refused cross-project appends, so each version history spans more than one codebase (a repository that genuinely moved and was re-published with allow_source_repo_change leaves the same shape).", "Repair is manual: split the entry by hand — the framework does not rename or renumber versions, because entry paths are ABI.");
|
|
516
|
+
return lines;
|
|
517
|
+
}
|
|
475
518
|
// ---------- library handlers ----------
|
|
476
519
|
export async function handlePublish(args) {
|
|
477
520
|
const libraryPath = await resolveLibraryPath(args);
|
|
@@ -518,6 +561,50 @@ export async function handlePublish(args) {
|
|
|
518
561
|
const analyzedAt = typeof args.analyzed_at === "string" && args.analyzed_at !== ""
|
|
519
562
|
? args.analyzed_at
|
|
520
563
|
: new Date().toISOString();
|
|
564
|
+
const headline = args.headline.trim();
|
|
565
|
+
const forceNewVersion = args.force_new_version === true;
|
|
566
|
+
// publish_confirm gate (#162). Pi shows a preview and asks before writing.
|
|
567
|
+
// An MCP server has no one to ask, so — as codecarto_broadside does for its
|
|
568
|
+
// spend limit — it refuses with the preview and lets the caller re-invoke
|
|
569
|
+
// with confirm: true. The gate applies only when a config layer actually
|
|
570
|
+
// set the key: the loader's default (true) exists to make Pi's dialog
|
|
571
|
+
// opt-out, and a host that never configured the key keeps the behavior it
|
|
572
|
+
// had. Runs after every argument check so the preview names the resolved
|
|
573
|
+
// slug and namespace, and before publishEntry so nothing is written.
|
|
574
|
+
const config = await loadEffectiveConfig(args.cwd);
|
|
575
|
+
if (config.library.publish_confirm && config.library.publish_confirm_configured && args.confirm !== true) {
|
|
576
|
+
const preview = await previewPublishVersion(libraryPath, spec, { slug, namespace }, { forceNewVersion });
|
|
577
|
+
const label = `${namespace ? `${namespace}/` : ""}${slug}`;
|
|
578
|
+
const versionLine = preview.latestVersion === 0
|
|
579
|
+
? "v1 (first version of a new entry)"
|
|
580
|
+
: preview.isNewVersion
|
|
581
|
+
? `v${preview.version} (new content version; the newest is v${preview.latestVersion})`
|
|
582
|
+
: `v${preview.version} (metadata-only update; the content hash matches the newest version)`;
|
|
583
|
+
const specSource = typeof args.spec_path === "string" && args.spec_path.trim() !== ""
|
|
584
|
+
? args.spec_path.trim()
|
|
585
|
+
: `inline (${spec.length} characters)`;
|
|
586
|
+
throw new McpError(ErrorCode.InvalidRequest, [
|
|
587
|
+
"Publish not performed: library.publish_confirm is set and this call did not carry confirm: true. Nothing was written.",
|
|
588
|
+
`Would publish ${label} to ${libraryPath}`,
|
|
589
|
+
` Version: ${versionLine}`,
|
|
590
|
+
` Source repo: ${sourceRepo}`,
|
|
591
|
+
` Headline: ${headline}`,
|
|
592
|
+
` Confidentiality: ${confidentiality ?? "internal (the default; none declared)"}`,
|
|
593
|
+
` Spec: ${specSource}`,
|
|
594
|
+
"Re-invoke codecarto_publish with the same arguments plus confirm: true to publish, or set library.publish_confirm: false in config to drop this gate.",
|
|
595
|
+
].join("\n"), {
|
|
596
|
+
refused: "publish_confirm",
|
|
597
|
+
libraryPath,
|
|
598
|
+
namespace: namespace ?? null,
|
|
599
|
+
slug,
|
|
600
|
+
version: preview.version,
|
|
601
|
+
isNewVersion: preview.isNewVersion,
|
|
602
|
+
latestVersion: preview.latestVersion,
|
|
603
|
+
source_repo: sourceRepo,
|
|
604
|
+
headline,
|
|
605
|
+
confidentiality: confidentiality ?? null,
|
|
606
|
+
});
|
|
607
|
+
}
|
|
521
608
|
const result = await publishEntry(libraryPath, spec, {
|
|
522
609
|
slug,
|
|
523
610
|
namespace: namespace ?? undefined,
|
|
@@ -528,14 +615,15 @@ export async function handlePublish(args) {
|
|
|
528
615
|
analyzed_at: analyzedAt,
|
|
529
616
|
pipeline: defaults.pipeline,
|
|
530
617
|
codecarto_version: PACKAGE_VERSION,
|
|
531
|
-
headline
|
|
618
|
+
headline,
|
|
532
619
|
tags,
|
|
533
620
|
capabilities,
|
|
534
621
|
confidentiality,
|
|
535
622
|
generation,
|
|
536
623
|
}, {
|
|
537
|
-
forceNewVersion
|
|
624
|
+
forceNewVersion,
|
|
538
625
|
allowSourceRepoChange: args.allow_source_repo_change === true,
|
|
626
|
+
allowConfidentialityMismatch: args.allow_confidentiality_mismatch === true,
|
|
539
627
|
});
|
|
540
628
|
const lines = [
|
|
541
629
|
`Published ${result.namespace ? `${result.namespace}/` : ""}${result.slug} v${result.version} to ${libraryPath}`,
|
|
@@ -567,6 +655,10 @@ export async function handleLibraryList(args) {
|
|
|
567
655
|
if (typeof args.source_repo === "string" && args.source_repo !== "")
|
|
568
656
|
filter.source_repo = args.source_repo;
|
|
569
657
|
const entries = await listEntries(libraryPath, filter);
|
|
658
|
+
// Computed over the listed entries only, read-only: one readdir per entry
|
|
659
|
+
// plus one small metadata read per older version.
|
|
660
|
+
const conflicts = await detectProvenanceConflicts(libraryPath, entries);
|
|
661
|
+
const conflicted = new Set(conflicts.map((c) => `${c.namespace ?? ""}/${c.slug}`));
|
|
570
662
|
const summary = entries.length === 0
|
|
571
663
|
? `No entries match the filter in ${libraryPath}.`
|
|
572
664
|
: [
|
|
@@ -574,8 +666,10 @@ export async function handleLibraryList(args) {
|
|
|
574
666
|
...entries.map((e) => {
|
|
575
667
|
const ns = e.namespace ? `${e.namespace}/` : "";
|
|
576
668
|
const tags = e.tags.length > 0 ? ` [${e.tags.slice(0, 4).join(", ")}${e.tags.length > 4 ? ", ..." : ""}]` : "";
|
|
577
|
-
|
|
669
|
+
const flag = conflicted.has(`${e.namespace ?? ""}/${e.slug}`) ? " — PROVENANCE CONFLICT (see below)" : "";
|
|
670
|
+
return ` ${ns}${e.slug} v${e.latest_version} — ${e.headline}${tags}${flag}`;
|
|
578
671
|
}),
|
|
672
|
+
...provenanceConflictLines(conflicts),
|
|
579
673
|
].join("\n");
|
|
580
674
|
return textResult(summary, {
|
|
581
675
|
libraryPath,
|
|
@@ -583,6 +677,7 @@ export async function handleLibraryList(args) {
|
|
|
583
677
|
namespaced: marker.namespaced,
|
|
584
678
|
count: entries.length,
|
|
585
679
|
entries,
|
|
680
|
+
provenance_conflicts: conflicts,
|
|
586
681
|
});
|
|
587
682
|
}
|
|
588
683
|
export async function handleLibraryReindex(args) {
|
|
@@ -593,17 +688,27 @@ export async function handleLibraryReindex(args) {
|
|
|
593
688
|
}
|
|
594
689
|
const index = await libraryReindex(libraryPath);
|
|
595
690
|
const namespaces = index.namespaces.length > 0 ? index.namespaces.join(", ") : "(none)";
|
|
596
|
-
return textResult(
|
|
691
|
+
return textResult([
|
|
692
|
+
`Reindexed ${libraryPath}: ${index.entry_count} ${index.entry_count === 1 ? "entry" : "entries"} across namespaces [${namespaces}].`,
|
|
693
|
+
...provenanceConflictLines(index.provenance_conflicts),
|
|
694
|
+
].join("\n"), {
|
|
597
695
|
libraryPath,
|
|
598
696
|
libraryName: index.library_name,
|
|
599
697
|
entry_count: index.entry_count,
|
|
600
698
|
namespaces: index.namespaces,
|
|
699
|
+
provenance_conflicts: index.provenance_conflicts,
|
|
601
700
|
});
|
|
602
701
|
}
|
|
603
702
|
export async function handleLibraryInit(args) {
|
|
604
703
|
if (!args.library_path || typeof args.library_path !== "string") {
|
|
605
704
|
throw new McpError(ErrorCode.InvalidParams, "library_path is required.");
|
|
606
705
|
}
|
|
706
|
+
// Same rule as resolveLibraryPath for the other library tools: a relative
|
|
707
|
+
// path would resolve against the MCP server process's cwd and then be
|
|
708
|
+
// persisted verbatim into the user-global config (#134).
|
|
709
|
+
if (!isAbsolute(args.library_path)) {
|
|
710
|
+
throw new McpError(ErrorCode.InvalidParams, `library_path must be absolute, got: ${args.library_path}`);
|
|
711
|
+
}
|
|
607
712
|
const libraryPath = args.library_path;
|
|
608
713
|
const namespaced = !!args.namespace;
|
|
609
714
|
const result = await initLibrary(libraryPath, {
|
|
@@ -1010,7 +1115,7 @@ const TOOLS = [
|
|
|
1010
1115
|
},
|
|
1011
1116
|
{
|
|
1012
1117
|
name: "codecarto_publish",
|
|
1013
|
-
description: "Publish a reimplementation-spec to a CodeCartographer library. Identified by library_path (absolute) or cwd's config.yaml. Content-hash idempotent — re-publishing identical spec bytes updates metadata in place rather than bumping the version. Required: source_repo, headline, and either spec (inline) or spec_path (absolute file). Slug derives from source_repo if not provided. If the library is namespaced, namespace is required (or pass cwd to inherit from config). Generation context (agent, model, vendor, reasoning) is passed via model_metadata so the host can record provenance; omitted fields default to 'unknown'.",
|
|
1118
|
+
description: "Publish a reimplementation-spec to a CodeCartographer library. Identified by library_path (absolute) or cwd's config.yaml. Content-hash idempotent — re-publishing identical spec bytes updates metadata in place rather than bumping the version. Required: source_repo, headline, and either spec (inline) or spec_path (absolute file). Slug derives from source_repo if not provided. If the library is namespaced, namespace is required (or pass cwd to inherit from config). Generation context (agent, model, vendor, reasoning) is passed via model_metadata so the host can record provenance; omitted fields default to 'unknown'. When library.publish_confirm is set in config, a call without confirm: true is refused with a preview of what would be published (nothing is written); re-invoke with confirm: true to publish.",
|
|
1014
1119
|
inputSchema: {
|
|
1015
1120
|
type: "object",
|
|
1016
1121
|
properties: {
|
|
@@ -1029,7 +1134,11 @@ const TOOLS = [
|
|
|
1029
1134
|
headline: { type: "string" },
|
|
1030
1135
|
tags: { type: "array", items: { type: "string" } },
|
|
1031
1136
|
capabilities: { type: "array", items: { type: "string" } },
|
|
1032
|
-
confidentiality: {
|
|
1137
|
+
confidentiality: {
|
|
1138
|
+
type: "string",
|
|
1139
|
+
enum: ["internal", "shared", "public"],
|
|
1140
|
+
description: "Classification of the entry. Defaults to internal. Ordered internal < shared < public; publish refuses an entry more restricted than the library's visibility unless allow_confidentiality_mismatch is set.",
|
|
1141
|
+
},
|
|
1033
1142
|
model_metadata: {
|
|
1034
1143
|
type: "object",
|
|
1035
1144
|
properties: {
|
|
@@ -1046,13 +1155,21 @@ const TOOLS = [
|
|
|
1046
1155
|
type: "boolean",
|
|
1047
1156
|
description: "Permit publishing when the target entry already records a different source_repo. Off by default, because a mismatch usually means two projects derived the same slug and the spec would land in the wrong version history. Set only when the repository itself moved.",
|
|
1048
1157
|
},
|
|
1158
|
+
allow_confidentiality_mismatch: {
|
|
1159
|
+
type: "boolean",
|
|
1160
|
+
description: "Permit publishing when the entry's confidentiality is more restricted than the library's visibility (internal < shared < public: an internal entry into a shared or public library, a shared entry into a public one). Off by default, because that direction exposes the spec to everyone the library reaches. An omitted confidentiality counts as internal. Set only when the exposure is intended; the recorded confidentiality is not changed.",
|
|
1161
|
+
},
|
|
1162
|
+
confirm: {
|
|
1163
|
+
type: "boolean",
|
|
1164
|
+
description: "Acknowledge the publish_confirm gate. When library.publish_confirm is set in config (user-global ~/.codecarto/config.yaml, or the workspace's .codecarto/workflow/config.yaml when cwd is passed), a call without confirm: true is refused and the refusal previews what would be published — library, entry, whether a new version or a metadata-only update, source_repo, headline, confidentiality — so the caller can show it before committing to the write. Pass true to publish. No effect when publish_confirm is unset or false.",
|
|
1165
|
+
},
|
|
1049
1166
|
},
|
|
1050
1167
|
required: ["source_repo", "headline"],
|
|
1051
1168
|
},
|
|
1052
1169
|
},
|
|
1053
1170
|
{
|
|
1054
1171
|
name: "codecarto_library_list",
|
|
1055
|
-
description: "List entries in a CodeCartographer library, optionally filtered by namespace, tag, slug, or source_repo. The library is identified by library_path (absolute) or by cwd's config.yaml.",
|
|
1172
|
+
description: "List entries in a CodeCartographer library, optionally filtered by namespace, tag, slug, or source_repo. The library is identified by library_path (absolute) or by cwd's config.yaml. Flags entries whose versions disagree about source_repo (merged by a slug collision before publish refused cross-project appends); repair is manual.",
|
|
1056
1173
|
inputSchema: {
|
|
1057
1174
|
type: "object",
|
|
1058
1175
|
properties: {
|
|
@@ -1067,7 +1184,7 @@ const TOOLS = [
|
|
|
1067
1184
|
},
|
|
1068
1185
|
{
|
|
1069
1186
|
name: "codecarto_library_reindex",
|
|
1070
|
-
description: "Regenerate index.yaml and INDEX.md for a CodeCartographer library from filesystem state. Use after manual edits or to resolve a git merge conflict on index.yaml.",
|
|
1187
|
+
description: "Regenerate index.yaml and INDEX.md for a CodeCartographer library from filesystem state. Use after manual edits or to resolve a git merge conflict on index.yaml. Also reports entries whose versions disagree about source_repo (merged by a slug collision before publish refused cross-project appends); the index files are not changed and repair is manual.",
|
|
1071
1188
|
inputSchema: {
|
|
1072
1189
|
type: "object",
|
|
1073
1190
|
properties: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codecartographer-pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"mcpName": "io.github.HuginnIndustries/codecartographer",
|
|
5
5
|
"description": "Turn an unfamiliar codebase into a validated reimplementation spec, then synthesize confirmed specs and a product vision into a traceable plan.",
|
|
6
6
|
"type": "module",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@modelcontextprotocol/sdk": "^1.29.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@earendil-works/pi-coding-agent": "
|
|
67
|
+
"@earendil-works/pi-coding-agent": ">=0.84.0",
|
|
68
68
|
"@sinclair/typebox": "*"
|
|
69
69
|
},
|
|
70
70
|
"pi": {
|