@pieai/doc-gov 0.3.0 → 0.3.3

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
@@ -6,6 +6,9 @@ AI-assisted projects.
6
6
  It checks whether governed Markdown documents have the right frontmatter,
7
7
  lifecycle status, links, manifest freshness, agents-routing, and project wiring.
8
8
 
9
+ `@pieai/doc-gov` is the validator package. For reusable starter/profile assets
10
+ and read-only project-level init/sync checks, use `@pieai/pro-gov` beside it.
11
+
9
12
  ## Install
10
13
 
11
14
  ```bash
@@ -61,5 +64,6 @@ The CLI is in public preview. The read-only checks are the stable path:
61
64
  - `doctor`
62
65
  - `migrate --profile <profile> --check`
63
66
 
64
- Future `migrate --apply` and full init profiles should be added only after more
65
- real projects prove the same migration shape.
67
+ Future write-mode migration or apply behavior should be added only after more
68
+ real projects prove the same migration shape. Project-level write behavior
69
+ belongs in `pro-gov`, not in the validator by default.
package/cli-guide.md CHANGED
@@ -3,8 +3,12 @@
3
3
  Documentation governance CLI for PieAI projects.
4
4
 
5
5
  This package is the upstream CLI source for Project Governance System. It can
6
- replace project-local `tools/doc-gov` copies when a project is ready to update
7
- its scripts and CI together.
6
+ be installed by downstream projects as `@pieai/doc-gov` so scripts, hooks, and
7
+ CI all use the same CLI source.
8
+
9
+ It is intentionally the validator package. Install `@pieai/pro-gov` beside it
10
+ when a project needs packaged starter/profile assets or read-only init/sync
11
+ planning.
8
12
 
9
13
  ## Lifecycle
10
14
 
@@ -85,5 +89,7 @@ pnpm --filter @pieai/doc-gov typecheck
85
89
  ## Current Status
86
90
 
87
91
  This package is the preferred CLI source for new adoption work. Existing
88
- projects may keep local `tools/doc-gov` copies until their scripts, local hooks,
89
- and CI are moved together.
92
+ legacy projects should move from local CLI copies to `@pieai/doc-gov` when
93
+ their scripts, local hooks, and CI are updated together. Use `@pieai/pro-gov`
94
+ for the project-level asset surface instead of copying the whole upstream
95
+ repository into each target project.
package/dist/cli.js CHANGED
@@ -502,7 +502,7 @@ function renderManifest(records) {
502
502
  "# docs/governance/MANIFEST.yml \u2014 auto-generated, DO NOT EDIT MANUALLY",
503
503
  "# Regenerate: pnpm doc-gov scan",
504
504
  `generated_at: ${(/* @__PURE__ */ new Date()).toISOString()}`,
505
- "generator_version: doc-gov@0.3.0",
505
+ `generator_version: doc-gov@${readPackageVersion()}`,
506
506
  `docs_count: ${records.length}`,
507
507
  "docs:"
508
508
  ];
@@ -518,6 +518,16 @@ function renderManifest(records) {
518
518
  lines.push("");
519
519
  return lines.join("\n");
520
520
  }
521
+ function readPackageVersion() {
522
+ for (const candidate of ["../package.json", "../../package.json"]) {
523
+ try {
524
+ const packageJson = JSON.parse(readFileSync2(new URL(candidate, import.meta.url), "utf8"));
525
+ if (typeof packageJson.version === "string") return packageJson.version;
526
+ } catch {
527
+ }
528
+ }
529
+ return "unknown";
530
+ }
521
531
 
522
532
  // src/commands/approve.ts
523
533
  function runApprove(args2) {
@@ -945,6 +955,16 @@ var CENTRAL_REQUIRED_NEEDLES = [
945
955
  needle: ROUTER_BLOCK_BEGIN,
946
956
  message: "AGENTS.md must include the PGS router block."
947
957
  },
958
+ {
959
+ file: "AGENTS.md",
960
+ needle: "docs/policy/**/*.md",
961
+ message: "AGENTS.md must tell agents to read docs/policy/**/*.md, including subdirectories and shared-rule symlinks."
962
+ },
963
+ {
964
+ file: "AGENTS.md",
965
+ needle: "symlink",
966
+ message: "AGENTS.md must state that symlinked shared-rule files under docs/policy/ are included."
967
+ },
948
968
  {
949
969
  file: "AGENTS.md",
950
970
  needle: "docs/governance/boundary.md",
@@ -1095,6 +1115,16 @@ var CENTRAL_REQUIRED_NEEDLES = [
1095
1115
  needle: "docs/governance/doc-types.md",
1096
1116
  message: "Starter AGENTS template must point agents to docs/governance/doc-types.md."
1097
1117
  },
1118
+ {
1119
+ file: "starter/AGENTS.template.md",
1120
+ needle: "docs/policy/**/*.md",
1121
+ message: "Starter AGENTS template must tell agents to read docs/policy/**/*.md, including subdirectories and shared-rule symlinks."
1122
+ },
1123
+ {
1124
+ file: "starter/AGENTS.template.md",
1125
+ needle: "symlink",
1126
+ message: "Starter AGENTS template must state that symlinked shared-rule files under docs/policy/ are included."
1127
+ },
1098
1128
  {
1099
1129
  file: "starter/AGENTS.template.md",
1100
1130
  needle: "docs/policy/",
@@ -1134,8 +1164,13 @@ var PROJECT_REQUIRED_NEEDLES = [
1134
1164
  },
1135
1165
  {
1136
1166
  file: "AGENTS.md",
1137
- needle: "docs/policy/",
1138
- message: "AGENTS.md must point agents to docs/policy/."
1167
+ needle: "docs/policy/**/*.md",
1168
+ message: "AGENTS.md must tell agents to read docs/policy/**/*.md, including subdirectories and shared-rule symlinks."
1169
+ },
1170
+ {
1171
+ file: "AGENTS.md",
1172
+ needle: "symlink",
1173
+ message: "AGENTS.md must state that symlinked shared-rule files under docs/policy/ are included."
1139
1174
  },
1140
1175
  {
1141
1176
  file: "AGENTS.md",
@@ -1229,7 +1264,7 @@ function checkRouterIntegrity(rootDir = process.cwd()) {
1229
1264
  issues.push({
1230
1265
  file,
1231
1266
  code: "project-root-integration-path",
1232
- message: `Project-level root integrations path must not exist: ${file}. Keep upstream integration docs in project-governance-system; use AGENTS.md or docs/reference/integrations/ only when project-specific guidance is needed.`
1267
+ message: `Project-level root integrations path must not exist: ${file}. Keep upstream integration docs in the Project Governance System upstream repository; use AGENTS.md or docs/reference/integrations/ only when project-specific guidance is needed.`
1233
1268
  });
1234
1269
  }
1235
1270
  }
@@ -1298,8 +1333,20 @@ function checkRouterIntegrity(rootDir = process.cwd()) {
1298
1333
  function isCentralRepository(rootDir) {
1299
1334
  const packageJsonPath = join8(rootDir, "package.json");
1300
1335
  if (!existsSync6(packageJsonPath)) return false;
1301
- const packageJson = readFileSync6(packageJsonPath, "utf8");
1302
- return packageJson.includes('"name": "project-governance-system"') && existsSync6(join8(rootDir, "profiles")) && existsSync6(join8(rootDir, "starter")) && existsSync6(join8(rootDir, "integrations"));
1336
+ const packageName = readPackageName(packageJsonPath);
1337
+ const centralPackageNames = /* @__PURE__ */ new Set(["project-governance-system", "pro-gov"]);
1338
+ return centralPackageNames.has(packageName) && hasCentralRepositoryShape(rootDir);
1339
+ }
1340
+ function readPackageName(packageJsonPath) {
1341
+ try {
1342
+ const packageJson = JSON.parse(readFileSync6(packageJsonPath, "utf8"));
1343
+ return typeof packageJson.name === "string" ? packageJson.name : "";
1344
+ } catch {
1345
+ return "";
1346
+ }
1347
+ }
1348
+ function hasCentralRepositoryShape(rootDir) {
1349
+ return existsSync6(join8(rootDir, "profiles")) && existsSync6(join8(rootDir, "starter")) && existsSync6(join8(rootDir, "integrations"));
1303
1350
  }
1304
1351
  function validateProjectAgentsRouting(rootDir) {
1305
1352
  const issues = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pieai/doc-gov",
3
- "version": "0.3.0",
3
+ "version": "0.3.3",
4
4
  "description": "AI-native documentation governance CLI for project docs, agent routing, and lifecycle checks.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -10,15 +10,15 @@
10
10
  "project-management",
11
11
  "markdown"
12
12
  ],
13
- "homepage": "https://github.com/PieAIStudio/project-governance-system#readme",
13
+ "homepage": "https://github.com/PieAIStudio/ProjectGovernanceSystem#readme",
14
14
  "bugs": {
15
- "url": "https://github.com/PieAIStudio/project-governance-system/issues"
15
+ "url": "https://github.com/PieAIStudio/ProjectGovernanceSystem/issues"
16
16
  },
17
17
  "license": "MIT",
18
18
  "author": "PieAI <PIEAI@hotmail.com>",
19
19
  "repository": {
20
20
  "type": "git",
21
- "url": "git+https://github.com/PieAIStudio/project-governance-system.git",
21
+ "url": "git+https://github.com/PieAIStudio/ProjectGovernanceSystem.git",
22
22
  "directory": "packages/doc-gov"
23
23
  },
24
24
  "bin": {
@@ -34,13 +34,6 @@
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "scripts": {
38
- "dev": "tsx src/cli.ts",
39
- "build": "node node_modules/esbuild/bin/esbuild src/cli.ts --bundle --platform=node --format=esm --target=node22 --banner:js=\"#!/usr/bin/env node\" --outfile=dist/cli.js && chmod +x dist/cli.js",
40
- "prepack": "pnpm build",
41
- "test": "tsx --test src/**/*.test.ts",
42
- "typecheck": "tsc -p tsconfig.json --noEmit"
43
- },
44
37
  "devDependencies": {
45
38
  "@types/node": "25.0.0",
46
39
  "esbuild": "0.27.7",
@@ -49,5 +42,11 @@
49
42
  },
50
43
  "engines": {
51
44
  "node": ">=22.12.0"
45
+ },
46
+ "scripts": {
47
+ "dev": "tsx src/cli.ts",
48
+ "build": "node node_modules/esbuild/bin/esbuild src/cli.ts --bundle --platform=node --format=esm --target=node22 --banner:js=\"#!/usr/bin/env node\" --outfile=dist/cli.js && chmod +x dist/cli.js",
49
+ "test": "tsx --test src/**/*.test.ts",
50
+ "typecheck": "tsc -p tsconfig.json --noEmit"
52
51
  }
53
- }
52
+ }