truthmark 2.2.3 → 2.2.6

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/dist/main.js CHANGED
@@ -254,7 +254,8 @@ var SUPPORTED_PLATFORMS = [
254
254
  "opencode",
255
255
  "claude-code",
256
256
  "github-copilot",
257
- "gemini-cli"
257
+ "antigravity",
258
+ "cursor"
258
259
  ];
259
260
  var DEFAULT_PLATFORMS = [];
260
261
  var truthmarkConfigSchema = {
@@ -1234,6 +1235,16 @@ var renderBehaviorDocTemplateFile = () => {
1234
1235
  "",
1235
1236
  "{{core_rules}}",
1236
1237
  "",
1238
+ "## Behavior Scenarios",
1239
+ "",
1240
+ "<!--",
1241
+ "Use compact scenario blocks only where they clarify normal, fallback, or compatibility-critical behavior.",
1242
+ "Write scenarios as current truth, not desired requirements: `#### Scenario: <implemented case>` followed by `- **GIVEN** ...`, `- **WHEN** ...`, `- **THEN** ...`, and optional `- **AND** ...` bullets.",
1243
+ "Keep each bullet evidence-backed and observable; do not force a scenario for every rule.",
1244
+ "-->",
1245
+ "",
1246
+ "{{behavior_scenarios}}",
1247
+ "",
1237
1248
  "## Flows And States",
1238
1249
  "",
1239
1250
  "<!--",
@@ -2117,7 +2128,14 @@ var FEATURE_DOC_TEMPLATE_INSTRUCTIONS = [
2117
2128
  "If the template is missing, use lane-specific sections: product truth says what must be true and why; engineering truth says how the repository currently realizes it.",
2118
2129
  "Teams may edit template files under the configured Truthmark templates root to define their local truth-doc standards."
2119
2130
  ].join("\n");
2120
- var TRUTH_DOC_AUTHORING_STYLE_INSTRUCTIONS = "Prefer diff-friendly Markdown: one durable claim per bullet or line, paragraphs no longer than one or two short sentences, and bullets or tables for rules, criteria, fields, files, and lists.";
2131
+ var TRUTH_DOC_AUTHORING_STYLE_INSTRUCTIONS = [
2132
+ "Truth-doc prose style:",
2133
+ "- Use professional, plain technical prose. Prefer specific current-state claims over promotional, symbolic, or generic significance language.",
2134
+ "- Avoid common AI-writing tells: pivotal, crucial, underscores, serves as, stands as, showcases, landscape, vague expert attributions, and generic upbeat conclusions.",
2135
+ "- Keep claims evidence-backed and diff-friendly: one durable claim per bullet or line; paragraphs should be no longer than one or two short sentences.",
2136
+ "- Do not add personality, rhetorical flourish, first-person commentary, or marketing tone.",
2137
+ "- Rewrite dense or formulaic prose only when it improves readability without removing scope, evidence, decisions, or source references."
2138
+ ].join("\n");
2121
2139
  var renderTruthDocOwnershipGateSection = (subject, outcome) => {
2122
2140
  return [
2123
2141
  "Truth-doc ownership review:",
@@ -2267,29 +2285,6 @@ var renderCopilotCustomAgentModeSection = (agents, parentRule, writeAgents = [])
2267
2285
  `- ${parentRule}`
2268
2286
  ].join("\n");
2269
2287
  };
2270
- var renderGeminiSubagentModeSection = (agents, parentRule, writeAgents = []) => {
2271
- const mentions = agents.map((agent) => `@${agent.replace(/_/gu, "-")}`);
2272
- const writeMentions = writeAgents.map(
2273
- (agent) => `@${agent.replace(/_/gu, "-")}`
2274
- );
2275
- const writeAgentLines = writeMentions.length > 0 ? [
2276
- `- dispatch write-capable project subagents only with explicit write leases: ${writeMentions.join(", ")}`,
2277
- "- each write lease must name objective, required reads, allowed writes, forbidden writes, evidence, verification, and report fields",
2278
- "- write workers must stop when a required edit is off-lease and report status, filesChanged, evidence, offLeaseChanges, blockers, and notes",
2279
- "- parent must inspect the actual checkout diff against each lease before accepting a worker report"
2280
- ] : [];
2281
- const readOnlyScope = writeAgents.length > 0 ? "for verification" : "only";
2282
- const readOnlySubagentLabel = writeAgents.length > 0 ? "read-only subagents" : "subagents";
2283
- return [
2284
- "Gemini CLI subagent mode:",
2285
- "- use automatically when this workflow runs in Gemini CLI and the parent agent chooses bounded project subagent fan-out",
2286
- `- dispatch read-only project subagents ${readOnlyScope}: ${mentions.join(", ")}`,
2287
- `- ${readOnlySubagentLabel} inspect checkout evidence directly, return structured findings, and must not edit files`,
2288
- `- parent supplies bounded evidence shards; ${readOnlySubagentLabel} must not preload host instruction files or repo-wide policy docs unless assigned as evidence`,
2289
- ...writeAgentLines,
2290
- `- ${parentRule}`
2291
- ].join("\n");
2292
- };
2293
2288
  var defaultAgentConfig = () => {
2294
2289
  return createDefaultConfig();
2295
2290
  };
@@ -2545,46 +2540,6 @@ var TRUTHMARK_WORKFLOW_MANIFEST = {
2545
2540
  allowedWrites: ["functional code"],
2546
2541
  reportSections: ["Truth docs used", "Code updated", "Verification"]
2547
2542
  },
2548
- "truthmark-preview": {
2549
- id: "truthmark-preview",
2550
- displayName: "Truthmark Preview",
2551
- description: "Use when the user explicitly asks to preview likely workflow routing, target files, writes, or subagent use before edits. Not for validation, automatic gates, final correctness, or replacing Truth Check.",
2552
- shortDescription: "Preview likely workflow routing before edits; read-only and explicit",
2553
- defaultPrompt: "Use Truthmark Preview to estimate likely workflow routing before edits.",
2554
- allowImplicitInvocation: false,
2555
- positiveTriggers: [
2556
- "explicit request to preview Truthmark workflow routing before edits",
2557
- "explicit request for likely route owner, target docs, expected writes, or subagent plan"
2558
- ],
2559
- negativeTriggers: [
2560
- "normal validation or final correctness audit",
2561
- "automatic preflight or finish-time review",
2562
- "request to mutate truth docs, routing, or code"
2563
- ],
2564
- forbiddenAdjacency: [
2565
- "must not replace Truth Check",
2566
- "must not run Truth Sync automatically",
2567
- "must not authorize later edits or issue write leases"
2568
- ],
2569
- reviewQuestions: [
2570
- "read-only boundary",
2571
- "intended-not-authorized handoff",
2572
- "manual handoff questions"
2573
- ],
2574
- allowedWrites: ["none by default"],
2575
- reportSections: [
2576
- "Requested outcome",
2577
- "Likely workflow",
2578
- "Why this workflow",
2579
- "Likely route owner",
2580
- "Expected write classes",
2581
- "Expected target files",
2582
- "Suggested subagent use",
2583
- "Manual handoff questions",
2584
- "Handoff"
2585
- ],
2586
- subagents: ["truth_route_auditor"]
2587
- },
2588
2543
  "truthmark-check": {
2589
2544
  id: "truthmark-check",
2590
2545
  displayName: "Truthmark Check",
@@ -2673,7 +2628,6 @@ var getTruthmarkWorkflow = (id) => {
2673
2628
  };
2674
2629
 
2675
2630
  // src/agents/truth-check.ts
2676
- var TRUTH_CHECK_EXPLICIT_INVOCATIONS = "OpenCode /skill truthmark-check; Codex /truthmark-check or $truthmark-check; Claude Code /truthmark-check; GitHub Copilot /truthmark-check; Gemini CLI /truthmark:check.";
2677
2631
  var renderTruthCheckReportExample = (config = defaultAgentConfig()) => {
2678
2632
  const rootRouteIndex = config.truthmark.paths.routesIndex;
2679
2633
  return `Truth Check: completed
@@ -2730,8 +2684,6 @@ var renderTruthCheckProcedureBody = (config = defaultAgentConfig(), options = {}
2730
2684
 
2731
2685
  Use this skill to audit repository truth health.
2732
2686
 
2733
- Invocations: ${TRUTH_CHECK_EXPLICIT_INVOCATIONS}
2734
-
2735
2687
  Truth Check is agent-led:
2736
2688
 
2737
2689
  - inspect .truthmark/config.yml and configured route files only when they exist; then inspect canonical docs and relevant implementation directly
@@ -2765,7 +2717,6 @@ ${DECISION_TRUTH_INSTRUCTIONS}`;
2765
2717
  };
2766
2718
 
2767
2719
  // src/agents/truth-document.ts
2768
- var TRUTH_DOCUMENT_EXPLICIT_INVOCATIONS = "OpenCode /skill truthmark-document; Codex /truthmark-document or $truthmark-document; Claude Code /truthmark-document; GitHub Copilot /truthmark-document; Gemini CLI /truthmark:document.";
2769
2720
  var renderTruthDocumentReportExample = (config = defaultAgentConfig()) => {
2770
2721
  const engineeringTruthRoot = resolveEngineeringTruthRoot(config);
2771
2722
  return `Truth Document: completed
@@ -2832,7 +2783,6 @@ var renderTruthDocumentProcedureBody = (config = defaultAgentConfig(), options =
2832
2783
  return `# Truthmark Document
2833
2784
 
2834
2785
  Use this skill to document existing implemented behavior when no functional-code changes are required for the task.
2835
- Invocations: ${TRUTH_DOCUMENT_EXPLICIT_INVOCATIONS}
2836
2786
 
2837
2787
  Truth Document is manual and implementation-first:
2838
2788
 
@@ -2881,105 +2831,7 @@ Parent post-document verification:
2881
2831
  - verify the final report records ownership review, structure requirement, restructure, routing update, or manual handoff reason when applicable`;
2882
2832
  };
2883
2833
 
2884
- // src/agents/truth-preview.ts
2885
- var TRUTH_PREVIEW_EXPLICIT_INVOCATIONS = {
2886
- copilot: "GitHub Copilot /truthmark-preview.",
2887
- gemini: "Gemini CLI /truthmark:preview."
2888
- };
2889
- var renderTruthPreviewReportExample = (config = defaultAgentConfig()) => {
2890
- return `Truth Preview: completed
2891
-
2892
- Requested outcome:
2893
- - preview likely Truthmark workflow routing before edits
2894
-
2895
- Likely workflow:
2896
- - truthmark-document
2897
-
2898
- Why this workflow:
2899
- - positive trigger: document existing implemented behavior
2900
- - negative triggers considered: functional-code change, doc-first implementation, topology repair, truth audit
2901
- - forbidden adjacency considered: must not edit functional code
2902
-
2903
- Likely route owner:
2904
- - route file: ${config.truthmark.paths.routesIndex}
2905
- - likely lane impact: engineering-lane
2906
- - product target docs: none identified
2907
- - engineering target docs: ${config.truthmark.paths.engineeringTruthRoot}/behaviors/example.md
2908
- - confidence: medium
2909
-
2910
- Expected write classes:
2911
- - truth docs
2912
-
2913
- Expected target files:
2914
- - ${config.truthmark.paths.engineeringTruthRoot}/behaviors/example.md
2915
-
2916
- Suggested subagent use:
2917
- - read-only verifiers: truth_route_auditor
2918
- - write workers: none in Preview
2919
- - leases needed: none in Preview
2920
-
2921
- Manual handoff questions:
2922
- - none identified in preview
2923
-
2924
- Handoff:
2925
- - Run the selected Truthmark workflow after user approval.`;
2926
- };
2927
- var renderTruthPreviewAdapterReportFields = () => {
2928
- return `Return a concise Truth Preview report with these fields:
2929
- - requested outcome
2930
- - likely workflow
2931
- - why this workflow
2932
- - likely route owner and lane impact
2933
- - expected write classes
2934
- - expected target files
2935
- - suggested subagent use
2936
- - manual handoff questions
2937
- - handoff recommendation`;
2938
- };
2939
- var renderTruthPreviewProcedureBody = (config = defaultAgentConfig(), host) => {
2940
- const invocationLine = host === void 0 ? "" : `Invocations: ${TRUTH_PREVIEW_EXPLICIT_INVOCATIONS[host]}
2941
-
2942
- `;
2943
- return `Use this skill only when the user explicitly asks to preview Truthmark routing or workflow choice before edits.
2944
-
2945
- ${invocationLine}Truth Preview is read-only. Its report is intended, not authorized.
2946
-
2947
- Purpose:
2948
- - preview the likely Truthmark workflow, route owner, target files, expected write classes, suggested subagent use, and manual handoff questions before edits happen
2949
- - report likely product lane impact, engineering lane impact, target docs, and ambiguity before edits
2950
- - hand off to the selected workflow after user approval
2951
- - keep the selector thin so agents can avoid loading or acting through heavier workflows prematurely
2952
-
2953
- Read:
2954
- - .truthmark/config.yml, only when present
2955
- - ${config.truthmark.paths.routesIndex}, first, only when present
2956
- - relevant child route files under ${config.truthmark.paths.routeAreasRoot}/ for the selected scope or changed paths, only when present
2957
- - relevant truth docs and implementation files needed to preview ownership
2958
- - Evidence authority:
2959
- ${renderBulletBlock(EVIDENCE_AUTHORITY_INSTRUCTIONS)}
2960
- - Lane classification:
2961
- ${renderReadOnlyLaneClassificationRuleBlock(config)}
2962
-
2963
- Do not:
2964
- - must not edit files
2965
- - must not create truth docs
2966
- - must not update routing
2967
- - must not run Truth Sync automatically
2968
- - must not replace Truth Check
2969
- - must not claim final correctness
2970
- - must not issue write leases
2971
- - must not mutate code
2972
-
2973
- Suggested subagent use:
2974
- - optional read-only verifier: truth_route_auditor
2975
- - write workers: none
2976
- - leases needed: none
2977
-
2978
- ${renderHierarchySummary(config)}`;
2979
- };
2980
-
2981
2834
  // src/agents/truthmark-portal.ts
2982
- var TRUTHMARK_PORTAL_EXPLICIT_INVOCATIONS = "OpenCode /skill truthmark-portal; Codex /truthmark-portal or $truthmark-portal; Claude Code /truthmark-portal; GitHub Copilot /truthmark-portal; Gemini CLI /truthmark:portal.";
2983
2835
  var renderTruthmarkPortalProcedureBody = (config = defaultAgentConfig()) => {
2984
2836
  const output = config.truthmark.paths.portalOutput;
2985
2837
  const template = config.truthmark.paths.portalTemplate;
@@ -2987,8 +2839,6 @@ var renderTruthmarkPortalProcedureBody = (config = defaultAgentConfig()) => {
2987
2839
 
2988
2840
  Truthmark Portal is a manual-only presentation workflow. It is never an automatic completion workflow, never Truth Sync, and runs only when the user explicitly asks to generate, refresh, or update the committed static HTML Portal.
2989
2841
 
2990
- Invocations: ${TRUTHMARK_PORTAL_EXPLICIT_INVOCATIONS}
2991
-
2992
2842
  Core rules:
2993
2843
 
2994
2844
  - Markdown remains canonical; generated HTML is presentation only.
@@ -3018,7 +2868,6 @@ ${renderHierarchySummary(config)}`;
3018
2868
  };
3019
2869
 
3020
2870
  // src/agents/truth-structure.ts
3021
- var TRUTH_STRUCTURE_EXPLICIT_INVOCATIONS = "OpenCode /skill truthmark-structure; Codex /truthmark-structure or $truthmark-structure; Claude Code /truthmark-structure; GitHub Copilot /truthmark-structure; Gemini CLI /truthmark:structure.";
3022
2871
  var renderTruthStructureReportExample = (config = defaultAgentConfig()) => {
3023
2872
  const productTruthRoot = resolveProductTruthRoot(config);
3024
2873
  const engineeringTruthRoot = resolveEngineeringTruthRoot(config);
@@ -3073,7 +2922,7 @@ var renderTruthStructureProcedureBody = (config = defaultAgentConfig(), options
3073
2922
  ` : "";
3074
2923
  const subagentMode = `${claudeSubagentMode}${copilotCustomAgentMode}`;
3075
2924
  return `Use this skill to design or repair Truthmark area structure.
3076
- Invocations: ${TRUTH_STRUCTURE_EXPLICIT_INVOCATIONS}
2925
+
3077
2926
  Truth Structure is agent-native:
3078
2927
  - inspect repository layout, current docs, Truthmark config and route files when present, and relevant code directly
3079
2928
  - Evidence authority:
@@ -3329,7 +3178,6 @@ var renderTruthSyncBlockedReport = (input) => {
3329
3178
  };
3330
3179
 
3331
3180
  // src/agents/truth-sync.ts
3332
- var TRUTH_SYNC_EXPLICIT_INVOCATIONS = "OpenCode /skill truthmark-sync; Codex /truthmark-sync or $truthmark-sync; Claude Code /truthmark-sync; GitHub Copilot /truthmark-sync; Gemini CLI /truthmark:sync.";
3333
3181
  var renderTruthSyncProductDecisionRuleBlock = (config) => {
3334
3182
  return renderBulletBlock(
3335
3183
  [
@@ -3369,8 +3217,7 @@ var renderTruthSyncProcedureBody = (config = defaultAgentConfig(), options = {})
3369
3217
  ` : "";
3370
3218
  const subagentMode = `${claudeSubagentMode}${codexSubagentMode}${copilotCustomAgentMode}${openCodeSubagentMode}`;
3371
3219
  return `Use this skill automatically before finishing when functional code changed since the last successful Truth Sync. Also run it immediately when the user explicitly invokes Truth Sync.
3372
- Invocations: ${TRUTH_SYNC_EXPLICIT_INVOCATIONS}
3373
- Explicit invocation runs immediately. Later functional-code changes need a fresh finish-time review, and an earlier explicit run satisfies the finish-time review only if no later functional-code changes occur.
3220
+ Explicit invocation runs immediately when the user directly requests this workflow. Later functional-code changes need a fresh finish-time review, and an earlier explicit run satisfies the finish-time review only if no later functional-code changes occur.
3374
3221
  Skip when changes are documentation-only, formatting-only, clearly behavior-preserving renames with no truth impact, when no Truthmark config exists yet, or when there are no functional code changes.
3375
3222
  Parent workflow:
3376
3223
  1. Inspect git status, staged changes, unstaged changes, and untracked files directly.
@@ -3394,6 +3241,7 @@ ${renderTruthSyncProductDecisionRuleBlock(config)}
3394
3241
  - No-update-needed rationale: why mapped truth is already current when no truth doc should change
3395
3242
  - Blockers: missing routing, ambiguous ownership, failed verification, unavailable evidence, or off-boundary write needs
3396
3243
  11. Only edit allowed truth docs/routes after Sync Intent is clear; if ownership is ambiguous, repair topology first when the repair is safe and in scope, otherwise stop and recommend Truth Structure instead of guessing.
3244
+ ${TRUTH_DOC_AUTHORING_STYLE_INSTRUCTIONS}
3397
3245
  ${subagentMode}Topology review and repair:
3398
3246
  - before updating truth docs, verify the changed code resolves to a specific behavior-owned area and bounded truth owner
3399
3247
  - if routing is missing, stale, broad, overloaded, catch-all route only, or cannot map changed code to a bounded truth owner, run Truth Structure before syncing when topology repair is safe and in scope
@@ -3462,37 +3310,28 @@ var TRUTHMARK_CLAUDE_ROUTE_AUDITOR_AGENT_PATH = ".claude/agents/truth-route-audi
3462
3310
  var TRUTHMARK_CLAUDE_CLAIM_VERIFIER_AGENT_PATH = ".claude/agents/truth-claim-verifier.md";
3463
3311
  var TRUTHMARK_CLAUDE_DOC_REVIEWER_AGENT_PATH = ".claude/agents/truth-doc-reviewer.md";
3464
3312
  var TRUTHMARK_CLAUDE_DOC_WRITER_AGENT_PATH = ".claude/agents/truth-doc-writer.md";
3465
- var TRUTHMARK_GEMINI_STRUCTURE_COMMAND_PATH = ".gemini/commands/truthmark/structure.toml";
3466
- var TRUTHMARK_GEMINI_DOCUMENT_COMMAND_PATH = ".gemini/commands/truthmark/document.toml";
3467
- var TRUTHMARK_GEMINI_SYNC_COMMAND_PATH = ".gemini/commands/truthmark/sync.toml";
3468
- var TRUTHMARK_GEMINI_REALIZE_COMMAND_PATH = ".gemini/commands/truthmark/realize.toml";
3469
- var TRUTHMARK_GEMINI_CHECK_COMMAND_PATH = ".gemini/commands/truthmark/check.toml";
3470
- var TRUTHMARK_GEMINI_PREVIEW_COMMAND_PATH = ".gemini/commands/truthmark/preview.toml";
3471
- var TRUTHMARK_GEMINI_PORTAL_COMMAND_PATH = ".gemini/commands/truthmark/portal.toml";
3472
- var TRUTHMARK_GEMINI_ROUTE_AUDITOR_AGENT_PATH = ".gemini/agents/truth-route-auditor.md";
3473
- var TRUTHMARK_GEMINI_CLAIM_VERIFIER_AGENT_PATH = ".gemini/agents/truth-claim-verifier.md";
3474
- var TRUTHMARK_GEMINI_DOC_REVIEWER_AGENT_PATH = ".gemini/agents/truth-doc-reviewer.md";
3475
- var TRUTHMARK_GEMINI_DOC_WRITER_AGENT_PATH = ".gemini/agents/truth-doc-writer.md";
3313
+ var TRUTHMARK_ANTIGRAVITY_STRUCTURE_RULE_PATH = ".antigravity/rules/truthmark-structure.md";
3314
+ var TRUTHMARK_ANTIGRAVITY_DOCUMENT_RULE_PATH = ".antigravity/rules/truthmark-document.md";
3315
+ var TRUTHMARK_ANTIGRAVITY_SYNC_RULE_PATH = ".antigravity/rules/truthmark-sync.md";
3316
+ var TRUTHMARK_ANTIGRAVITY_REALIZE_RULE_PATH = ".antigravity/rules/truthmark-realize.md";
3317
+ var TRUTHMARK_ANTIGRAVITY_CHECK_RULE_PATH = ".antigravity/rules/truthmark-check.md";
3318
+ var TRUTHMARK_ANTIGRAVITY_PORTAL_RULE_PATH = ".antigravity/rules/truthmark-portal.md";
3319
+ var TRUTHMARK_CURSOR_STRUCTURE_SKILL_PATH = ".cursor/skills/truthmark-structure/SKILL.md";
3320
+ var TRUTHMARK_CURSOR_DOCUMENT_SKILL_PATH = ".cursor/skills/truthmark-document/SKILL.md";
3321
+ var TRUTHMARK_CURSOR_SYNC_SKILL_PATH = ".cursor/skills/truthmark-sync/SKILL.md";
3322
+ var TRUTHMARK_CURSOR_REALIZE_SKILL_PATH = ".cursor/skills/truthmark-realize/SKILL.md";
3323
+ var TRUTHMARK_CURSOR_CHECK_SKILL_PATH = ".cursor/skills/truthmark-check/SKILL.md";
3324
+ var TRUTHMARK_CURSOR_PORTAL_SKILL_PATH = ".cursor/skills/truthmark-portal/SKILL.md";
3476
3325
  var TRUTHMARK_COPILOT_STRUCTURE_PROMPT_PATH = ".github/prompts/truthmark-structure.prompt.md";
3477
3326
  var TRUTHMARK_COPILOT_DOCUMENT_PROMPT_PATH = ".github/prompts/truthmark-document.prompt.md";
3478
3327
  var TRUTHMARK_COPILOT_SYNC_PROMPT_PATH = ".github/prompts/truthmark-sync.prompt.md";
3479
3328
  var TRUTHMARK_COPILOT_REALIZE_PROMPT_PATH = ".github/prompts/truthmark-realize.prompt.md";
3480
3329
  var TRUTHMARK_COPILOT_CHECK_PROMPT_PATH = ".github/prompts/truthmark-check.prompt.md";
3481
- var TRUTHMARK_COPILOT_PREVIEW_PROMPT_PATH = ".github/prompts/truthmark-preview.prompt.md";
3482
3330
  var TRUTHMARK_COPILOT_PORTAL_PROMPT_PATH = ".github/prompts/truthmark-portal.prompt.md";
3483
3331
  var TRUTHMARK_COPILOT_ROUTE_AUDITOR_AGENT_PATH = ".github/agents/truth-route-auditor.md";
3484
3332
  var TRUTHMARK_COPILOT_CLAIM_VERIFIER_AGENT_PATH = ".github/agents/truth-claim-verifier.md";
3485
3333
  var TRUTHMARK_COPILOT_DOC_REVIEWER_AGENT_PATH = ".github/agents/truth-doc-reviewer.md";
3486
3334
  var TRUTHMARK_COPILOT_DOC_WRITER_AGENT_PATH = ".github/agents/truth-doc-writer.md";
3487
- var renderGeminiCommand = (description, prompt) => {
3488
- const promptWithArgs = `${prompt.trimEnd()}
3489
- User focus or arguments: {{args}}`;
3490
- return `description = "${description}"
3491
- prompt = '''
3492
- ${promptWithArgs}
3493
- '''
3494
- `;
3495
- };
3496
3335
  var renderCopilotPromptFile = (description, prompt) => {
3497
3336
  return `---
3498
3337
  agent: 'agent'
@@ -3530,105 +3369,70 @@ var renderTomlString = (value) => {
3530
3369
  var renderTomlStringArray = (values) => {
3531
3370
  return `[${values.map(renderTomlString).join(", ")}]`;
3532
3371
  };
3533
- var TRUTH_REALIZE_EXPLICIT_INVOCATIONS = "OpenCode /skill truthmark-realize; Codex /truthmark-realize or $truthmark-realize; Claude Code /truthmark-realize; GitHub Copilot /truthmark-realize; Gemini CLI /truthmark:realize.";
3534
3372
  var routeFilesHint = (config) => `${config.truthmark.paths.routesIndex}; ${config.truthmark.paths.routeAreasRoot}/`;
3535
3373
  var WORKFLOW_PACKAGE_DEFINITIONS = {
3536
3374
  "truthmark-structure": {
3537
3375
  title: "Truthmark Structure",
3538
3376
  argumentHint: "Optional area, directory, or routing concern",
3539
- invocations: TRUTH_STRUCTURE_EXPLICIT_INVOCATIONS,
3540
3377
  use: () => "Use this skill to design or repair Truthmark area structure.",
3541
3378
  quickRules: (config) => [
3542
3379
  "Follow repository instruction files that exist in this checkout; do not assume any optional policy path exists.",
3543
3380
  `Inspect .truthmark/config.yml and configured route files (${routeFilesHint(config)}) only when they exist; then inspect current docs and relevant code directly.`,
3544
3381
  "Define areas by product or behavior ownership, not by mechanical directory mirroring.",
3545
- "Do not edit functional code.",
3546
- "Read support/procedure.md before writing route or starter truth-doc changes.",
3547
- "Read support/report-template.md before the final report."
3382
+ "Do not edit functional code."
3548
3383
  ],
3549
3384
  parentRule: "Parent agent owns all Truth Structure writes and final topology decisions"
3550
3385
  },
3551
3386
  "truthmark-document": {
3552
3387
  title: "Truthmark Document",
3553
3388
  argumentHint: "Optional implemented behavior, API endpoint, route, controller, package, or truth-doc area to document",
3554
- invocations: TRUTH_DOCUMENT_EXPLICIT_INVOCATIONS,
3555
3389
  use: () => "Use this skill to document existing implemented behavior when no functional-code changes are required for the task.",
3556
3390
  quickRules: (config) => [
3557
3391
  "Follow repository instruction files that exist in this checkout; do not assume any optional policy path exists.",
3558
3392
  `Inspect .truthmark/config.yml and configured route files (${routeFilesHint(config)}) only when they exist; then inspect existing canonical docs, implementation code, and tests directly.`,
3559
3393
  "Document current implemented behavior; do not invent future behavior.",
3560
- "May write canonical truth docs and truth routing files only; must not write functional code.",
3561
- "Read support/procedure.md before editing truth docs.",
3562
- "Read support/subagents-and-leases.md only when dispatching or accepting worker output.",
3563
- "Read support/report-template.md before the final report."
3394
+ "May write canonical truth docs and truth routing files only; must not write functional code."
3564
3395
  ],
3565
3396
  parentRule: "Parent agent owns Truth Document acceptance, lease validation, and final report"
3566
3397
  },
3567
3398
  "truthmark-sync": {
3568
3399
  title: "Truthmark Sync",
3569
3400
  argumentHint: "Optional changed-code area, truth-doc area, or sync focus",
3570
- invocations: TRUTH_SYNC_EXPLICIT_INVOCATIONS,
3571
3401
  use: () => "Use this skill automatically before finishing when functional code changed since the last successful Truth Sync. Also run it immediately when the user explicitly invokes Truth Sync.",
3572
3402
  quickRules: (config) => [
3573
3403
  "Follow repository instruction files that exist in this checkout; do not assume any optional policy path exists.",
3574
3404
  "Skip docs-only, formatting-only, behavior-preserving renames with no truth impact, missing config, and no-code changes.",
3575
3405
  `Inspect .truthmark/config.yml and configured route files (${routeFilesHint(config)}) only when they exist; then inspect relevant canonical docs directly.`,
3576
3406
  "direct checkout inspection is the canonical path; do not require the truthmark binary.",
3577
- "May write canonical truth docs and truth routing files only; must not rewrite functional code.",
3578
- "Read support/procedure.md before editing truth docs.",
3579
- "Read support/subagents-and-leases.md only when dispatching or accepting worker output.",
3580
- "Read support/report-template.md before the final report."
3407
+ "May write canonical truth docs and truth routing files only; must not rewrite functional code."
3581
3408
  ],
3582
3409
  parentRule: "Parent agent owns Truth Sync acceptance, lease validation, and final report"
3583
3410
  },
3584
- "truthmark-preview": {
3585
- title: "Truthmark Preview",
3586
- argumentHint: "Optional requested outcome, code area, doc path, or routing question",
3587
- invocations: TRUTH_PREVIEW_EXPLICIT_INVOCATIONS.copilot,
3588
- use: () => "Use this skill only when the user explicitly asks to preview Truthmark routing or workflow choice before edits.",
3589
- quickRules: (config) => [
3590
- "Follow repository instruction files that exist in this checkout; do not assume any optional policy path exists.",
3591
- `Inspect .truthmark/config.yml and the root route index (${config.truthmark.paths.routesIndex}) first when present; then inspect only child route files under ${config.truthmark.paths.routeAreasRoot}/ that are relevant to the selected scope or changed paths, plus the truth docs or implementation files needed to preview ownership.`,
3592
- "Truth Preview is read-only; this report is intended, not authorized.",
3593
- "must not edit files and must not issue write leases; do not run Truth Sync automatically, replace Truth Check, claim final correctness, or mutate code.",
3594
- "Use optional read-only route-auditor evidence only when it reduces context or clarifies ownership.",
3595
- "Hand off to the selected workflow after user approval."
3596
- ],
3597
- parentRule: "Parent agent owns the final Truth Preview report"
3598
- },
3599
3411
  "truthmark-realize": {
3600
3412
  title: "Truthmark Realize",
3601
3413
  argumentHint: "Optional truth doc path, area, or desired code behavior to realize",
3602
- invocations: TRUTH_REALIZE_EXPLICIT_INVOCATIONS,
3603
3414
  use: () => "Use this skill only when the user explicitly asks to realize truth docs into code.",
3604
3415
  quickRules: (config) => [
3605
3416
  "Follow repository instruction files that exist in this checkout; do not assume any optional policy path exists.",
3606
3417
  `Read the source truth docs, inspect .truthmark/config.yml and configured route files (${routeFilesHint(config)}) only when they exist, then inspect tests and relevant functional code directly.`,
3607
3418
  "Truth docs lead; code follows.",
3608
- "may write functional code only; must not edit truth docs or truth routing while realizing those docs.",
3609
- "Read support/procedure.md before changing code.",
3610
- "Read support/report-template.md before the final report."
3419
+ "may write functional code only; must not edit truth docs or truth routing while realizing those docs."
3611
3420
  ]
3612
3421
  },
3613
3422
  "truthmark-check": {
3614
3423
  title: "Truthmark Check",
3615
3424
  argumentHint: "Optional area, doc path, or audit focus",
3616
- invocations: TRUTH_CHECK_EXPLICIT_INVOCATIONS,
3617
3425
  use: () => "Use this skill to audit repository truth health.",
3618
3426
  quickRules: (config) => [
3619
3427
  "Follow repository instruction files that exist in this checkout; do not assume any optional policy path exists.",
3620
3428
  `Inspect .truthmark/config.yml and configured route files (${routeFilesHint(config)}) only when they exist; then inspect canonical docs and relevant implementation directly.`,
3621
- "Report issues and suggested fixes; do not silently rewrite unrelated files.",
3622
- "Read support/procedure.md before auditing details.",
3623
- "Read support/subagents-and-leases.md only when dispatching verifier subagents.",
3624
- "Read support/report-template.md before the final report."
3429
+ "Report issues and suggested fixes; do not silently rewrite unrelated files."
3625
3430
  ],
3626
3431
  parentRule: "Parent agent owns the final Truth Check report"
3627
3432
  },
3628
3433
  "truthmark-portal": {
3629
3434
  title: "Truthmark Portal",
3630
3435
  argumentHint: "Optional portal generation focus",
3631
- invocations: TRUTHMARK_PORTAL_EXPLICIT_INVOCATIONS,
3632
3436
  use: () => "Use this skill only when the user explicitly asks to generate or refresh the committed static HTML Truthmark Portal.",
3633
3437
  quickRules: (config) => [
3634
3438
  "Follow repository instruction files that exist in this checkout; do not assume any optional policy path exists.",
@@ -3638,9 +3442,7 @@ var WORKFLOW_PACKAGE_DEFINITIONS = {
3638
3442
  "Generate committed, generated non-canonical static files for humans.",
3639
3443
  `Write only under fixed Portal output ${config.truthmark.paths.portalOutput}.`,
3640
3444
  `Use determined Portal template ${config.truthmark.paths.portalTemplate} when present; no .truthmark/index.json dependency.`,
3641
- "Use no remote dependencies by default and include source provenance on every page.",
3642
- "Read support/procedure.md before generating Portal output.",
3643
- "Read support/report-template.md before the final report."
3445
+ "Use no remote dependencies by default and include source provenance on every page."
3644
3446
  ]
3645
3447
  }
3646
3448
  };
@@ -3668,14 +3470,14 @@ ${renderMarkdownExample(
3668
3470
  changedCode: ["src/auth/session.ts"],
3669
3471
  syncIntent: {
3670
3472
  changedCodeReviewed: ["src/auth/session.ts"],
3671
- affectedRouteOrTruthOwner: [config.truthmark.paths.routesIndex],
3672
- targetTruthDocs: [
3673
- `${engineeringTruthRoot}/repository/bootstrap-routing.md`
3473
+ affectedRouteOrTruthOwner: [
3474
+ `${config.truthmark.paths.routeAreasRoot}/authentication.md`
3674
3475
  ],
3476
+ targetTruthDocs: [`${engineeringTruthRoot}/behaviors/session-timeout.md`],
3675
3477
  intendedUpdate: ["Update session timeout behavior."],
3676
3478
  evidenceToVerify: [
3677
3479
  "src/auth/session.ts:12",
3678
- `${config.truthmark.paths.routesIndex}:11`
3480
+ `${config.truthmark.paths.routeAreasRoot}/authentication.md:11`
3679
3481
  ],
3680
3482
  userProvidedDecisionRationale: [
3681
3483
  "User rationale: session timeout behavior changed for internal implementation consistency"
@@ -3683,22 +3485,22 @@ ${renderMarkdownExample(
3683
3485
  noUpdateNeededRationale: ["not applicable; mapped truth is stale"],
3684
3486
  blockers: ["none"]
3685
3487
  },
3686
- ownershipReviewed: [config.truthmark.paths.routesIndex],
3687
- truthDocsUpdated: [
3688
- `${engineeringTruthRoot}/repository/bootstrap-routing.md`
3488
+ ownershipReviewed: [
3489
+ `${config.truthmark.paths.routeAreasRoot}/authentication.md`
3689
3490
  ],
3491
+ truthDocsUpdated: [`${engineeringTruthRoot}/behaviors/session-timeout.md`],
3690
3492
  evidenceChecked: [
3691
3493
  {
3692
- claim: "Session timeout behavior is documented in the mapped repository truth doc.",
3494
+ claim: "Session timeout behavior is documented in the bounded authentication behavior truth doc.",
3693
3495
  evidence: [
3694
3496
  "src/auth/session.ts:12",
3695
- `${config.truthmark.paths.routesIndex}:11`
3497
+ `${config.truthmark.paths.routeAreasRoot}/authentication.md:11`
3696
3498
  ],
3697
3499
  result: "supported"
3698
3500
  }
3699
3501
  ],
3700
3502
  decisionRationaleCaptured: [
3701
- "Placed user rationale in the mapped engineering truth doc under Engineering Decisions/Rationale."
3503
+ "Placed user rationale in the bounded authentication behavior truth doc under Engineering Decisions/Rationale."
3702
3504
  ],
3703
3505
  notes: ["Updated session timeout behavior."]
3704
3506
  })
@@ -3706,16 +3508,14 @@ ${renderMarkdownExample(
3706
3508
  Blocked report example:
3707
3509
  ${renderMarkdownExample(
3708
3510
  renderTruthSyncBlockedReport({
3709
- reason: "routing repair is not allowed",
3710
- manualReviewFiles: [config.truthmark.paths.routesIndex],
3711
- nextAction: "update routing metadata and rerun Truth Sync"
3511
+ reason: "Changed code maps only to the provisional bootstrap route.",
3512
+ manualReviewFiles: [
3513
+ "src/auth/**",
3514
+ `${config.truthmark.paths.routeAreasRoot}/${config.truthmark.routes.defaultArea}.md`
3515
+ ],
3516
+ nextAction: "Run Truth Structure for src/auth/** before updating behavior truth."
3712
3517
  })
3713
3518
  )}`;
3714
- case "truthmark-preview":
3715
- return `Report completion in this shape:
3716
- ${renderMarkdownExample(
3717
- renderTruthPreviewReportExample(config)
3718
- )}`;
3719
3519
  case "truthmark-realize":
3720
3520
  return `Report completion in this shape:
3721
3521
 
@@ -3785,8 +3585,6 @@ var renderWorkflowProcedure = (workflowId, config) => {
3785
3585
  return renderTruthDocumentProcedureBody(config);
3786
3586
  case "truthmark-sync":
3787
3587
  return renderTruthSyncProcedureBody(config);
3788
- case "truthmark-preview":
3789
- return renderTruthPreviewProcedureBody(config);
3790
3588
  case "truthmark-realize":
3791
3589
  return renderTruthmarkRealizeProcedureBody(config);
3792
3590
  case "truthmark-check":
@@ -3811,7 +3609,7 @@ var renderWorkflowEntrypoint = (workflowId, config, supportFiles, host) => {
3811
3609
  return "available when relevant to the current step";
3812
3610
  };
3813
3611
  const supportFileList = supportFiles.map((supportFile) => `- ${supportFile} \u2014 ${supportFileUsage(supportFile)}`).join("\n");
3814
- const hostUsage = host === "github-copilot" ? "Use as a Copilot agent skill. Prompt files remain available under `.github/prompts/` for command-style invocation in supported Copilot IDEs." : host === "gemini-cli" ? "Use as a Gemini CLI Agent Skill; commands remain available under `/truthmark:*` for command-first invocation." : void 0;
3612
+ const hostUsage = host === "github-copilot" ? "Use as a Copilot agent skill. Prompt files remain available under `.github/prompts/` for command-style invocation in supported Copilot IDEs." : host === "cursor" ? "Use as a Cursor Agent Skill. Cursor discovers project skills under `.cursor/skills/`, selects them from the description when relevant, and supports manual `/` invocation." : void 0;
3815
3613
  return `---
3816
3614
  name: ${workflowId}
3817
3615
  description: ${workflow.description}
@@ -3825,8 +3623,6 @@ ${definition.use(config)}${hostUsage === void 0 ? "" : `
3825
3623
 
3826
3624
  ${hostUsage}`}
3827
3625
 
3828
- Invocations: ${definition.invocations}
3829
-
3830
3626
  Quick procedure:
3831
3627
  ${definition.quickRules(config).map((rule) => `- ${rule}`).join("\n")}
3832
3628
 
@@ -3870,12 +3666,8 @@ var renderWorkflowSubagentSupport = (workflowId, host) => {
3870
3666
  definition.parentRule,
3871
3667
  writeAgents
3872
3668
  );
3873
- case "gemini-cli":
3874
- return renderGeminiSubagentModeSection(
3875
- readAgents,
3876
- definition.parentRule,
3877
- writeAgents
3878
- );
3669
+ case "cursor":
3670
+ return void 0;
3879
3671
  }
3880
3672
  };
3881
3673
  var renderTruthmarkSkillPackage = ({
@@ -3891,7 +3683,11 @@ var renderTruthmarkSkillPackage = ({
3891
3683
  config
3892
3684
  );
3893
3685
  const subagents = renderWorkflowSubagentSupport(workflowId, host);
3894
- const supportFiles = workflowSupportFiles(workflowId);
3686
+ const supportFiles = [
3687
+ "support/procedure.md",
3688
+ "support/report-template.md",
3689
+ ...subagents !== void 0 ? ["support/subagents-and-leases.md"] : []
3690
+ ];
3895
3691
  const definition = WORKFLOW_PACKAGE_DEFINITIONS[workflowId];
3896
3692
  const files = [
3897
3693
  {
@@ -3952,7 +3748,7 @@ var renderOpenCodeWriterEditAllowRules = (config) => {
3952
3748
  return [...new Set(allowedPatterns)].map((pattern) => ` ${JSON.stringify(pattern)}: allow`).join("\n");
3953
3749
  };
3954
3750
  var READ_ONLY_SUBAGENT_CONTEXT_BOUNDARY = `Context boundary:
3955
- Do not preload AGENTS.md, CLAUDE.md, GEMINI.md, .github/copilot-instructions.md, or repo-wide policy docs unless the parent explicitly assigns them as evidence.
3751
+ Do not preload AGENTS.md, CLAUDE.md, .github/copilot-instructions.md, .cursor/skills, .antigravity/rules, or repo-wide policy docs unless the parent explicitly assigns them as evidence.
3956
3752
  Use only the parent-assigned shard plus required checkout evidence files.
3957
3753
  Return findings only; the parent workflow owns repository-policy interpretation, final decisions, and all writes.`;
3958
3754
  var renderReadOnlySubagentInstructions = (instructions) => {
@@ -4087,45 +3883,6 @@ tools: [read, search, edit]
4087
3883
 
4088
3884
  # Truthmark-managed generated file. Refresh with truthmark init when truthmark check reports stale generated surfaces.
4089
3885
 
4090
- ${instructions}
4091
- `;
4092
- };
4093
- var renderGeminiReadOnlyAgent = ({
4094
- copilotName,
4095
- description,
4096
- instructions
4097
- }) => {
4098
- const agentInstructions = renderReadOnlySubagentInstructions(instructions);
4099
- return `---
4100
- name: ${copilotName}
4101
- description: ${description}
4102
- kind: local
4103
- tools: [read_file, grep_search]
4104
- ---
4105
-
4106
- # Truthmark-managed generated file. Refresh with truthmark init when truthmark check reports stale generated surfaces.
4107
-
4108
- Manual invocation: @${copilotName}
4109
-
4110
- ${agentInstructions}
4111
- `;
4112
- };
4113
- var renderGeminiWriteAgent = ({
4114
- copilotName,
4115
- description,
4116
- instructions
4117
- }) => {
4118
- return `---
4119
- name: ${copilotName}
4120
- description: ${description}
4121
- kind: local
4122
- tools: [read_file, grep_search, write_file]
4123
- ---
4124
-
4125
- # Truthmark-managed generated file. Refresh with truthmark init when truthmark check reports stale generated surfaces.
4126
-
4127
- Manual invocation: @${copilotName} with an explicit parent write lease.
4128
-
4129
3886
  ${instructions}
4130
3887
  `;
4131
3888
  };
@@ -4228,26 +3985,6 @@ var renderTruthmarkCopilotDocWriterAgent = () => {
4228
3985
  TRUTHMARK_WRITE_SUBAGENT_PROFILES.truth_doc_writer
4229
3986
  );
4230
3987
  };
4231
- var renderTruthmarkGeminiRouteAuditorAgent = () => {
4232
- return renderGeminiReadOnlyAgent(
4233
- TRUTHMARK_SUBAGENT_PROFILES.truth_route_auditor
4234
- );
4235
- };
4236
- var renderTruthmarkGeminiClaimVerifierAgent = () => {
4237
- return renderGeminiReadOnlyAgent(
4238
- TRUTHMARK_SUBAGENT_PROFILES.truth_claim_verifier
4239
- );
4240
- };
4241
- var renderTruthmarkGeminiDocReviewerAgent = () => {
4242
- return renderGeminiReadOnlyAgent(
4243
- TRUTHMARK_SUBAGENT_PROFILES.truth_doc_reviewer
4244
- );
4245
- };
4246
- var renderTruthmarkGeminiDocWriterAgent = () => {
4247
- return renderGeminiWriteAgent(
4248
- TRUTHMARK_WRITE_SUBAGENT_PROFILES.truth_doc_writer
4249
- );
4250
- };
4251
3988
  var renderTruthmarkClaudeRouteAuditorAgent = () => {
4252
3989
  return renderClaudeReadOnlyAgent(
4253
3990
  TRUTHMARK_SUBAGENT_PROFILES.truth_route_auditor
@@ -4414,8 +4151,6 @@ var renderTruthmarkRealizeProcedureBody = (config = defaultAgentConfig()) => {
4414
4151
 
4415
4152
  Use this skill only when the user explicitly asks to realize truth docs into code.
4416
4153
 
4417
- Invocations: OpenCode /skill truthmark-realize; Codex /truthmark-realize or $truthmark-realize; Claude Code /truthmark-realize; GitHub Copilot /truthmark-realize; Gemini CLI /truthmark:realize.
4418
-
4419
4154
  Truth Realize is doc-first:
4420
4155
 
4421
4156
  - truth docs lead
@@ -4485,17 +4220,41 @@ truthmark:
4485
4220
  refresh_command: "truthmark init"
4486
4221
  `;
4487
4222
  };
4488
- var renderGeminiWorkflowCommand = (workflowId, root) => {
4223
+ var renderWorkflowRuleFile = ({
4224
+ workflowId,
4225
+ hostName,
4226
+ ruleName,
4227
+ config = defaultAgentConfig()
4228
+ }) => {
4489
4229
  const workflow = getTruthmarkWorkflow(workflowId);
4490
- return renderGeminiCommand(
4491
- workflow.description,
4492
- renderWorkflowCommandAdapterInstructions(
4493
- workflowId,
4494
- root,
4495
- "Gemini CLI",
4496
- "command"
4497
- )
4230
+ const definition = WORKFLOW_PACKAGE_DEFINITIONS[workflowId];
4231
+ const { procedure, reportTemplate } = renderWorkflowSupportParts(
4232
+ workflowId,
4233
+ config
4498
4234
  );
4235
+ const body = `# ${definition.title}
4236
+
4237
+ Truthmark-managed generated file. Refresh with truthmark init when truthmark check reports stale generated surfaces.
4238
+
4239
+ This rule is the ${hostName} entrypoint for ${definition.title}.
4240
+
4241
+ Do not invoke another Truthmark command from here.
4242
+
4243
+ Manual invocation: @${ruleName}
4244
+
4245
+ If skill entrypoints are unavailable, use the host's direct evidence-first manual fallback procedure.
4246
+
4247
+ Description: ${workflow.description}
4248
+
4249
+ ## Procedure
4250
+
4251
+ ${procedure}
4252
+
4253
+ ## Report Template
4254
+
4255
+ ${reportTemplate}
4256
+ `;
4257
+ return body;
4499
4258
  };
4500
4259
  var renderCopilotWorkflowPrompt = (workflowId, root) => {
4501
4260
  const workflow = getTruthmarkWorkflow(workflowId);
@@ -4509,60 +4268,42 @@ var renderCopilotWorkflowPrompt = (workflowId, root) => {
4509
4268
  )
4510
4269
  );
4511
4270
  };
4512
- var renderTruthmarkGeminiStructureCommand = (config = defaultAgentConfig()) => {
4513
- void config;
4514
- return renderGeminiWorkflowCommand(
4515
- "truthmark-structure",
4516
- ".gemini/skills/truthmark-structure"
4517
- );
4518
- };
4519
- var renderTruthmarkGeminiDocumentCommand = (config = defaultAgentConfig()) => {
4520
- void config;
4521
- return renderGeminiWorkflowCommand(
4522
- "truthmark-document",
4523
- ".gemini/skills/truthmark-document"
4524
- );
4525
- };
4526
- var renderTruthmarkGeminiSyncCommand = (config = defaultAgentConfig()) => {
4527
- void config;
4528
- return renderGeminiWorkflowCommand(
4529
- "truthmark-sync",
4530
- ".gemini/skills/truthmark-sync"
4531
- );
4532
- };
4533
- var renderTruthmarkGeminiRealizeCommand = (config = defaultAgentConfig()) => {
4534
- void config;
4535
- return renderGeminiWorkflowCommand(
4536
- "truthmark-realize",
4537
- ".gemini/skills/truthmark-realize"
4538
- );
4539
- };
4540
- var renderTruthmarkGeminiCheckCommand = (config = defaultAgentConfig()) => {
4541
- void config;
4542
- return renderGeminiWorkflowCommand(
4543
- "truthmark-check",
4544
- ".gemini/skills/truthmark-check"
4545
- );
4546
- };
4547
- var renderTruthmarkGeminiPreviewCommand = (config = defaultAgentConfig()) => {
4548
- const workflow = getTruthmarkWorkflow("truthmark-preview");
4549
- return renderGeminiCommand(
4550
- workflow.description,
4551
- `This command is the Gemini CLI entrypoint for Truthmark Preview.
4552
-
4553
- Truth Preview is read-only and explicit. Do not invoke another Truthmark command from here.
4554
-
4555
- ${renderTruthPreviewProcedureBody(config, "gemini")}
4556
- ${renderTruthPreviewAdapterReportFields()}`
4557
- );
4558
- };
4559
- var renderTruthmarkGeminiPortalCommand = (config = defaultAgentConfig()) => {
4560
- void config;
4561
- return renderGeminiWorkflowCommand(
4562
- "truthmark-portal",
4563
- ".gemini/skills/truthmark-portal"
4564
- );
4565
- };
4271
+ var renderTruthmarkAntigravityStructureRule = (config = defaultAgentConfig()) => renderWorkflowRuleFile({
4272
+ workflowId: "truthmark-structure",
4273
+ hostName: "Antigravity",
4274
+ ruleName: "truthmark-structure",
4275
+ config
4276
+ });
4277
+ var renderTruthmarkAntigravityDocumentRule = (config = defaultAgentConfig()) => renderWorkflowRuleFile({
4278
+ workflowId: "truthmark-document",
4279
+ hostName: "Antigravity",
4280
+ ruleName: "truthmark-document",
4281
+ config
4282
+ });
4283
+ var renderTruthmarkAntigravitySyncRule = (config = defaultAgentConfig()) => renderWorkflowRuleFile({
4284
+ workflowId: "truthmark-sync",
4285
+ hostName: "Antigravity",
4286
+ ruleName: "truthmark-sync",
4287
+ config
4288
+ });
4289
+ var renderTruthmarkAntigravityRealizeRule = (config = defaultAgentConfig()) => renderWorkflowRuleFile({
4290
+ workflowId: "truthmark-realize",
4291
+ hostName: "Antigravity",
4292
+ ruleName: "truthmark-realize",
4293
+ config
4294
+ });
4295
+ var renderTruthmarkAntigravityCheckRule = (config = defaultAgentConfig()) => renderWorkflowRuleFile({
4296
+ workflowId: "truthmark-check",
4297
+ hostName: "Antigravity",
4298
+ ruleName: "truthmark-check",
4299
+ config
4300
+ });
4301
+ var renderTruthmarkAntigravityPortalRule = (config = defaultAgentConfig()) => renderWorkflowRuleFile({
4302
+ workflowId: "truthmark-portal",
4303
+ hostName: "Antigravity",
4304
+ ruleName: "truthmark-portal",
4305
+ config
4306
+ });
4566
4307
  var renderTruthmarkCopilotStructurePrompt = (config = defaultAgentConfig()) => {
4567
4308
  void config;
4568
4309
  return renderCopilotWorkflowPrompt(
@@ -4598,18 +4339,6 @@ var renderTruthmarkCopilotCheckPrompt = (config = defaultAgentConfig()) => {
4598
4339
  ".github/skills/truthmark-check"
4599
4340
  );
4600
4341
  };
4601
- var renderTruthmarkCopilotPreviewPrompt = (config = defaultAgentConfig()) => {
4602
- const workflow = getTruthmarkWorkflow("truthmark-preview");
4603
- return renderCopilotPromptFile(
4604
- workflow.description,
4605
- `This prompt is the GitHub Copilot entrypoint for Truthmark Preview.
4606
-
4607
- Truth Preview is read-only and explicit. Do not invoke another Truthmark command from here.
4608
-
4609
- ${renderTruthPreviewProcedureBody(config, "copilot")}
4610
- ${renderTruthPreviewAdapterReportFields()}`
4611
- );
4612
- };
4613
4342
  var renderTruthmarkCopilotPortalPrompt = (config = defaultAgentConfig()) => {
4614
4343
  void config;
4615
4344
  return renderCopilotWorkflowPrompt(
@@ -4872,10 +4601,6 @@ var copilotFiles = (config, block) => {
4872
4601
  path: TRUTHMARK_COPILOT_SYNC_PROMPT_PATH,
4873
4602
  content: renderTruthmarkCopilotSyncPrompt(config)
4874
4603
  },
4875
- {
4876
- path: TRUTHMARK_COPILOT_PREVIEW_PROMPT_PATH,
4877
- content: renderTruthmarkCopilotPreviewPrompt(config)
4878
- },
4879
4604
  {
4880
4605
  path: TRUTHMARK_COPILOT_CHECK_PROMPT_PATH,
4881
4606
  content: renderTruthmarkCopilotCheckPrompt(config)
@@ -4917,92 +4642,78 @@ var copilotFiles = (config, block) => {
4917
4642
  }
4918
4643
  return files;
4919
4644
  };
4920
- var geminiFiles = (config, block) => {
4645
+ var antigravityFiles = (config) => {
4646
+ const files = [
4647
+ {
4648
+ path: TRUTHMARK_ANTIGRAVITY_STRUCTURE_RULE_PATH,
4649
+ content: renderTruthmarkAntigravityStructureRule(config)
4650
+ },
4651
+ {
4652
+ path: TRUTHMARK_ANTIGRAVITY_DOCUMENT_RULE_PATH,
4653
+ content: renderTruthmarkAntigravityDocumentRule(config)
4654
+ },
4655
+ {
4656
+ path: TRUTHMARK_ANTIGRAVITY_SYNC_RULE_PATH,
4657
+ content: renderTruthmarkAntigravitySyncRule(config)
4658
+ },
4659
+ {
4660
+ path: TRUTHMARK_ANTIGRAVITY_CHECK_RULE_PATH,
4661
+ content: renderTruthmarkAntigravityCheckRule(config)
4662
+ },
4663
+ {
4664
+ path: TRUTHMARK_ANTIGRAVITY_REALIZE_RULE_PATH,
4665
+ content: renderTruthmarkAntigravityRealizeRule(config)
4666
+ }
4667
+ ];
4668
+ if (config.truthmark.generated.portal.enabled) {
4669
+ files.push({
4670
+ path: TRUTHMARK_ANTIGRAVITY_PORTAL_RULE_PATH,
4671
+ content: renderTruthmarkAntigravityPortalRule(config)
4672
+ });
4673
+ }
4674
+ return files;
4675
+ };
4676
+ var cursorFiles = (config) => {
4921
4677
  const files = [
4922
- ...instructionBlockFiles(["GEMINI.md"], block),
4923
4678
  ...renderTruthmarkSkillPackage({
4924
- skillPath: ".gemini/skills/truthmark-structure/SKILL.md",
4679
+ skillPath: TRUTHMARK_CURSOR_STRUCTURE_SKILL_PATH,
4925
4680
  workflowId: "truthmark-structure",
4926
- host: "gemini-cli",
4681
+ host: "cursor",
4927
4682
  config
4928
4683
  }),
4929
4684
  ...renderTruthmarkSkillPackage({
4930
- skillPath: ".gemini/skills/truthmark-document/SKILL.md",
4685
+ skillPath: TRUTHMARK_CURSOR_DOCUMENT_SKILL_PATH,
4931
4686
  workflowId: "truthmark-document",
4932
- host: "gemini-cli",
4687
+ host: "cursor",
4933
4688
  config
4934
4689
  }),
4935
4690
  ...renderTruthmarkSkillPackage({
4936
- skillPath: ".gemini/skills/truthmark-sync/SKILL.md",
4691
+ skillPath: TRUTHMARK_CURSOR_SYNC_SKILL_PATH,
4937
4692
  workflowId: "truthmark-sync",
4938
- host: "gemini-cli",
4693
+ host: "cursor",
4939
4694
  config
4940
4695
  }),
4941
4696
  ...renderTruthmarkSkillPackage({
4942
- skillPath: ".gemini/skills/truthmark-check/SKILL.md",
4697
+ skillPath: TRUTHMARK_CURSOR_CHECK_SKILL_PATH,
4943
4698
  workflowId: "truthmark-check",
4944
- host: "gemini-cli",
4699
+ host: "cursor",
4945
4700
  config
4946
4701
  }),
4947
4702
  ...renderTruthmarkSkillPackage({
4948
- skillPath: ".gemini/skills/truthmark-realize/SKILL.md",
4703
+ skillPath: TRUTHMARK_CURSOR_REALIZE_SKILL_PATH,
4949
4704
  workflowId: "truthmark-realize",
4950
- host: "gemini-cli",
4705
+ host: "cursor",
4951
4706
  config
4952
- }),
4953
- {
4954
- path: TRUTHMARK_GEMINI_STRUCTURE_COMMAND_PATH,
4955
- content: renderTruthmarkGeminiStructureCommand(config)
4956
- },
4957
- {
4958
- path: TRUTHMARK_GEMINI_DOCUMENT_COMMAND_PATH,
4959
- content: renderTruthmarkGeminiDocumentCommand(config)
4960
- },
4961
- {
4962
- path: TRUTHMARK_GEMINI_SYNC_COMMAND_PATH,
4963
- content: renderTruthmarkGeminiSyncCommand(config)
4964
- },
4965
- {
4966
- path: TRUTHMARK_GEMINI_PREVIEW_COMMAND_PATH,
4967
- content: renderTruthmarkGeminiPreviewCommand(config)
4968
- },
4969
- {
4970
- path: TRUTHMARK_GEMINI_CHECK_COMMAND_PATH,
4971
- content: renderTruthmarkGeminiCheckCommand(config)
4972
- },
4973
- {
4974
- path: TRUTHMARK_GEMINI_REALIZE_COMMAND_PATH,
4975
- content: renderTruthmarkGeminiRealizeCommand(config)
4976
- },
4977
- {
4978
- path: TRUTHMARK_GEMINI_ROUTE_AUDITOR_AGENT_PATH,
4979
- content: renderTruthmarkGeminiRouteAuditorAgent()
4980
- },
4981
- {
4982
- path: TRUTHMARK_GEMINI_CLAIM_VERIFIER_AGENT_PATH,
4983
- content: renderTruthmarkGeminiClaimVerifierAgent()
4984
- },
4985
- {
4986
- path: TRUTHMARK_GEMINI_DOC_REVIEWER_AGENT_PATH,
4987
- content: renderTruthmarkGeminiDocReviewerAgent()
4988
- },
4989
- {
4990
- path: TRUTHMARK_GEMINI_DOC_WRITER_AGENT_PATH,
4991
- content: renderTruthmarkGeminiDocWriterAgent()
4992
- }
4707
+ })
4993
4708
  ];
4994
4709
  if (config.truthmark.generated.portal.enabled) {
4995
4710
  files.push(
4996
4711
  ...renderTruthmarkSkillPackage({
4997
- skillPath: ".gemini/skills/truthmark-portal/SKILL.md",
4712
+ skillPath: TRUTHMARK_CURSOR_PORTAL_SKILL_PATH,
4998
4713
  workflowId: "truthmark-portal",
4999
- host: "gemini-cli",
4714
+ host: "cursor",
5000
4715
  config
5001
- }),
5002
- {
5003
- path: TRUTHMARK_GEMINI_PORTAL_COMMAND_PATH,
5004
- content: renderTruthmarkGeminiPortalCommand(config)
5005
- }
4716
+ })
5006
4717
  );
5007
4718
  }
5008
4719
  return files;
@@ -5024,8 +4735,10 @@ var filesForPlatform = (platform, config, block) => {
5024
4735
  return claudeFiles(config, block);
5025
4736
  case "github-copilot":
5026
4737
  return copilotFiles(config, block);
5027
- case "gemini-cli":
5028
- return geminiFiles(config, block);
4738
+ case "antigravity":
4739
+ return antigravityFiles(config);
4740
+ case "cursor":
4741
+ return cursorFiles(config);
5029
4742
  }
5030
4743
  };
5031
4744
  var renderGeneratedSurfaces = (config, block = renderAgentsBlock(config)) => {
@@ -5070,13 +4783,31 @@ var GENERATED_HOST_SKILL_ROOTS = [
5070
4783
  ".opencode/skills",
5071
4784
  ".claude/skills",
5072
4785
  ".github/skills",
5073
- ".gemini/skills"
4786
+ ".cursor/skills"
5074
4787
  ];
5075
4788
  var RETIRED_SKILL_HELPER_PATHS = [
5076
4789
  "helper-manifest.yml",
5077
4790
  "support/helper-policy.md"
5078
4791
  ];
5079
4792
  var RETIRED_PACKAGE_DIRECTORIES = ["truthmark-preview"];
4793
+ var RETIRED_GENERATED_SURFACE_PATHS = [
4794
+ "GEMINI.md",
4795
+ ".github/prompts/truthmark-preview.prompt.md",
4796
+ ".cursor/rules/truthmark-structure.mdc",
4797
+ ".cursor/rules/truthmark-document.mdc",
4798
+ ".cursor/rules/truthmark-sync.mdc",
4799
+ ".cursor/rules/truthmark-realize.mdc",
4800
+ ".cursor/rules/truthmark-check.mdc",
4801
+ ".cursor/rules/truthmark-portal.mdc"
4802
+ ];
4803
+ var RETIRED_GENERATED_SURFACE_ROOTS = [".gemini"];
4804
+ var isRetiredGeminiSurfacePath = (filePath) => filePath === "GEMINI.md" || filePath.startsWith(".gemini/");
4805
+ var obsoleteGeneratedSurfaceMessage = (surfacePath) => {
4806
+ if (isRetiredGeminiSurfacePath(surfacePath)) {
4807
+ return `Generated surface ${surfacePath} is obsolete; remove stale Gemini instructions manually if they are no longer wanted.`;
4808
+ }
4809
+ return `Generated surface ${surfacePath} is obsolete; rerun truthmark init.`;
4810
+ };
5080
4811
  var pathExists = async (absolutePath) => {
5081
4812
  try {
5082
4813
  await fs6.access(absolutePath);
@@ -5111,8 +4842,33 @@ var listDirectoryFiles = async (rootDir, packageRoot) => {
5111
4842
  }
5112
4843
  return files;
5113
4844
  };
5114
- var collectRetiredGeneratedSurfaces = async (rootDir, expectedSurfacePaths) => {
4845
+ var collectRetiredGeneratedSurfaces = async (rootDir, expectedSurfacePaths, options = {}) => {
5115
4846
  const legacyCandidates = /* @__PURE__ */ new Set();
4847
+ const includeGeminiSurfaces = options.includeGeminiSurfaces ?? true;
4848
+ for (const retiredPath of RETIRED_GENERATED_SURFACE_PATHS) {
4849
+ if (!includeGeminiSurfaces && isRetiredGeminiSurfacePath(retiredPath)) {
4850
+ continue;
4851
+ }
4852
+ const absoluteRetiredPath = resolveRepoPath(rootDir, retiredPath);
4853
+ if (await pathExists(absoluteRetiredPath) && !expectedSurfacePaths.has(retiredPath)) {
4854
+ legacyCandidates.add(retiredPath);
4855
+ }
4856
+ }
4857
+ for (const retiredRoot of RETIRED_GENERATED_SURFACE_ROOTS) {
4858
+ if (!includeGeminiSurfaces && isRetiredGeminiSurfacePath(`${retiredRoot}/`)) {
4859
+ continue;
4860
+ }
4861
+ const absoluteRetiredRoot = resolveRepoPath(rootDir, retiredRoot);
4862
+ if (!await pathExists(absoluteRetiredRoot)) {
4863
+ continue;
4864
+ }
4865
+ const retiredFiles = await listDirectoryFiles(rootDir, retiredRoot);
4866
+ for (const filePath of retiredFiles) {
4867
+ if (!expectedSurfacePaths.has(filePath)) {
4868
+ legacyCandidates.add(filePath);
4869
+ }
4870
+ }
4871
+ }
5116
4872
  for (const skillRoot of GENERATED_HOST_SKILL_ROOTS) {
5117
4873
  const absoluteSkillRoot = resolveRepoPath(rootDir, skillRoot);
5118
4874
  let skillPackages = [];
@@ -5187,14 +4943,16 @@ var checkGeneratedSurfaces = async (rootDir, config) => {
5187
4943
  diagnostics.push({
5188
4944
  category: "generated-surface",
5189
4945
  severity: "review",
5190
- message: `Generated surface ${surfacePath} is obsolete; rerun truthmark init.`,
4946
+ message: obsoleteGeneratedSurfaceMessage(surfacePath),
5191
4947
  file: surfacePath
5192
4948
  });
5193
4949
  }
5194
4950
  return diagnostics;
5195
4951
  };
5196
- var findRetiredGeneratedSurfaces = async (rootDir, expectedSurfacePaths) => {
5197
- return collectRetiredGeneratedSurfaces(rootDir, expectedSurfacePaths);
4952
+ var findAutoRemovableRetiredGeneratedSurfaces = async (rootDir, expectedSurfacePaths) => {
4953
+ return collectRetiredGeneratedSurfaces(rootDir, expectedSurfacePaths, {
4954
+ includeGeminiSurfaces: false
4955
+ });
5198
4956
  };
5199
4957
 
5200
4958
  // src/init/init.ts
@@ -5305,21 +5063,15 @@ var diagnosticCategoryForPath = (filePath, config) => {
5305
5063
  if (filePath === "AGENTS.md") {
5306
5064
  return "truth-sync";
5307
5065
  }
5308
- if (filePath === ".github/prompts/truthmark-realize.prompt.md" || filePath.startsWith(".github/skills/truthmark-realize/") || filePath.startsWith(".claude/skills/truthmark-realize/") || filePath.startsWith(".opencode/skills/truthmark-realize/") || filePath.startsWith(".agents/skills/truthmark-realize/") || filePath.startsWith(".gemini/skills/truthmark-realize/")) {
5066
+ if (filePath === ".github/prompts/truthmark-realize.prompt.md" || filePath.startsWith(".github/skills/truthmark-realize/") || filePath.startsWith(".claude/skills/truthmark-realize/") || filePath.startsWith(".opencode/skills/truthmark-realize/") || filePath.startsWith(".agents/skills/truthmark-realize/") || filePath.startsWith(".antigravity/rules/truthmark-realize") || filePath.startsWith(".cursor/rules/truthmark-realize") || filePath.startsWith(".cursor/skills/truthmark-realize/")) {
5309
5067
  return "realization";
5310
5068
  }
5311
- if (filePath === "CLAUDE.md" || filePath === "GEMINI.md" || filePath === ".github/copilot-instructions.md" || filePath.startsWith(".github/prompts/truthmark-") || filePath.startsWith(".github/agents/truth-") || filePath.startsWith(".github/skills/truthmark-") || filePath.startsWith(".claude/agents/truth-") || filePath.startsWith(".claude/skills/truthmark-") || filePath.startsWith(".opencode/skills/truthmark-") || filePath.startsWith(".opencode/agents/") || filePath.startsWith(".codex/agents/") || filePath.startsWith(".gemini/agents/truth-") || filePath.startsWith(".gemini/skills/truthmark-")) {
5069
+ if (filePath === "CLAUDE.md" || filePath === ".github/copilot-instructions.md" || filePath.startsWith(".github/prompts/truthmark-") || filePath.startsWith(".github/agents/truth-") || filePath.startsWith(".github/skills/truthmark-") || filePath.startsWith(".claude/agents/truth-") || filePath.startsWith(".claude/skills/truthmark-") || filePath.startsWith(".opencode/skills/truthmark-") || filePath.startsWith(".opencode/agents/") || filePath.startsWith(".codex/agents/") || filePath.startsWith(".antigravity/rules/truthmark-") || filePath.startsWith(".cursor/rules/truthmark-") || filePath.startsWith(".cursor/skills/truthmark-")) {
5312
5070
  return "truth-sync";
5313
5071
  }
5314
5072
  if (filePath.startsWith(".agents/skills/truthmark-")) {
5315
5073
  return "truth-sync";
5316
5074
  }
5317
- if (filePath.startsWith(".gemini/commands/truthmark/realize")) {
5318
- return "realization";
5319
- }
5320
- if (filePath.startsWith(".gemini/commands/truthmark/")) {
5321
- return "truth-sync";
5322
- }
5323
5075
  if (filePath === config.truthmark.paths.routesIndex) {
5324
5076
  return "area-index";
5325
5077
  }
@@ -5376,7 +5128,7 @@ var runInit = async (cwd) => {
5376
5128
  for (const file of platformFiles) {
5377
5129
  results.push(await writePlatformFile(rootDir, file));
5378
5130
  }
5379
- const obsoleteSurfacePaths = await findRetiredGeneratedSurfaces(
5131
+ const obsoleteSurfacePaths = await findAutoRemovableRetiredGeneratedSurfaces(
5380
5132
  rootDir,
5381
5133
  expectedSurfacePaths
5382
5134
  );
@@ -6162,7 +5914,7 @@ var classifyPath = (filePath, ignorePatterns) => {
6162
5914
  if (normalizedPath.startsWith(".truthmark/")) {
6163
5915
  return "derived";
6164
5916
  }
6165
- if (normalizedPath.startsWith(".agents/skills/truthmark-") || normalizedPath.startsWith(".claude/") || normalizedPath.startsWith(".codex/") || normalizedPath.startsWith(".gemini/agents/truth-") || normalizedPath.startsWith(".gemini/commands/") || normalizedPath.startsWith(".gemini/skills/truthmark-") || normalizedPath.startsWith(".opencode/") || normalizedPath === ".github/copilot-instructions.md" || normalizedPath.startsWith(".github/agents/truth-") || normalizedPath.startsWith(".github/prompts/truthmark-") || normalizedPath.startsWith(".github/skills/truthmark-") || normalizedPath === "AGENTS.md" || normalizedPath === "CLAUDE.md" || normalizedPath === "GEMINI.md" || normalizedPath.startsWith(".gemini/commands/truthmark/")) {
5917
+ if (normalizedPath.startsWith(".agents/skills/truthmark-") || normalizedPath.startsWith(".claude/") || normalizedPath.startsWith(".codex/") || normalizedPath.startsWith(".opencode/") || normalizedPath.startsWith(".antigravity/rules/truthmark-") || normalizedPath.startsWith(".cursor/rules/truthmark-") || normalizedPath.startsWith(".cursor/skills/truthmark-") || normalizedPath === ".github/copilot-instructions.md" || normalizedPath.startsWith(".github/agents/truth-") || normalizedPath.startsWith(".github/prompts/truthmark-") || normalizedPath.startsWith(".github/skills/truthmark-") || normalizedPath === "AGENTS.md" || normalizedPath === "CLAUDE.md") {
6166
5918
  return "derived";
6167
5919
  }
6168
5920
  if (ignorePatterns.length > 0 && micromatch3.isMatch(normalizedPath, ignorePatterns)) {
@@ -7808,6 +7560,7 @@ var runCheck = async (cwd, options = {}) => {
7808
7560
 
7809
7561
  // src/workflow-state/build.ts
7810
7562
  import { execa as execa5 } from "execa";
7563
+ import micromatch8 from "micromatch";
7811
7564
 
7812
7565
  // src/workflow-state/action-context.ts
7813
7566
  var uniqueSorted3 = (values) => [...new Set(values.filter((value) => value.length > 0))].sort();
@@ -7841,7 +7594,7 @@ var baseContext = (manifestEntry, mode, allowedWritePaths, routeFiles, primaryTr
7841
7594
  writeLeaseRequired
7842
7595
  });
7843
7596
  var buildWorkflowActionContext = (manifestEntry, data = {}) => {
7844
- if (manifestEntry.id === "truthmark-preview" || manifestEntry.id === "truthmark-check") {
7597
+ if (manifestEntry.id === "truthmark-check") {
7845
7598
  return baseContext(manifestEntry, "read-only", [], [], [], [], [], false);
7846
7599
  }
7847
7600
  if (manifestEntry.id === "truthmark-sync" || manifestEntry.id === "truthmark-document") {
@@ -7917,7 +7670,7 @@ var helperCommandsFor2 = (workflow) => (TRUTHMARK_WORKFLOW_MANIFEST[workflow].he
7917
7670
  optional: helper.optional
7918
7671
  }));
7919
7672
  var uniqueSorted4 = (values) => [...new Set(values.filter((value) => value.length > 0))].sort();
7920
- var isWriteCapable = (workflow) => !["truthmark-preview", "truthmark-check"].includes(workflow);
7673
+ var isWriteCapable = (workflow) => workflow !== "truthmark-check";
7921
7674
  var DEFAULT_BASE_CANDIDATES = [
7922
7675
  "@{upstream}",
7923
7676
  "origin/main",
@@ -7945,9 +7698,67 @@ var selectComparisonBase = async (rootDir, suppliedBase) => {
7945
7698
  return null;
7946
7699
  };
7947
7700
  var routeFilesFor = (repoIndex) => uniqueSorted4(repoIndex.routeMap.routes.map((route) => route.sourcePath));
7948
- var candidateStaleTruthDocsFor = (indexedTruthDocs, primaryTruthDocs) => {
7701
+ var candidateStaleTruthDocsFor = (repoIndex, primaryTruthDocs, impactSet, diagnostics) => {
7702
+ const indexedTruthDocs = new Set(
7703
+ repoIndex.routeMap.routes.flatMap((route) => route.truthDocs)
7704
+ );
7949
7705
  const primary = new Set(primaryTruthDocs);
7950
- return indexedTruthDocs.filter((truthDoc) => !primary.has(truthDoc));
7706
+ const candidates = /* @__PURE__ */ new Set();
7707
+ const changedPaths = new Set(
7708
+ (impactSet?.changedFiles ?? []).flatMap((file) => [
7709
+ file.path,
7710
+ ...file.previousPath ? [file.previousPath] : []
7711
+ ])
7712
+ );
7713
+ const docEntries = new Map(
7714
+ repoIndex.routeMap.routes.flatMap((route) => route.truthDocumentEntries).map((entry) => [entry.path, entry])
7715
+ );
7716
+ const addCandidate = (truthDoc) => {
7717
+ if (indexedTruthDocs.has(truthDoc) && !primary.has(truthDoc)) {
7718
+ candidates.add(truthDoc);
7719
+ }
7720
+ };
7721
+ const linkedTruthDocs = (truthDoc) => {
7722
+ const entry = docEntries.get(truthDoc);
7723
+ return uniqueSorted4([
7724
+ ...entry?.realizedBy ?? [],
7725
+ ...entry?.realizes ?? [],
7726
+ ...entry?.dependsOn ?? [],
7727
+ ...[...docEntries.values()].filter(
7728
+ (candidate) => candidate.realizedBy.includes(truthDoc) || candidate.realizes.includes(truthDoc) || candidate.dependsOn.includes(truthDoc)
7729
+ ).map((candidate) => candidate.path)
7730
+ ]);
7731
+ };
7732
+ for (const truthDoc of [...primary, ...changedPaths].filter(
7733
+ (path12) => indexedTruthDocs.has(path12)
7734
+ )) {
7735
+ for (const linkedTruthDoc of linkedTruthDocs(truthDoc)) {
7736
+ addCandidate(linkedTruthDoc);
7737
+ }
7738
+ }
7739
+ for (const diagnostic of diagnostics) {
7740
+ if (diagnostic.category === "freshness" && diagnostic.file) {
7741
+ addCandidate(diagnostic.file);
7742
+ }
7743
+ }
7744
+ for (const route of repoIndex.routeMap.routes) {
7745
+ if (changedPaths.has(route.sourcePath)) {
7746
+ route.truthDocs.forEach(addCandidate);
7747
+ }
7748
+ }
7749
+ for (const doc of repoIndex.docs) {
7750
+ if (!indexedTruthDocs.has(doc.path) || primary.has(doc.path)) {
7751
+ continue;
7752
+ }
7753
+ if (doc.sourceOfTruth.some(
7754
+ (reference) => [...changedPaths].some(
7755
+ (changedPath) => reference === changedPath || micromatch8.isMatch(changedPath, reference)
7756
+ )
7757
+ )) {
7758
+ candidates.add(doc.path);
7759
+ }
7760
+ }
7761
+ return uniqueSorted4([...candidates]);
7951
7762
  };
7952
7763
  var hasUnmappedFunctionalChange = (impactSet) => impactSet?.diagnostics.some(
7953
7764
  (diagnostic) => diagnostic.category === "impact" && /not mapped to a Truthmark route|no affected truth document/u.test(
@@ -8013,7 +7824,7 @@ var workflowCardFor = (workflow, applicability, diagnostics, impactSet) => {
8013
7824
  }))
8014
7825
  };
8015
7826
  };
8016
- var contextDataFor = (workflow, repoIndex, config, impactSet) => {
7827
+ var contextDataFor = (workflow, repoIndex, config, impactSet, diagnostics) => {
8017
7828
  if (!config) {
8018
7829
  return {};
8019
7830
  }
@@ -8022,7 +7833,12 @@ var contextDataFor = (workflow, repoIndex, config, impactSet) => {
8022
7833
  repoIndex.routeMap.routes.flatMap((route) => route.truthDocs)
8023
7834
  );
8024
7835
  const primaryTruthDocs = uniqueSorted4(impactSet?.affectedTruthDocs ?? []);
8025
- const candidateStaleTruthDocs = workflow === "truthmark-sync" ? candidateStaleTruthDocsFor(indexedTruthDocs, primaryTruthDocs) : [];
7836
+ const candidateStaleTruthDocs = workflow === "truthmark-sync" ? candidateStaleTruthDocsFor(
7837
+ repoIndex,
7838
+ primaryTruthDocs,
7839
+ impactSet,
7840
+ diagnostics
7841
+ ) : [];
8026
7842
  const truthDocs = workflow === "truthmark-sync" ? uniqueSorted4([...primaryTruthDocs, ...candidateStaleTruthDocs]) : uniqueSorted4(impactSet?.affectedTruthDocs ?? indexedTruthDocs);
8027
7843
  return {
8028
7844
  routeIndexPath: config.truthmark.paths.routesIndex,
@@ -8082,7 +7898,8 @@ var buildWorkflowState = async (cwd, options) => {
8082
7898
  options.workflow,
8083
7899
  repoIndex,
8084
7900
  loadResult.config,
8085
- impactSet
7901
+ impactSet,
7902
+ diagnostics
8086
7903
  );
8087
7904
  return {
8088
7905
  schemaVersion: "truthmark-workflow/v0",
@@ -8237,6 +8054,16 @@ var validateTruthSyncReportText = (text) => {
8237
8054
  "Evidence checked entries include Claim:, Evidence:, and Result: supported | narrowed | removed | blocked"
8238
8055
  );
8239
8056
  }
8057
+ const completedTargets = [
8058
+ ...report.truthDocsUpdated,
8059
+ ...report.syncIntent?.targetTruthDocs ?? []
8060
+ ];
8061
+ const bootstrapTargets = completedTargets.filter(isBootstrapRoutingDocPath);
8062
+ if (bootstrapTargets.length > 0) {
8063
+ errors.push(
8064
+ `bootstrap-routing.md is a provisional topology handoff, not a completed behavior-update target: ${bootstrapTargets.join(", ")}`
8065
+ );
8066
+ }
8240
8067
  if (report.syncIntent !== void 0) {
8241
8068
  checks.push("Sync Intent");
8242
8069
  }
@@ -8295,6 +8122,7 @@ var validateTruthDocumentReportText = (text) => {
8295
8122
  };
8296
8123
  var cleanPathValue = (value) => value.trim().replace(/^["']|["']$/gu, "");
8297
8124
  var normalizePath5 = (value) => cleanPathValue(value).replace(/^\.\//u, "");
8125
+ var isBootstrapRoutingDocPath = (value) => normalizePath5(value).endsWith("/bootstrap-routing.md");
8298
8126
  var windowsDriveAbsolutePattern = /^[A-Za-z]:[\\/]/u;
8299
8127
  var uncPathPattern = /^[/\\]{2}[^/\\]+[/\\]+[^/\\]+/u;
8300
8128
  var isUnsafePathValue = (value) => {