{"at":"2026-11-23T02:58:16.643Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T02:58:17.047Z","dir":"received","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","result":{"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"codecartographer","version":"0.27.0"}},"cacheScope":"private","capabilities":{"tools":{}},"resultType":"complete","supportedVersions":["2026-07-28"],"ttlMs":0}}}
{"at":"2026-11-23T02:58:17.047Z","dir":"sent","era":"server_discover","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T02:58:17.049Z","dir":"received","era":"server_discover","message":{"id":2,"jsonrpc":"2.0","result":{"_meta":{"io.modelcontextprotocol/serverInfo":{"name":"codecartographer","version":"0.27.0"}},"cacheScope":"public","resultType":"complete","tools":[{"description":"Initialize a CodeCartographer workspace (.codecarto/) in a target repository. Copies the packaged framework template and writes a fresh status.yaml for the chosen pipeline. If .codecarto/ already exists, pass force: true to back up the existing workspace to .codecarto-backup-TIMESTAMP/ and create a fresh one. Warning: backing up moves all existing findings, handoffs, usage data, closeouts, and phase progress to the backup directory.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"force":{"description":"Back up and overwrite an existing .codecarto/ directory if present (default false).","type":"boolean"},"pipeline":{"description":"Pipeline alias or workflow/*.yaml path. Defaults to the framework's default pipeline.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_init"},{"description":"Switch the active pipeline in-place without losing findings, handoffs, usage data, or phase progress. Phases that exist in both the old and new pipelines preserve their completion status. Phases unique to the new pipeline start as pending. Pass a pipeline alias (e.g. lite, full, synthesis) or a workflow/*.yaml path.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"pipeline":{"description":"Pipeline alias (e.g. lite, full, synthesis, architecture-only, defect-scan) or workflow/*.yaml path.","type":"string"}},"required":["cwd","pipeline"],"type":"object"},"name":"codecarto_switch_pipeline"},{"description":"Show the current CodeCartographer phase, active pipeline, and progress for a target repository.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_status"},{"description":"Return the prompt text for the next eligible CodeCartographer phase. The host should feed this prompt back to the agent or display it to the user.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"unattended":{"description":"Set when no user is in the loop to answer the prompt's questions (an autonomous run). The reimplementation-spec prompt then defaults to the language-agnostic variant and records selection: auto-default instead of asking which variant to build, and every interactive hook is suppressed. Same as Pi's /codecarto-next --auto.","type":"boolean"}},"required":["cwd"],"type":"object"},"name":"codecarto_next"},{"description":"Return the prompt text for a specific CodeCartographer phase, even if it is not the next eligible phase. Used to revisit a phase or to bypass DAG order intentionally.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"phase":{"description":"Phase id from the active pipeline.","type":"string"},"unattended":{"description":"As for codecarto_next: no user is in the loop, so interactive hooks default and record their choice instead of asking.","type":"boolean"}},"required":["cwd","phase"],"type":"object"},"name":"codecarto_phase"},{"description":"Read the ## Validation table a phase wrote at the end of its primary output — the phase's own PASS/PARTIAL/FAIL per completion criterion — apply two cross-checks (findings evidence/action pairing; declared secondary outputs present), and return PASS/PASS WITH GAPS/FAIL/MISSING plus the parsed rows. It does not judge the criteria itself. If phase is omitted, validates the next eligible phase.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"phase":{"description":"Phase id (optional).","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_validate"},{"description":"Mark a phase complete. Requires the phase output's validation to be PASS or PASS WITH GAPS and applies the phase handoff at scratch/handoffs/<phase>.yaml. Atomically updates status.yaml under a file lock, appends one THREAD_LOG.md entry, and writes the phase's closeout: the handoff's closeout_content (plus its decisions) overwrites the canonical <date>-<phase>.md when supplied; otherwise a stub is copied from the template only if no closeout exists yet. If phase is omitted, completes the next eligible phase.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"phase":{"description":"Phase id (optional).","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_complete"},{"description":"Return the prompt text for a post-pipeline skill (only callable after all phases are complete). Use codecarto_status to confirm completion first. One name is exempt from the completion gate: \"broadside\" returns the reading guide for a Broad-Side batch reconnaissance run, which is meant to be read before or during the pipeline and works without a workspace.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"name":{"description":"Skill name (a directory under .codecarto/skills/), or \"broadside\" for the Broad-Side reading guide.","type":"string"}},"required":["cwd","name"],"type":"object"},"name":"codecarto_skill"},{"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.","inputSchema":{"properties":{"allow_confidentiality_mismatch":{"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.","type":"boolean"},"allow_source_repo_change":{"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.","type":"boolean"},"analyzed_at":{"description":"ISO 8601 UTC timestamp. Defaults to now.","type":"string"},"capabilities":{"items":{"type":"string"},"type":"array"},"confidentiality":{"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.","enum":["internal","shared","public"],"type":"string"},"confirm":{"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.","type":"boolean"},"cwd":{"description":"Absolute path to a workspace. Used to read defaults from config.yaml and status.yaml.","type":"string"},"force_new_version":{"type":"boolean"},"headline":{"type":"string"},"library_path":{"description":"Absolute path to the library directory.","type":"string"},"model_metadata":{"properties":{"agent":{"type":"string"},"agent_version":{"type":"string"},"model":{"type":"string"},"model_vendor":{"type":"string"},"notes":{"type":"string"},"reasoning":{"enum":["high","medium","low","default","unknown"],"type":"string"}},"type":"object"},"namespace":{"description":"Namespace under entries/. Required for namespaced libraries.","type":"string"},"pipeline":{"description":"Pipeline used. Inherited from cwd's status.yaml if available.","type":"string"},"slug":{"description":"Entry slug. Derived from source_repo if omitted.","type":"string"},"source_branch":{"type":"string"},"source_commit":{"type":"string"},"source_dirty":{"type":"boolean"},"source_repo":{"description":"URL or path to the analyzed repository.","type":"string"},"spec":{"description":"Inline spec markdown content (mutually exclusive with spec_path).","type":"string"},"spec_path":{"description":"Absolute path to a file containing the spec markdown (mutually exclusive with spec).","type":"string"},"tags":{"items":{"type":"string"},"type":"array"}},"required":["source_repo","headline"],"type":"object"},"name":"codecarto_publish"},{"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.","inputSchema":{"properties":{"cwd":{"type":"string"},"library_path":{"type":"string"},"namespace":{"type":"string"},"slug":{"type":"string"},"source_repo":{"type":"string"},"tag":{"type":"string"}},"type":"object"},"name":"codecarto_library_list"},{"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.","inputSchema":{"properties":{"cwd":{"type":"string"},"library_path":{"type":"string"}},"type":"object"},"name":"codecarto_library_reindex"},{"description":"Generate a structured vision brief from raw product text using the guided interview skill. Returns a prompt the host should feed to its agent to write inputs/vision.md. Requires a synthesis workspace (run codecarto_init with the synthesis pipeline first).","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository with a .codecarto/ synthesis workspace.","type":"string"},"raw_text":{"description":"The user's raw product text — audience, problem, desired outcomes, constraints, non-goals.","type":"string"}},"required":["cwd","raw_text"],"type":"object"},"name":"codecarto_vision"},{"description":"Initialize a CodeCartographer library at the given path: create the directory, write the .codecarto-library marker, and write the library.path into the user-global config. Idempotent — safe to re-run on an existing library. Pass a namespace to create a namespaced (shared) library.","inputSchema":{"properties":{"library_path":{"description":"Absolute path for the library directory.","type":"string"},"name":{"description":"Library name (defaults to the directory basename).","type":"string"},"namespace":{"description":"Default namespace for a namespaced (shared) library.","type":"string"}},"required":["library_path"],"type":"object"},"name":"codecarto_library_init"},{"description":"Show the effective merged CodeCartographer configuration (library.path, library.namespace, publish_confirm, llm_steer_next_phase) and whether the library marker was found. Pass cwd to include workspace-level config in the merge.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to a repository with a .codecarto/ workspace (optional).","type":"string"}},"type":"object"},"name":"codecarto_config"},{"description":"Activate an existing CodeCartographer workspace without resetting state. Returns the current pipeline and phase.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_open"},{"description":"Show cumulative and per-phase token usage from local phase runs.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_usage"},{"description":"Regenerate .codecarto/dashboard.html from the current workspace state.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_dashboard"},{"description":"Return the instructions for driving this server: the status/next/execute/validate/complete loop, the phase-handoff contract, pipeline selection, executor choice, and recovery. Call this first when you have not run a CodeCartographer pipeline before. Takes no workspace.","inputSchema":{"properties":{"topic":{"description":"Guide topic. Omit for the overview; other topics are listed in every response.","type":"string"}},"type":"object"},"name":"codecarto_guide"},{"description":"List available post-pipeline skills installed in the workspace, plus the Broad-Side reading guide when it is present (that one is not pipeline-gated).","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_list_skills"},{"description":"Apply a post-pipeline amendment from .codecarto/scratch/amendments/<name>.yaml to workflow/status.yaml: close open questions resolved on evidence after the pipeline completed and retire finished post-pipeline backlog items, under the same lock completion uses. Writes an amendment closeout and THREAD_LOG entry. Refused while the pipeline is incomplete — mid-pipeline resolutions belong in the phase handoff. Idempotent: ids that no longer match are reported, not fatal.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"name":{"description":"Amendment file slug under .codecarto/scratch/amendments/ (with or without .yaml).","type":"string"}},"required":["cwd","name"],"type":"object"},"name":"codecarto_amend"},{"description":"Refresh a workspace's framework-owned files (GUIDE.md, templates/, workflow pipelines and VALIDATE.md, skills/, findings SKILL and README stubs) from the packaged template — the action every scaffold-staleness warning instructs. Never touches project state (status.yaml), user config (workflow/config.yaml, usage log), findings outputs, scratch/, closeouts/, or the orchestrator files (CONVENTIONS.md, DECISIONS.md, BACKLOG.md, THREAD_LOG.md). Appends one THREAD_LOG entry naming the version transition. Unlike codecarto_init force:true, nothing is backed up or lost.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_refresh_scaffold"},{"description":"Broad-Side: fire a cheap batch reconnaissance scan at a repository via the OpenRouter Batch API. Six lenses (architecture, api, security, defect, conventions, porting) run as asynchronous single-turn prompts with structured JSON schemas; results land in .codecarto/broadside/<run>/ as JSON plus markdown, with an optional cross-lens synthesis report. Works on any git repository — no CodeCartographer workspace required. Requires an OpenRouter API key (api_key param, OPENROUTER_API_KEY env var, or .codecarto/broadside/config.yaml). Findings are unverified scouting signals from a batch model, not validated claims — they tell the interactive pipeline where to look. Actions: submit (fire batches, returns batch ids and cost estimate), collect (poll to completion, save results, optionally synthesize), status (show recorded runs), models (list batch-capable models with pricing, context, output caps, structured-output support, and optional coding benchmarks).","inputSchema":{"properties":{"action":{"description":"submit fires all lens batches and returns batch ids; collect polls submitted batches, saves results, and optionally runs the synthesis and triage passes — built from verified.json when a verify pass has already written it, so run verify first or collect again with regenerate_post_passes afterwards; status shows recorded runs; models lists batch-capable models with pricing and capabilities; verify reads a collected run's top defect and security findings against the repository with read-only tools (one sync-priced call each, about a cent on the default model) and writes verified.md/verified.json beside triage.md with a verdict per finding: confirmed (a reachable failure, with the trigger), not-a-defect, discarded, or unclear.","enum":["submit","collect","status","models","verify"],"type":"string"},"api_key":{"description":"OpenRouter API key. A value passed here is recorded wherever the host logs tool calls; prefer the OPENROUTER_API_KEY environment variable of the server process. (api_key in .codecarto/broadside/config.yaml also works, but that file is tracked, so a key there is committed with it.)","type":"string"},"cwd":{"description":"Absolute path to the target repository.","type":"string"},"force":{"description":"Submit even when the cost estimate exceeds max_cost (default false).","type":"boolean"},"include_benchmarks":{"description":"For action 'models': annotate each model with its Artificial Analysis coding index (extra API call; default false).","type":"boolean"},"include_synthesis":{"description":"Run the cross-lens synthesis pass once all lens batches complete. Falls back to include_synthesis in .codecarto/broadside/config.yaml (default true).","type":"boolean"},"include_triage":{"description":"Run the triage pass once all lens batches complete: turns the findings into a prioritized work order (impact × difficulty, P0-P3, effort estimates). Falls back to include_triage in .codecarto/broadside/config.yaml (default true).","type":"boolean"},"incremental":{"description":"Diff against the previous run's git HEAD and scan only the modules whose files changed (falls back to a full scan on a dirty tree or when no prior run exists). Falls back to incremental in .codecarto/broadside/config.yaml (default false).","type":"boolean"},"lens_models":{"additionalProperties":{"type":"string"},"description":"For submit: per-lens model overrides for this run, e.g. {\"security\": \"deepseek/deepseek-v4-pro-0813:batch\"}. Keys are lens ids; a lens named here runs on that model, others on `model`. Layered over lens_models in .codecarto/broadside/config.yaml (a lens set in both takes the parameter's). Each override is priced, capability-checked, and clamped individually, and the estimate breaks cost out per lens.","type":"object"},"lenses":{"description":"Lenses to run (submit only). Defaults to all six.","items":{"enum":["architecture","api","security","defect","conventions","porting"],"type":"string"},"type":"array"},"max_cost":{"description":"Approximate run expense limit in USD. The submit action estimates the run cost from slice sizes and the configured model's per-token pricing (live OpenRouter lookup, cached 24h) and refuses to submit when the estimate exceeds the limit unless force is true. For verify it is a running cap: the pass stops before the next finding once the calls so far have reached it. Falls back to max_cost in .codecarto/broadside/config.yaml, whose default is $1.00; pass 0 for no limit.","type":"number"},"model":{"description":"For verify: the sync (non-batch) OpenRouter model to read with; defaults to the run's model without its :batch suffix. For submit: the OpenRouter batch model for this run (an id ending in :batch, as listed by action 'models'). Falls back to model in .codecarto/broadside/config.yaml, then the shipped default. Pre-flighted like the configured model: priced from the live catalog, refused without structured-output support, clamped to its completion ceiling. The models listing is advisory — some catalog ids have no batch endpoint and are refused at submit, at no cost; the listing tags ids this repository has already seen accepted or refused.","type":"string"},"regenerate_post_passes":{"description":"collect only: reset the run's settled synthesis and triage passes and run them again, so a verify pass's verdicts (verified.json) are built into the executive report and the work order — confirmed findings first, discarded ones dropped, not-a-defect ones listed apart. Costs another post-pass pair (a few cents); a pass still in flight is left to finish; a run whose lens batches are still running is refused.","type":"boolean"},"retry_truncated":{"description":"Re-submit lens results that came back truncated at the output token limit, once, with a doubled output cap. Falls back to retry_truncated in .codecarto/broadside/config.yaml (default true).","type":"boolean"},"run_id":{"description":"For collect and verify: the run to act on, as listed by the status action. Defaults to the most recent run; pass this to collect an older run that is still in flight after a newer submit.","type":"string"},"top":{"description":"For verify: how many findings to read, most severe first (default 10). Each costs one sync call; max_cost caps the pass as a running total.","type":"integer"},"wait_seconds":{"description":"For submit: after submitting, poll up to this many seconds before returning. For collect: poll up to this many seconds before returning with partial state. 0 polls each in-flight batch once and returns without waiting. Falls back to wait_seconds in .codecarto/broadside/config.yaml (default 0). The wait is also bounded by the host's own tool-call timeout: if the host gives up first, the server stops polling and submits nothing further, the batches keep running server-side, and the next collect claims them — so prefer submit, then collect later, over a wait longer than the host allows.","type":"number"}},"required":["cwd","action"],"type":"object"},"name":"codecarto_broadside"},{"description":"EXPERIMENTAL. Record and inspect an engineering change: its brief, its plan, the attempt lifecycle (start_attempt captures the baseline, capture_candidate the candidate — both read from the workspace by this server, never supplied by the caller), proofs of checks a host ran, a review bound to the captured candidate (record_review), and the acceptance gate. request_acceptance ASKS the person through the client's own elicitation form; it never grants. This surface records what a host did — it never runs anything, and it cannot approve work.","inputSchema":{"properties":{"acceptance_scenarios":{"description":"[{ id, kind: behavior|preserved|non-functional, description }] (plan with slices).","type":"array"},"action":{"description":"The operation to perform.","enum":["create","update","show","list","plan","start_attempt","capture_candidate","record_proof","record_review","gate","request_acceptance","ingest_observations"],"type":"string"},"attempt_id":{"description":"Attempt to capture a candidate for (capture_candidate), review (record_review), evaluate (gate), ask acceptance for (request_acceptance), or ingest host observations for (ingest_observations).","type":"string"},"baseline_commit":{"description":"Full commit hash the change is based on (create). Without it the baseline is recorded as having no VCS, because HEAD alone never identifies a candidate.","type":"string"},"change_id":{"description":"Change record id, for actions that address one.","type":"string"},"cwd":{"description":"Workspace directory.","type":"string"},"inputs":{"description":"{ references } the attempt starts from (start_attempt). brief_digest and plan_digest are derived by the server from the stored brief.md/plan.md; if supplied they must equal what plan returned.","type":"object"},"mode":{"description":"Change mode (create); defaults to feature.","enum":["fix","feature","refactor","migration","investigation"],"type":"string"},"outcome":{"description":"The outcome being requested (create).","type":"string"},"parent_attempt_id":{"description":"The attempt this one retries or continues (start_attempt).","type":"string"},"plan_markdown":{"description":"The plan text stored as plan.md (plan with slices); a listing of the slices when omitted.","type":"string"},"proof":{"description":"A proof of a check the HOST ran (record_proof).","type":"object"},"request_id":{"description":"Caller-chosen id making create retry-safe.","type":"string"},"review":{"description":"{ reviewer, objections, summary } (record_review). The candidate and input digests are bound from the stored attempt, never supplied.","type":"object"},"revision":{"description":"Compare-and-swap revision the caller last read (update, plan with slices).","type":"number"},"slice_id":{"description":"Slice the attempt works on (start_attempt).","type":"string"},"slices":{"description":"Slices to record (plan): [{ title, deliverable, scenario_ids, proof_obligations: [{ id, scenario_id, check_kind, description, minimum_collector }], permitted_scope: { paths }, depends_on? }]. Omit for a read-only brief.","type":"array"},"title":{"description":"Short change title (create).","type":"string"}},"required":["cwd","action"],"type":"object"},"name":"codecarto_change"}],"ttlMs":86400000}}}
{"at":"2026-11-23T02:58:17.150Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T02:58:17.563Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{}},"protocolVersion":"2025-11-25","serverInfo":{"name":"codecartographer","version":"0.27.0"}}}}
{"at":"2026-11-23T02:58:17.563Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T02:58:17.563Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T02:58:17.565Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"Initialize a CodeCartographer workspace (.codecarto/) in a target repository. Copies the packaged framework template and writes a fresh status.yaml for the chosen pipeline. If .codecarto/ already exists, pass force: true to back up the existing workspace to .codecarto-backup-TIMESTAMP/ and create a fresh one. Warning: backing up moves all existing findings, handoffs, usage data, closeouts, and phase progress to the backup directory.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"force":{"description":"Back up and overwrite an existing .codecarto/ directory if present (default false).","type":"boolean"},"pipeline":{"description":"Pipeline alias or workflow/*.yaml path. Defaults to the framework's default pipeline.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_init"},{"description":"Switch the active pipeline in-place without losing findings, handoffs, usage data, or phase progress. Phases that exist in both the old and new pipelines preserve their completion status. Phases unique to the new pipeline start as pending. Pass a pipeline alias (e.g. lite, full, synthesis) or a workflow/*.yaml path.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"pipeline":{"description":"Pipeline alias (e.g. lite, full, synthesis, architecture-only, defect-scan) or workflow/*.yaml path.","type":"string"}},"required":["cwd","pipeline"],"type":"object"},"name":"codecarto_switch_pipeline"},{"description":"Show the current CodeCartographer phase, active pipeline, and progress for a target repository.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_status"},{"description":"Return the prompt text for the next eligible CodeCartographer phase. The host should feed this prompt back to the agent or display it to the user.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"unattended":{"description":"Set when no user is in the loop to answer the prompt's questions (an autonomous run). The reimplementation-spec prompt then defaults to the language-agnostic variant and records selection: auto-default instead of asking which variant to build, and every interactive hook is suppressed. Same as Pi's /codecarto-next --auto.","type":"boolean"}},"required":["cwd"],"type":"object"},"name":"codecarto_next"},{"description":"Return the prompt text for a specific CodeCartographer phase, even if it is not the next eligible phase. Used to revisit a phase or to bypass DAG order intentionally.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"phase":{"description":"Phase id from the active pipeline.","type":"string"},"unattended":{"description":"As for codecarto_next: no user is in the loop, so interactive hooks default and record their choice instead of asking.","type":"boolean"}},"required":["cwd","phase"],"type":"object"},"name":"codecarto_phase"},{"description":"Read the ## Validation table a phase wrote at the end of its primary output — the phase's own PASS/PARTIAL/FAIL per completion criterion — apply two cross-checks (findings evidence/action pairing; declared secondary outputs present), and return PASS/PASS WITH GAPS/FAIL/MISSING plus the parsed rows. It does not judge the criteria itself. If phase is omitted, validates the next eligible phase.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"phase":{"description":"Phase id (optional).","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_validate"},{"description":"Mark a phase complete. Requires the phase output's validation to be PASS or PASS WITH GAPS and applies the phase handoff at scratch/handoffs/<phase>.yaml. Atomically updates status.yaml under a file lock, appends one THREAD_LOG.md entry, and writes the phase's closeout: the handoff's closeout_content (plus its decisions) overwrites the canonical <date>-<phase>.md when supplied; otherwise a stub is copied from the template only if no closeout exists yet. If phase is omitted, completes the next eligible phase.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"phase":{"description":"Phase id (optional).","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_complete"},{"description":"Return the prompt text for a post-pipeline skill (only callable after all phases are complete). Use codecarto_status to confirm completion first. One name is exempt from the completion gate: \"broadside\" returns the reading guide for a Broad-Side batch reconnaissance run, which is meant to be read before or during the pipeline and works without a workspace.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"name":{"description":"Skill name (a directory under .codecarto/skills/), or \"broadside\" for the Broad-Side reading guide.","type":"string"}},"required":["cwd","name"],"type":"object"},"name":"codecarto_skill"},{"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.","inputSchema":{"properties":{"allow_confidentiality_mismatch":{"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.","type":"boolean"},"allow_source_repo_change":{"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.","type":"boolean"},"analyzed_at":{"description":"ISO 8601 UTC timestamp. Defaults to now.","type":"string"},"capabilities":{"items":{"type":"string"},"type":"array"},"confidentiality":{"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.","enum":["internal","shared","public"],"type":"string"},"confirm":{"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.","type":"boolean"},"cwd":{"description":"Absolute path to a workspace. Used to read defaults from config.yaml and status.yaml.","type":"string"},"force_new_version":{"type":"boolean"},"headline":{"type":"string"},"library_path":{"description":"Absolute path to the library directory.","type":"string"},"model_metadata":{"properties":{"agent":{"type":"string"},"agent_version":{"type":"string"},"model":{"type":"string"},"model_vendor":{"type":"string"},"notes":{"type":"string"},"reasoning":{"enum":["high","medium","low","default","unknown"],"type":"string"}},"type":"object"},"namespace":{"description":"Namespace under entries/. Required for namespaced libraries.","type":"string"},"pipeline":{"description":"Pipeline used. Inherited from cwd's status.yaml if available.","type":"string"},"slug":{"description":"Entry slug. Derived from source_repo if omitted.","type":"string"},"source_branch":{"type":"string"},"source_commit":{"type":"string"},"source_dirty":{"type":"boolean"},"source_repo":{"description":"URL or path to the analyzed repository.","type":"string"},"spec":{"description":"Inline spec markdown content (mutually exclusive with spec_path).","type":"string"},"spec_path":{"description":"Absolute path to a file containing the spec markdown (mutually exclusive with spec).","type":"string"},"tags":{"items":{"type":"string"},"type":"array"}},"required":["source_repo","headline"],"type":"object"},"name":"codecarto_publish"},{"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.","inputSchema":{"properties":{"cwd":{"type":"string"},"library_path":{"type":"string"},"namespace":{"type":"string"},"slug":{"type":"string"},"source_repo":{"type":"string"},"tag":{"type":"string"}},"type":"object"},"name":"codecarto_library_list"},{"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.","inputSchema":{"properties":{"cwd":{"type":"string"},"library_path":{"type":"string"}},"type":"object"},"name":"codecarto_library_reindex"},{"description":"Generate a structured vision brief from raw product text using the guided interview skill. Returns a prompt the host should feed to its agent to write inputs/vision.md. Requires a synthesis workspace (run codecarto_init with the synthesis pipeline first).","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository with a .codecarto/ synthesis workspace.","type":"string"},"raw_text":{"description":"The user's raw product text — audience, problem, desired outcomes, constraints, non-goals.","type":"string"}},"required":["cwd","raw_text"],"type":"object"},"name":"codecarto_vision"},{"description":"Initialize a CodeCartographer library at the given path: create the directory, write the .codecarto-library marker, and write the library.path into the user-global config. Idempotent — safe to re-run on an existing library. Pass a namespace to create a namespaced (shared) library.","inputSchema":{"properties":{"library_path":{"description":"Absolute path for the library directory.","type":"string"},"name":{"description":"Library name (defaults to the directory basename).","type":"string"},"namespace":{"description":"Default namespace for a namespaced (shared) library.","type":"string"}},"required":["library_path"],"type":"object"},"name":"codecarto_library_init"},{"description":"Show the effective merged CodeCartographer configuration (library.path, library.namespace, publish_confirm, llm_steer_next_phase) and whether the library marker was found. Pass cwd to include workspace-level config in the merge.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to a repository with a .codecarto/ workspace (optional).","type":"string"}},"type":"object"},"name":"codecarto_config"},{"description":"Activate an existing CodeCartographer workspace without resetting state. Returns the current pipeline and phase.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_open"},{"description":"Show cumulative and per-phase token usage from local phase runs.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_usage"},{"description":"Regenerate .codecarto/dashboard.html from the current workspace state.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_dashboard"},{"description":"Return the instructions for driving this server: the status/next/execute/validate/complete loop, the phase-handoff contract, pipeline selection, executor choice, and recovery. Call this first when you have not run a CodeCartographer pipeline before. Takes no workspace.","inputSchema":{"properties":{"topic":{"description":"Guide topic. Omit for the overview; other topics are listed in every response.","type":"string"}},"type":"object"},"name":"codecarto_guide"},{"description":"List available post-pipeline skills installed in the workspace, plus the Broad-Side reading guide when it is present (that one is not pipeline-gated).","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_list_skills"},{"description":"Apply a post-pipeline amendment from .codecarto/scratch/amendments/<name>.yaml to workflow/status.yaml: close open questions resolved on evidence after the pipeline completed and retire finished post-pipeline backlog items, under the same lock completion uses. Writes an amendment closeout and THREAD_LOG entry. Refused while the pipeline is incomplete — mid-pipeline resolutions belong in the phase handoff. Idempotent: ids that no longer match are reported, not fatal.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"},"name":{"description":"Amendment file slug under .codecarto/scratch/amendments/ (with or without .yaml).","type":"string"}},"required":["cwd","name"],"type":"object"},"name":"codecarto_amend"},{"description":"Refresh a workspace's framework-owned files (GUIDE.md, templates/, workflow pipelines and VALIDATE.md, skills/, findings SKILL and README stubs) from the packaged template — the action every scaffold-staleness warning instructs. Never touches project state (status.yaml), user config (workflow/config.yaml, usage log), findings outputs, scratch/, closeouts/, or the orchestrator files (CONVENTIONS.md, DECISIONS.md, BACKLOG.md, THREAD_LOG.md). Appends one THREAD_LOG entry naming the version transition. Unlike codecarto_init force:true, nothing is backed up or lost.","inputSchema":{"properties":{"cwd":{"description":"Absolute path to the target repository.","type":"string"}},"required":["cwd"],"type":"object"},"name":"codecarto_refresh_scaffold"},{"description":"Broad-Side: fire a cheap batch reconnaissance scan at a repository via the OpenRouter Batch API. Six lenses (architecture, api, security, defect, conventions, porting) run as asynchronous single-turn prompts with structured JSON schemas; results land in .codecarto/broadside/<run>/ as JSON plus markdown, with an optional cross-lens synthesis report. Works on any git repository — no CodeCartographer workspace required. Requires an OpenRouter API key (api_key param, OPENROUTER_API_KEY env var, or .codecarto/broadside/config.yaml). Findings are unverified scouting signals from a batch model, not validated claims — they tell the interactive pipeline where to look. Actions: submit (fire batches, returns batch ids and cost estimate), collect (poll to completion, save results, optionally synthesize), status (show recorded runs), models (list batch-capable models with pricing, context, output caps, structured-output support, and optional coding benchmarks).","inputSchema":{"properties":{"action":{"description":"submit fires all lens batches and returns batch ids; collect polls submitted batches, saves results, and optionally runs the synthesis and triage passes — built from verified.json when a verify pass has already written it, so run verify first or collect again with regenerate_post_passes afterwards; status shows recorded runs; models lists batch-capable models with pricing and capabilities; verify reads a collected run's top defect and security findings against the repository with read-only tools (one sync-priced call each, about a cent on the default model) and writes verified.md/verified.json beside triage.md with a verdict per finding: confirmed (a reachable failure, with the trigger), not-a-defect, discarded, or unclear.","enum":["submit","collect","status","models","verify"],"type":"string"},"api_key":{"description":"OpenRouter API key. A value passed here is recorded wherever the host logs tool calls; prefer the OPENROUTER_API_KEY environment variable of the server process. (api_key in .codecarto/broadside/config.yaml also works, but that file is tracked, so a key there is committed with it.)","type":"string"},"cwd":{"description":"Absolute path to the target repository.","type":"string"},"force":{"description":"Submit even when the cost estimate exceeds max_cost (default false).","type":"boolean"},"include_benchmarks":{"description":"For action 'models': annotate each model with its Artificial Analysis coding index (extra API call; default false).","type":"boolean"},"include_synthesis":{"description":"Run the cross-lens synthesis pass once all lens batches complete. Falls back to include_synthesis in .codecarto/broadside/config.yaml (default true).","type":"boolean"},"include_triage":{"description":"Run the triage pass once all lens batches complete: turns the findings into a prioritized work order (impact × difficulty, P0-P3, effort estimates). Falls back to include_triage in .codecarto/broadside/config.yaml (default true).","type":"boolean"},"incremental":{"description":"Diff against the previous run's git HEAD and scan only the modules whose files changed (falls back to a full scan on a dirty tree or when no prior run exists). Falls back to incremental in .codecarto/broadside/config.yaml (default false).","type":"boolean"},"lens_models":{"additionalProperties":{"type":"string"},"description":"For submit: per-lens model overrides for this run, e.g. {\"security\": \"deepseek/deepseek-v4-pro-0813:batch\"}. Keys are lens ids; a lens named here runs on that model, others on `model`. Layered over lens_models in .codecarto/broadside/config.yaml (a lens set in both takes the parameter's). Each override is priced, capability-checked, and clamped individually, and the estimate breaks cost out per lens.","type":"object"},"lenses":{"description":"Lenses to run (submit only). Defaults to all six.","items":{"enum":["architecture","api","security","defect","conventions","porting"],"type":"string"},"type":"array"},"max_cost":{"description":"Approximate run expense limit in USD. The submit action estimates the run cost from slice sizes and the configured model's per-token pricing (live OpenRouter lookup, cached 24h) and refuses to submit when the estimate exceeds the limit unless force is true. For verify it is a running cap: the pass stops before the next finding once the calls so far have reached it. Falls back to max_cost in .codecarto/broadside/config.yaml, whose default is $1.00; pass 0 for no limit.","type":"number"},"model":{"description":"For verify: the sync (non-batch) OpenRouter model to read with; defaults to the run's model without its :batch suffix. For submit: the OpenRouter batch model for this run (an id ending in :batch, as listed by action 'models'). Falls back to model in .codecarto/broadside/config.yaml, then the shipped default. Pre-flighted like the configured model: priced from the live catalog, refused without structured-output support, clamped to its completion ceiling. The models listing is advisory — some catalog ids have no batch endpoint and are refused at submit, at no cost; the listing tags ids this repository has already seen accepted or refused.","type":"string"},"regenerate_post_passes":{"description":"collect only: reset the run's settled synthesis and triage passes and run them again, so a verify pass's verdicts (verified.json) are built into the executive report and the work order — confirmed findings first, discarded ones dropped, not-a-defect ones listed apart. Costs another post-pass pair (a few cents); a pass still in flight is left to finish; a run whose lens batches are still running is refused.","type":"boolean"},"retry_truncated":{"description":"Re-submit lens results that came back truncated at the output token limit, once, with a doubled output cap. Falls back to retry_truncated in .codecarto/broadside/config.yaml (default true).","type":"boolean"},"run_id":{"description":"For collect and verify: the run to act on, as listed by the status action. Defaults to the most recent run; pass this to collect an older run that is still in flight after a newer submit.","type":"string"},"top":{"description":"For verify: how many findings to read, most severe first (default 10). Each costs one sync call; max_cost caps the pass as a running total.","type":"integer"},"wait_seconds":{"description":"For submit: after submitting, poll up to this many seconds before returning. For collect: poll up to this many seconds before returning with partial state. 0 polls each in-flight batch once and returns without waiting. Falls back to wait_seconds in .codecarto/broadside/config.yaml (default 0). The wait is also bounded by the host's own tool-call timeout: if the host gives up first, the server stops polling and submits nothing further, the batches keep running server-side, and the next collect claims them — so prefer submit, then collect later, over a wait longer than the host allows.","type":"number"}},"required":["cwd","action"],"type":"object"},"name":"codecarto_broadside"},{"description":"EXPERIMENTAL. Record and inspect an engineering change: its brief, its plan, the attempt lifecycle (start_attempt captures the baseline, capture_candidate the candidate — both read from the workspace by this server, never supplied by the caller), proofs of checks a host ran, a review bound to the captured candidate (record_review), and the acceptance gate. request_acceptance ASKS the person through the client's own elicitation form; it never grants. This surface records what a host did — it never runs anything, and it cannot approve work.","inputSchema":{"properties":{"acceptance_scenarios":{"description":"[{ id, kind: behavior|preserved|non-functional, description }] (plan with slices).","type":"array"},"action":{"description":"The operation to perform.","enum":["create","update","show","list","plan","start_attempt","capture_candidate","record_proof","record_review","gate","request_acceptance","ingest_observations"],"type":"string"},"attempt_id":{"description":"Attempt to capture a candidate for (capture_candidate), review (record_review), evaluate (gate), ask acceptance for (request_acceptance), or ingest host observations for (ingest_observations).","type":"string"},"baseline_commit":{"description":"Full commit hash the change is based on (create). Without it the baseline is recorded as having no VCS, because HEAD alone never identifies a candidate.","type":"string"},"change_id":{"description":"Change record id, for actions that address one.","type":"string"},"cwd":{"description":"Workspace directory.","type":"string"},"inputs":{"description":"{ references } the attempt starts from (start_attempt). brief_digest and plan_digest are derived by the server from the stored brief.md/plan.md; if supplied they must equal what plan returned.","type":"object"},"mode":{"description":"Change mode (create); defaults to feature.","enum":["fix","feature","refactor","migration","investigation"],"type":"string"},"outcome":{"description":"The outcome being requested (create).","type":"string"},"parent_attempt_id":{"description":"The attempt this one retries or continues (start_attempt).","type":"string"},"plan_markdown":{"description":"The plan text stored as plan.md (plan with slices); a listing of the slices when omitted.","type":"string"},"proof":{"description":"A proof of a check the HOST ran (record_proof).","type":"object"},"request_id":{"description":"Caller-chosen id making create retry-safe.","type":"string"},"review":{"description":"{ reviewer, objections, summary } (record_review). The candidate and input digests are bound from the stored attempt, never supplied.","type":"object"},"revision":{"description":"Compare-and-swap revision the caller last read (update, plan with slices).","type":"number"},"slice_id":{"description":"Slice the attempt works on (start_attempt).","type":"string"},"slices":{"description":"Slices to record (plan): [{ title, deliverable, scenario_ids, proof_obligations: [{ id, scenario_id, check_kind, description, minimum_collector }], permitted_scope: { paths }, depends_on? }]. Omit for a read-only brief.","type":"array"},"title":{"description":"Short change title (create).","type":"string"}},"required":["cwd","action"],"type":"object"},"name":"codecarto_change"}]}}}
