@pieai/doc-gov 0.4.8 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -52,9 +52,10 @@ It does not try to swallow product artifacts, prompts, generated media,
52
52
  runtime notes, or source assets outside `docs/**` unless a project explicitly
53
53
  opts them into doc-gov.
54
54
 
55
- It also recognizes reusable learning artifacts under `docs/solutions/**` as
56
- outside the Doc Gov schema. They use the compact learning-record frontmatter,
57
- not Doc Gov frontmatter.
55
+ Reusable learning records under `docs/reference/learnings/**` are governed
56
+ `reference` documents. Matt-native `CONTEXT.md`, `CONTEXT-MAP.md`, and
57
+ `docs/adr/**` stay outside the Doc Gov schema; `docs/adr/**` is the only durable
58
+ decision surface.
58
59
 
59
60
  ## Status
60
61
 
package/cli-guide.md CHANGED
@@ -56,7 +56,7 @@ pnpm doc-gov migrate --profile doc-only --check
56
56
  `docs/governance/agents-routing/`, and `profiles/` stay connected in the
57
57
  expected order.
58
58
  - In a downstream project, it verifies the project router block,
59
- `docs/governance/ssot-v0.9.md`, the selected agents-routing file, and old
59
+ `docs/governance/ssot-v1.0.md`, the selected agents-routing file, and old
60
60
  shared SSOT/task-routing leftovers.
61
61
  - It also checks that local paths written in backticks inside router-facing
62
62
  files such as `AGENTS.md`, `CLAUDE.md`, `README.md`, and the starter
package/dist/cli.js CHANGED
@@ -73,7 +73,6 @@ var EXTERNAL_ARTIFACT_PREFIXES = [
73
73
  "docs/adr/",
74
74
  "docs/agents/",
75
75
  "docs/brainstorms/",
76
- "docs/solutions/",
77
76
  "docs/pulse-reports/"
78
77
  ];
79
78
  function isExternalArtifactPath(repoPath) {
@@ -254,7 +253,7 @@ function isPathAllowedForType(path, type) {
254
253
  return type === "policy" || type === "reference";
255
254
  }
256
255
  if (type === "policy") return path.startsWith("docs/policy/");
257
- if (type === "decision") return path.startsWith("docs/decisions/");
256
+ if (type === "decision") return path.startsWith("docs/adr/");
258
257
  if (type === "spec") return path.startsWith("docs/specs/");
259
258
  if (type === "plan") return path.startsWith("docs/plans/");
260
259
  if (type === "canon") return path.startsWith("docs/canon/");
@@ -400,9 +399,9 @@ function planPath(rootDir, type, slugInput) {
400
399
  throw new Error(`Slug "${baseSlug}" must be kebab-case (lowercase, digits, hyphens).`);
401
400
  }
402
401
  if (type === "decision") {
403
- const n = nextSerial(rootDir, "docs/decisions", /^ADR-(\d{4})-/);
402
+ const n = nextSerial(rootDir, "docs/adr", /^(?:ADR-)?(\d{4})-/);
404
403
  return {
405
- filePath: `docs/decisions/ADR-${n}-${baseSlug}.md`,
404
+ filePath: `docs/adr/${n}-${baseSlug}.md`,
406
405
  id: `ADR-${n}`,
407
406
  slug: baseSlug,
408
407
  subdir: ""
@@ -707,7 +706,7 @@ var CURRENT_DOC_DIR_PREFIXES = [
707
706
  "docs/reference/",
708
707
  "docs/plans/",
709
708
  "docs/specs/",
710
- "docs/decisions/",
709
+ "docs/adr/",
711
710
  "docs/policy/"
712
711
  ];
713
712
  var LINK_PATTERN = /!??\[[^\]\n]*\]\(([^)\n]+)\)/g;
@@ -902,7 +901,7 @@ var CENTRAL_REQUIRED_FILES = [
902
901
  "AGENTS.md",
903
902
  "README.md",
904
903
  "docs/governance/boundary.md",
905
- "docs/governance/ssot-v0.9.md",
904
+ "docs/governance/ssot-v1.0.md",
906
905
  "docs/governance/templates/adr.md",
907
906
  "docs/governance/templates/spec.md",
908
907
  "docs/governance/templates/plan.md",
@@ -910,8 +909,8 @@ var CENTRAL_REQUIRED_FILES = [
910
909
  "docs/governance/templates/reference.md",
911
910
  "docs/governance/templates/policy.md",
912
911
  "docs/governance/templates/archive.md",
913
- "docs/governance/agents-routing/engineering-runtime-v0.9.md",
914
- "docs/governance/agents-routing/doc-only-v0.9.md",
912
+ "docs/governance/agents-routing/engineering-runtime-v1.0.md",
913
+ "docs/governance/agents-routing/doc-only-v1.0.md",
915
914
  "integrations/mattpocock-skills.md",
916
915
  "profiles/engineering-runtime/profile.md",
917
916
  "profiles/engineering-runtime/manifest.yml",
@@ -924,9 +923,9 @@ var CENTRAL_REQUIRED_FILES = [
924
923
  "starter/docs/reference/execution/current-work.md",
925
924
  "starter/docs/policy/best-practice-for-this-project.md",
926
925
  "starter/docs/governance/boundary.md",
927
- "starter/docs/governance/ssot-v0.9.md",
928
- "starter/docs/governance/agents-routing/engineering-runtime-v0.9.md",
929
- "starter/docs/governance/agents-routing/doc-only-v0.9.md",
926
+ "starter/docs/governance/ssot-v1.0.md",
927
+ "starter/docs/governance/agents-routing/engineering-runtime-v1.0.md",
928
+ "starter/docs/governance/agents-routing/doc-only-v1.0.md",
930
929
  "starter/docs/governance/doc-agent-rules.md",
931
930
  "starter/docs/governance/doc-types.md",
932
931
  "starter/docs/governance/templates/adr.md",
@@ -941,14 +940,14 @@ var PROJECT_REQUIRED_FILES = [
941
940
  "AGENTS.md",
942
941
  "CLAUDE.md",
943
942
  "docs/governance/boundary.md",
944
- "docs/governance/ssot-v0.9.md",
943
+ "docs/governance/ssot-v1.0.md",
945
944
  "docs/governance/doc-agent-rules.md",
946
945
  "docs/governance/doc-types.md",
947
946
  "docs/reference/execution/current-work.md"
948
947
  ];
949
948
  var PROJECT_AGENTS_ROUTING_FILES = [
950
- "docs/governance/agents-routing/engineering-runtime-v0.9.md",
951
- "docs/governance/agents-routing/doc-only-v0.9.md"
949
+ "docs/governance/agents-routing/engineering-runtime-v1.0.md",
950
+ "docs/governance/agents-routing/doc-only-v1.0.md"
952
951
  ];
953
952
  var FORBIDDEN_LEGACY_PATHS = [
954
953
  "governance",
@@ -963,7 +962,7 @@ var FORBIDDEN_PROJECT_PATHS = [
963
962
  ];
964
963
  var FORBIDDEN_PROJECT_ROOTS = ["integrations"];
965
964
  var FORBIDDEN_CENTRAL_ROOTS = ["shared-rules"];
966
- var ROUTER_BLOCK_BEGIN = "<!-- PGS-ROUTER:BEGIN v0.9 -->";
965
+ var ROUTER_BLOCK_BEGIN = "<!-- PGS-ROUTER:BEGIN v1.0 -->";
967
966
  var ROUTER_BLOCK_END = "<!-- PGS-ROUTER:END -->";
968
967
  var EXTERNAL_ROUTER_MARKERS = [
969
968
  "## gstack",
@@ -993,8 +992,8 @@ var CENTRAL_REQUIRED_NEEDLES = [
993
992
  },
994
993
  {
995
994
  file: "AGENTS.md",
996
- needle: "docs/governance/ssot-v0.9.md",
997
- message: "AGENTS.md must mention docs/governance/ssot-v0.9.md."
995
+ needle: "docs/governance/ssot-v1.0.md",
996
+ message: "AGENTS.md must mention docs/governance/ssot-v1.0.md."
998
997
  },
999
998
  {
1000
999
  file: "AGENTS.md",
@@ -1008,13 +1007,13 @@ var CENTRAL_REQUIRED_NEEDLES = [
1008
1007
  },
1009
1008
  {
1010
1009
  file: "AGENTS.md",
1011
- needle: "docs/governance/agents-routing/engineering-runtime-v0.9.md",
1012
- message: "AGENTS.md must mention docs/governance/agents-routing/engineering-runtime-v0.9.md."
1010
+ needle: "docs/governance/agents-routing/engineering-runtime-v1.0.md",
1011
+ message: "AGENTS.md must mention docs/governance/agents-routing/engineering-runtime-v1.0.md."
1013
1012
  },
1014
1013
  {
1015
1014
  file: "AGENTS.md",
1016
- needle: "docs/governance/agents-routing/doc-only-v0.9.md",
1017
- message: "AGENTS.md must mention docs/governance/agents-routing/doc-only-v0.9.md."
1015
+ needle: "docs/governance/agents-routing/doc-only-v1.0.md",
1016
+ message: "AGENTS.md must mention docs/governance/agents-routing/doc-only-v1.0.md."
1018
1017
  },
1019
1018
  {
1020
1019
  file: "AGENTS.md",
@@ -1032,12 +1031,12 @@ var CENTRAL_REQUIRED_NEEDLES = [
1032
1031
  message: "README.md must point readers to agents-routing under docs/governance/."
1033
1032
  },
1034
1033
  {
1035
- file: "docs/governance/agents-routing/engineering-runtime-v0.9.md",
1034
+ file: "docs/governance/agents-routing/engineering-runtime-v1.0.md",
1036
1035
  needle: "current-work.md",
1037
1036
  message: "Engineering routing must separate routing from current-work.md."
1038
1037
  },
1039
1038
  {
1040
- file: "docs/governance/agents-routing/doc-only-v0.9.md",
1039
+ file: "docs/governance/agents-routing/doc-only-v1.0.md",
1041
1040
  needle: "does not use engineering test workflows by default",
1042
1041
  message: "Doc-only routing must exclude engineering test workflows by default."
1043
1042
  },
@@ -1058,7 +1057,7 @@ var CENTRAL_REQUIRED_NEEDLES = [
1058
1057
  },
1059
1058
  {
1060
1059
  file: "profiles/engineering-runtime/manifest.yml",
1061
- needle: "docs/governance/agents-routing/engineering-runtime-v0.9.md",
1060
+ needle: "docs/governance/agents-routing/engineering-runtime-v1.0.md",
1062
1061
  message: "Engineering profile manifest must point to engineering routing."
1063
1062
  },
1064
1063
  {
@@ -1068,7 +1067,7 @@ var CENTRAL_REQUIRED_NEEDLES = [
1068
1067
  },
1069
1068
  {
1070
1069
  file: "profiles/doc-only/manifest.yml",
1071
- needle: "docs/governance/agents-routing/doc-only-v0.9.md",
1070
+ needle: "docs/governance/agents-routing/doc-only-v1.0.md",
1072
1071
  message: "Doc-only profile manifest must point to doc-only routing."
1073
1072
  },
1074
1073
  {
@@ -1093,8 +1092,8 @@ var CENTRAL_REQUIRED_NEEDLES = [
1093
1092
  },
1094
1093
  {
1095
1094
  file: "starter/AGENTS.template.md",
1096
- needle: "docs/governance/ssot-v0.9.md",
1097
- message: "Starter AGENTS template must point agents to docs/governance/ssot-v0.9.md."
1095
+ needle: "docs/governance/ssot-v1.0.md",
1096
+ message: "Starter AGENTS template must point agents to docs/governance/ssot-v1.0.md."
1098
1097
  },
1099
1098
  {
1100
1099
  file: "starter/AGENTS.template.md",
@@ -1180,8 +1179,8 @@ var PROJECT_REQUIRED_NEEDLES = [
1180
1179
  },
1181
1180
  {
1182
1181
  file: "AGENTS.md",
1183
- needle: "docs/governance/ssot-v0.9.md",
1184
- message: "AGENTS.md must mention docs/governance/ssot-v0.9.md."
1182
+ needle: "docs/governance/ssot-v1.0.md",
1183
+ message: "AGENTS.md must mention docs/governance/ssot-v1.0.md."
1185
1184
  },
1186
1185
  {
1187
1186
  file: "AGENTS.md",
@@ -1209,7 +1208,7 @@ var PROJECT_REQUIRED_NEEDLES = [
1209
1208
  message: "Governance boundary must preserve the product artifact boundary."
1210
1209
  },
1211
1210
  {
1212
- file: "docs/governance/ssot-v0.9.md",
1211
+ file: "docs/governance/ssot-v1.0.md",
1213
1212
  needle: "automatically govern every Markdown file",
1214
1213
  message: "SSOT rule must state that not every Markdown file is governed."
1215
1214
  },
@@ -1314,14 +1313,14 @@ function checkRouterIntegrity(rootDir = process.cwd()) {
1314
1313
  "README.md",
1315
1314
  "starter/AGENTS.template.md",
1316
1315
  "starter/CLAUDE.template.md",
1317
- "docs/governance/agents-routing/engineering-runtime-v0.9.md",
1318
- "docs/governance/agents-routing/doc-only-v0.9.md"
1316
+ "docs/governance/agents-routing/engineering-runtime-v1.0.md",
1317
+ "docs/governance/agents-routing/doc-only-v1.0.md"
1319
1318
  ] : [
1320
1319
  "AGENTS.md",
1321
1320
  "CLAUDE.md",
1322
1321
  "README.md",
1323
- "docs/governance/agents-routing/engineering-runtime-v0.9.md",
1324
- "docs/governance/agents-routing/doc-only-v0.9.md"
1322
+ "docs/governance/agents-routing/engineering-runtime-v1.0.md",
1323
+ "docs/governance/agents-routing/doc-only-v1.0.md"
1325
1324
  ];
1326
1325
  for (const file of portableRouterFiles) {
1327
1326
  issues.push(...validatePortableRouterText(rootDir, file));
@@ -1677,29 +1676,9 @@ var TEMPLATE_FILES = {
1677
1676
  };
1678
1677
  var DEFAULT_TEMPLATES = {
1679
1678
  "adr.md": [
1680
- "---",
1681
- "id: REPLACE-ME",
1682
- "title: Replace Me",
1683
- "type: decision",
1684
- "status: proposed",
1685
- "canonical: true",
1686
- "owner: human",
1687
- "created: YYYY-MM-DD",
1688
- "last_reviewed: YYYY-MM-DD",
1689
- "domain: meta",
1690
- "tags:",
1691
- " - replace-me",
1692
- "pinned: false",
1693
- "related: []",
1694
- "---",
1695
- "",
1696
- "# REPLACE-ME: Replace Me",
1679
+ "# Replace Me",
1697
1680
  "",
1698
- "## Context",
1699
- "",
1700
- "## Decision",
1701
- "",
1702
- "## Consequences",
1681
+ "Record the context, decision, and why in one to three sentences.",
1703
1682
  ""
1704
1683
  ].join("\n"),
1705
1684
  "spec.md": [
@@ -1926,7 +1905,7 @@ function runInit(args2) {
1926
1905
  "docs/governance/agents-routing",
1927
1906
  "docs/governance/templates",
1928
1907
  "docs/policy",
1929
- "docs/decisions",
1908
+ "docs/adr",
1930
1909
  "docs/specs/active",
1931
1910
  "docs/specs/completed",
1932
1911
  "docs/plans/active",
@@ -1957,7 +1936,7 @@ function runInit(args2) {
1957
1936
  Next steps for a brand-new project:`);
1958
1937
  console.log(` 1. Copy starter/AGENTS.template.md to AGENTS.md and fill the project name.`);
1959
1938
  console.log(` Copy starter/CLAUDE.template.md to CLAUDE.md as the Claude adapter.`);
1960
- console.log(` 2. Copy starter/docs/governance/boundary.md, ssot-v0.9.md,`);
1939
+ console.log(` 2. Copy starter/docs/governance/boundary.md, ssot-v1.0.md,`);
1961
1940
  console.log(` doc-agent-rules.md, doc-types.md, and one agents-routing file.`);
1962
1941
  console.log(` 3. Copy starter/docs/policy/best-practice-for-this-project.md and replace`);
1963
1942
  console.log(` placeholder policy with this project's real AI/development rules.`);
@@ -1996,8 +1975,8 @@ function runLinks() {
1996
1975
  import { existsSync as existsSync10, readFileSync as readFileSync9 } from "node:fs";
1997
1976
  import { join as join12 } from "node:path";
1998
1977
  var PROFILE_ROUTES = {
1999
- "engineering-runtime": "docs/governance/agents-routing/engineering-runtime-v0.9.md",
2000
- "doc-only": "docs/governance/agents-routing/doc-only-v0.9.md"
1978
+ "engineering-runtime": "docs/governance/agents-routing/engineering-runtime-v1.0.md",
1979
+ "doc-only": "docs/governance/agents-routing/doc-only-v1.0.md"
2001
1980
  };
2002
1981
  function runMigrate(args2) {
2003
1982
  const checkOnly = args2.includes("--check");
@@ -2114,9 +2093,26 @@ function runNew(args2) {
2114
2093
  console.error(`File already exists: ${plan.filePath}. Use --force to overwrite.`);
2115
2094
  return 1;
2116
2095
  }
2096
+ if (type === "decision") {
2097
+ const title2 = titleOverride ?? slugToTitle(plan.slug);
2098
+ mkdirSync5(dirname4(absPath), { recursive: true });
2099
+ writeFileSync6(
2100
+ absPath,
2101
+ `# ${title2}
2102
+
2103
+ Record the context, decision, and why in one to three sentences.
2104
+ `
2105
+ );
2106
+ console.log(`Created ${plan.filePath} with id ${plan.id}.`);
2107
+ console.log(`
2108
+ Next steps:`);
2109
+ console.log(` 1. Replace the placeholder sentence in ${plan.filePath}.`);
2110
+ console.log(` 2. Keep this ADR concise; Doc Gov intentionally treats docs/adr/** as Matt-compatible external artifacts.`);
2111
+ return 0;
2112
+ }
2117
2113
  const template = loadTemplate(root, type);
2118
- const status = type === "decision" ? "proposed" : "draft";
2119
- const canonical = type === "decision";
2114
+ const status = "draft";
2115
+ const canonical = false;
2120
2116
  const today = todayIso();
2121
2117
  const title = titleOverride ?? slugToTitle(plan.slug);
2122
2118
  const rendered = renderTemplate(template, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pieai/doc-gov",
3
- "version": "0.4.8",
3
+ "version": "0.5.0",
4
4
  "description": "AI-native documentation governance CLI for project docs, agent routing, and lifecycle checks.",
5
5
  "keywords": [
6
6
  "ai-agents",