{"_id":"@adhd/workspace-base-standard","_rev":"4-f246b2e8a8126fe574d974e67cde00a7","name":"@adhd/workspace-base-standard","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@adhd/workspace-base-standard","version":"0.0.1","keywords":["monorepo","workspace","standard","checker","provenance"],"_id":"@adhd/workspace-base-standard@0.0.1","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"f2446ab6461a76d156a369a8908c4632d87b28e8","tarball":"https://registry.npmjs.org/@adhd/workspace-base-standard/-/workspace-base-standard-0.0.1.tgz","fileCount":12,"integrity":"sha512-N/js8uLpFdZ8VKwBidRR35Lg5Sax3uH3OOmx9ZrnRilI9rKpxNeB0dc4BEGoch02Pv6h77YvTPux5PvTDid6bA==","signatures":[{"sig":"MEUCIHzwr9X/xz4XE/Ke0PhUtM/SSXL88TH9FShUTx/8o6yvAiEAkFMd8hbUJG6hpwHc+kv50beAktsbGs0FNnAaopLcPcU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30609},"main":"./index.js","module":"./index.mjs","gitHead":"7edc5d58575a24fb9695bb3474d3e169f20eac58","typings":"./index.d.ts","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_npmVersion":"11.6.2","description":"Platform-agnostic checkers and provenance schema for the adhd monorepo's per-package workspace standard","directories":{},"_nodeVersion":"24.11.1","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/workspace-base-standard_0.0.1_1786144781812_0.7531117781023375","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@adhd/workspace-base-standard","version":"0.0.2","keywords":["monorepo","workspace","standard","checker","provenance"],"license":"MIT","_id":"@adhd/workspace-base-standard@0.0.2","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"homepage":"https://github.com/PseudoSky/adhd/tree/main/packages/workspace/workspace-base-standard#readme","bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"dist":{"shasum":"346ee8016647f922ed9e7995db3bdb02848e7436","tarball":"https://registry.npmjs.org/@adhd/workspace-base-standard/-/workspace-base-standard-0.0.2.tgz","fileCount":12,"integrity":"sha512-G/om2sCOxOvWTALYnGOdrDESov/u7v1NAY1rO3tSwe1bBxKfgLoWxy5XzXWkkKlZAru98HBw0lPd25neC7oe6Q==","signatures":[{"sig":"MEUCIQC1mPNR9tvaFYs9etAy/0/97WZGFgez0YjPaR3I5qorfwIgd19iY9WQy84WzyRLTQKY1w5H32WM5jRFOs7HEmmheAA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDeNf72LzTIjVNuzxT2+JsVbXc501vaG6WtcAIoNSwxsgIgX6jmCZqPxTehgykdFyKMFxu3ltc+ges0l5iyEVk5F3U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31113},"main":"./index.js","module":"./index.mjs","typings":"./index.d.ts","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git","directory":"packages/workspace/workspace-base-standard"},"_npmVersion":"11.6.2","description":"Platform-agnostic checkers and provenance schema for the adhd monorepo's per-package workspace standard","directories":{},"_nodeVersion":"24.11.1","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/workspace-base-standard_0.0.2_1790267191105_0.47015199081430414","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@adhd/workspace-base-standard","version":"0.0.3","keywords":["monorepo","workspace","standard","checker","provenance"],"license":"MIT","_id":"@adhd/workspace-base-standard@0.0.3","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"homepage":"https://github.com/PseudoSky/adhd/tree/main/packages/workspace/workspace-base-standard#readme","bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"dist":{"shasum":"d781a3d6852eb6f552647006fb195ea62cab2d53","tarball":"https://registry.npmjs.org/@adhd/workspace-base-standard/-/workspace-base-standard-0.0.3.tgz","fileCount":12,"integrity":"sha512-Ogg3Qi6Wh9Px2ks5EJ3TgR9YYZ3pjat43cHryo/BeqIcT/e0hp+4hsAmLjp1Wq8wIiEErnH0js8monn2UOK61g==","signatures":[{"sig":"MEUCIG9HU2vCYqQF5t0w9K16/Vy2Pg/Uo3EcNeyubNKsInFvAiEAwbB6xY+GG1ZXjmXHW5cdU9E9GCtX9wyqjnGJTZDtfS0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDeSN3ldexKnme7nlXeLpK01qAPAUajwK28lrZen2+PrAIhAKSpDzSLU44nwCRtsYMJZikfz4SOEOcxdr5tstN1Su2k","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31295},"main":"./index.js","module":"./index.mjs","gitHead":"d473447c27714c6a7ab057efee178d1af8707e05","typings":"./index.d.ts","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git","directory":"packages/workspace/workspace-base-standard"},"_npmVersion":"11.6.2","description":"Platform-agnostic checkers and provenance schema for the adhd monorepo's per-package workspace standard","directories":{},"_nodeVersion":"24.11.1","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/workspace-base-standard_0.0.3_1790449285464_0.46450033070197394","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"_id":"@adhd/workspace-base-standard@0.0.4","bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"dist":{"shasum":"7971f8e3b8e2d388c41ac4ad0ea81d4de7470008","tarball":"https://registry.npmjs.org/@adhd/workspace-base-standard/-/workspace-base-standard-0.0.4.tgz","fileCount":12,"integrity":"sha512-yLOiUUveSTcsBBUTH5lZrGaavCWfp5QFvtlI1EuK4O4bZvelwe7+aQp1IirptBPx8xa3jD4BZXdkwWaPhNCNtQ==","signatures":[{"sig":"MEUCICV6K5kS9ypgrDyRGXC7o0Ln8xqPxmsbKKe+60YOprGQAiEA1bqUwm6okHd+IhpjSfyhLUQhgVjmqKo+MvqczN9hq/k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEMCHwTGsjsk4ntBHwp4P/AH9/17y+ZXflX9gVzffjUaDMcCIBn+ZcSk+ttkb1xzYoubagr0dGUCOg4ZtiL3yx30BEsa"}],"unpackedSize":31295},"main":"./index.js","name":"@adhd/workspace-base-standard","module":"./index.mjs","gitHead":"a1a6ba024c5526b930f97c5420e920639d14e110","license":"MIT","typings":"./index.d.ts","version":"0.0.4","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"homepage":"https://github.com/PseudoSky/adhd/tree/main/packages/workspace/workspace-base-standard#readme","keywords":["monorepo","workspace","standard","checker","provenance"],"repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git","directory":"packages/workspace/workspace-base-standard"},"_npmVersion":"11.6.2","description":"Platform-agnostic checkers and provenance schema for the adhd monorepo's per-package workspace standard","directories":{},"maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"_nodeVersion":"24.11.1","dependencies":{},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/workspace-base-standard_0.0.4_1790455900777_0.7409519964570206"}}},"time":{"created":"2026-08-07T23:19:41.628Z","modified":"2026-09-26T20:51:41.057Z","0.0.1":"2026-08-07T23:19:41.957Z","0.0.2":"2026-09-24T16:26:31.179Z","0.0.3":"2026-09-26T19:01:25.542Z","0.0.4":"2026-09-26T20:51:40.875Z"},"bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"license":"MIT","homepage":"https://github.com/PseudoSky/adhd/tree/main/packages/workspace/workspace-base-standard#readme","keywords":["monorepo","workspace","standard","checker","provenance"],"repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git","directory":"packages/workspace/workspace-base-standard"},"description":"Platform-agnostic checkers and provenance schema for the adhd monorepo's per-package workspace standard","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"readme":"# @adhd/workspace-base-standard\n\nPlatform-agnostic (pure `node:fs`/`node:path`, zero `@nx/devkit` import)\ncheckers and provenance schema/validator for the adhd monorepo's\nper-package \"workspace standard\": required docs, required Nx targets,\nper-package metadata (`.adhd/meta.json`), idempotent managed-region\nupgrades, and commit/CHANGELOG provenance trailers.\n\n```bash\nnpm install @adhd/workspace-base-standard\n```\n\n## Why this package exists\n\nEvery package in this monorepo is expected to converge on a shared set of\ndocs (`README.md`, `CLAUDE.md`, `DEMO.md`, `CHANGELOG.md`, `PLAYBOOK.md`)\nand Nx targets (`build`, `lint`, `test`, `typecheck`, `demo`, `verify`, plus\n`nx-release-publish` for anything published). This package is the\n**platform-agnostic core** of that standard: it defines what \"compliant\"\nmeans and can check any project directory against it, without depending on\nNx's project graph, `@nx/devkit`, or shelling out to any CLI. That makes it\nsafe to run from a git hook, a plain Node script, an MCP tool, or a unit\ntest — not just from inside an Nx generator/executor.\n\nThe Nx-specific wiring (actually running these checks as an Nx target,\nreading tags from the real project graph, auto-fixing drift) is a\n**separate** package (`PKG-WS-NX-ADAPTER`) that depends on this one. This\npackage never imports `@nx/devkit` and never shells out — see each module's\nown doc comment for the specific boundary it holds.\n\n## Module boundaries\n\n| Module | Responsibility | Boundary |\n|---|---|---|\n| `taxonomy.ts` | Reads `.adhd/workspace.json` (the workspace's group/kind/platform/layer taxonomy, plus the new optional `boundaries.depConstraints` matrix). | Pure `node:fs` + `JSON.parse`. Mirrors (does not duplicate the format of) `workspace-codegen-nx`'s `WorkspaceConfig` reader. |\n| `metadata.ts` | Reads and validates `<pkg>/.adhd/meta.json` — a new, opt-in per-package metadata block (`group`, `kind`, `concerns`, `invariants`, `entrypoints`). | Pure `node:fs`. Field names match the real `.adhd/workspace.json` vocabulary (`groups`/`kinds`), not any competing naming. |\n| `required.ts` | The required-targets / required-files **registry**, as plain data. | Zero runner wiring — no target execution, no shelling out. That's the Nx adapter's job. |\n| `checker.ts` | `checkProject(projectDir, tags, opts)` — checks a real project directory against the registry in `required.ts`. | Pure filesystem reads. Reads `project.json` as plain JSON (no `@nx/devkit`), so it can see declared targets but not Nx-plugin-inferred ones — see the module doc comment. |\n| `managed-region.ts` | Idempotent \"managed region\" marker engine (`<!-- @workspace:managed:start/end id=\"...\" -->`) for re-stamping a span of a hand-maintained file without clobbering the rest. | Pure string manipulation, no I/O. |\n| `provenance.ts` | Commit-trailer parsing (`Work-Item`/`Dispatcher`/`Author`/`Model`), CHANGELOG provenance-note rendering/parsing, and pure author-identity resolution. | `resolveAuthorIdentity` takes already-gathered inputs — it never reads `process.env`, the filesystem, or shells out to `git`. Gathering those inputs is the caller's job. |\n\n## Public API\n\n```ts\nimport {\n  // taxonomy.ts\n  readTaxonomy, type WorkspaceTaxonomy, type DepConstraint,\n  // metadata.ts\n  readPackageMeta, validatePackageMeta, type PackageMeta,\n  // required.ts\n  REQUIRED_TARGETS, requiredTargetsFor, REQUIRED_FILES, requiredFilesFor,\n  REQUIRED_FILE_SECTION_MARKERS, type RequiredTarget, type RequiredFile, type SectionRequirement,\n  // checker.ts\n  checkProject, type CheckResult, type CheckProjectOptions,\n  // managed-region.ts\n  applyManagedRegion, hasManagedRegion,\n  // provenance.ts\n  parseCommitTrailers, renderChangelogProvenanceNote, parseChangelogProvenanceNote,\n  resolveAuthorIdentity,\n  type ProvenanceTrailer, type AuthorIdentity, type ResolveAuthorIdentityInput,\n} from '@adhd/workspace-base-standard';\n```\n\n### `readTaxonomy(rootDir: string): WorkspaceTaxonomy`\n\nReads and parses `<rootDir>/.adhd/workspace.json`. Throws if the file is\nmissing or malformed — a checker/CLI context should fail loudly on a broken\nworkspace config rather than silently skip validation.\n\n### `readPackageMeta(pkgDir: string): PackageMeta | null`\n\nReads `<pkgDir>/.adhd/meta.json`. Returns `null` if the file doesn't exist\n(metadata is opt-in); throws on malformed JSON.\n\n### `validatePackageMeta(meta, taxonomy): string[]`\n\nReturns human-readable error strings (empty array = valid) checking\n`meta.group` and `meta.kind` are keys of the taxonomy's `groups`/`kinds`.\n\n### `checkProject(projectDir: string, tags: string[], opts?): CheckResult[]`\n\nRuns every required-file, required-section, and required-target check\nagainst a real, absolute project directory. `opts.mode` (`'dev'` default,\nor `'ci'`) controls whether an unmodified generator placeholder is a\n`warn` or an `error`.\n\n### `applyManagedRegion(content, markerId, newBody): string` / `hasManagedRegion(content, markerId): boolean`\n\nInsert-or-replace a managed region between\n`<!-- @workspace:managed:start id=\"<id>\" -->` /\n`<!-- @workspace:managed:end id=\"<id>\" -->` markers. Everything outside the\nmarkers is left untouched, byte-for-byte.\n\n### `parseCommitTrailers(commitMessage): ProvenanceTrailer | null`\n\nParses `Work-Item:`/`Dispatcher:`/`Author:`/`Model:` trailer lines from the\nlast blank-line-delimited block of a commit message. Returns `null` unless\nboth mandatory fields (`Work-Item`, `Author`) are present and `Work-Item`\nmatches `^(plan:|backlog:|oneoff)`.\n\n### `renderChangelogProvenanceNote(t): string` / `parseChangelogProvenanceNote(line): ProvenanceTrailer | null`\n\nRender/parse the literal CHANGELOG provenance-note format:\n`‹work:<workItem> · dispatcher:<dispatcher|unknown> · author:<author> · model:<model|n/a>›`.\n\n### `resolveAuthorIdentity(input): AuthorIdentity`\n\nPure resolution of an agent/human author identity from already-gathered\ninputs (env var value, spec frontmatter, git author name). Never touches\n`process.env`/`fs`/`child_process` itself.\n\n## Invariants\n\nSee `CLAUDE.md`'s `## Invariants` section for the enforced guarantees this\npackage holds (zero `@nx/devkit` import, pure filesystem reads, no shelling\nout, `resolveAuthorIdentity` purity).\n","readmeFilename":"README.md"}