@tanziro/plumbline 1.0.0 → 1.1.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.
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib.ts","../package.json"],"sourcesContent":["import { spawnSync } from \"node:child_process\";\nimport { existsSync, readdirSync, readFileSync, realpathSync, statSync, writeFileSync } from \"node:fs\";\nimport { dirname, join, relative, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport {\n CONTRACT_FILE,\n buildGraph,\n checkContract,\n contractAt,\n createRun,\n currentRun,\n emptyContract,\n finalizeReport,\n findRun,\n hashFile,\n loadContract,\n loadLenses,\n parseContract,\n readRunJson,\n repoRoot,\n resolveScope,\n runDeterministic,\n writeReport,\n writeRunJson,\n type CheckResult,\n type Contract,\n type GraphRun,\n type Lens,\n type RecordedProof,\n type ReportV1,\n type RunDir,\n type ScopeResult,\n} from \"@tanziro/plumbline-core\";\nimport pkg from \"../package.json\" with { type: \"json\" };\n\nexport const VERSION: string = pkg.version;\n\nconst OUTPUT_LIMIT = 8000;\n\n/**\n * git reports a repo's real path, but the working directory can reach it another way: a symlink,\n * a junction, or a Windows 8.3 short name. Compare real paths so those don't look like different folders.\n */\nconst canonical = (path: string) => (existsSync(path) ? realpathSync.native(path) : path);\n\nexport function lensDir(): string {\n const here = dirname(fileURLToPath(import.meta.url));\n const shipped = join(here, \"..\", \"lenses\");\n return existsSync(shipped) ? shipped : join(here, \"..\", \"..\", \"..\", \"skills\", \"plumbline\", \"lenses\");\n}\n\nexport function listLenses(root?: string): Lens[] {\n return loadLenses(lensDir(), root);\n}\n\ninterface RunMeta {\n startedAt: string;\n target?: string;\n base?: string;\n}\n\nexport interface ScopeArgs {\n cwd: string;\n target?: string;\n base?: string;\n}\n\n/** Pin the scope and start a new run directory. */\nexport function startScope(args: ScopeArgs): { scope: ScopeResult; run: RunDir } {\n const scope = resolveScope(args);\n const run = createRun(scope.repo);\n const meta: RunMeta = { startedAt: new Date().toISOString(), target: args.target, base: args.base };\n writeRunJson(run, \"run.json\", meta);\n writeRunJson(run, \"scope.json\", scope);\n return { scope, run };\n}\n\n/** Which contract judges this run. CI passes \"base\" so a PR cannot relax its own rules. */\nexport function contractFor(scope: ScopeResult, source: \"head\" | \"base\"): Contract {\n return contractAt(scope.repo, source === \"base\" ? scope.mergeBase : null);\n}\n\nexport interface GraphArgs extends ScopeArgs {\n contractFrom?: \"head\" | \"base\";\n}\n\n/** Reuse the latest run when it covers the same commits and has no report yet, so one review stays in one directory. */\nfunction continueOrStart(args: ScopeArgs): { scope: ScopeResult; run: RunDir } {\n const scope = resolveScope(args);\n const latest = findRun(scope.repo);\n if (latest && !existsSync(join(latest.dir, \"report.json\"))) {\n const prior = readRunJson<ScopeResult>(latest, \"scope.json\");\n if (prior?.headSha === scope.headSha && prior.mergeBase === scope.mergeBase && prior.mode === scope.mode) {\n writeRunJson(latest, \"scope.json\", scope);\n return { scope, run: latest };\n }\n }\n return startScope(args);\n}\n\nexport async function runGraph(args: GraphArgs): Promise<{ scope: ScopeResult; run: RunDir; graph: GraphRun }> {\n const { scope, run } = continueOrStart(args);\n const graph = await runDeterministic(scope, contractFor(scope, args.contractFrom ?? \"head\"));\n writeRunJson(run, \"graph.json\", graph.diff);\n writeRunJson(run, \"check.json\", graph.check);\n return { scope, run, graph };\n}\n\nexport interface CheckArgs {\n cwd: string;\n semgrep?: boolean;\n allowCustomChecks?: boolean;\n /** Check a draft contract at this path instead of `plumbline.yml`. */\n contract?: string;\n}\n\n/** Evaluate the contract against the current tree. Needs no base branch. */\nexport async function runCheck(args: CheckArgs): Promise<{ result: CheckResult; run: RunDir; hasContract: boolean }> {\n const root = canonical(repoRoot(args.cwd));\n const contract = args.contract ? loadContract(root, canonical(resolve(args.cwd, args.contract))) : loadContract(root);\n if (args.contract && !contract) throw new Error(`contract not found: ${args.contract}`);\n const graph = await buildGraph(root);\n const result = checkContract(graph, contract ?? emptyContract(), {\n root,\n runSemgrep: args.semgrep,\n allowCustomChecks: args.allowCustomChecks,\n });\n const run = currentRun(root);\n writeRunJson(run, \"check.json\", result);\n return { result, run, hasContract: contract !== null };\n}\n\nexport interface ProveArgs {\n cwd: string;\n test: string;\n command: string[];\n run?: string;\n /** Set after running the same test on the base commit. */\n passedOnBase?: boolean;\n}\n\n/** Run a proof test and record what actually happened. Only these records satisfy the proof gate. */\nexport function runProve(args: ProveArgs): RecordedProof {\n const root = canonical(repoRoot(args.cwd));\n const test = canonical(resolve(args.cwd, args.test));\n const ref = relative(root, test).replaceAll(\"\\\\\", \"/\");\n if (!ref.startsWith(\".plumbline/proofs/\")) throw new Error(\"proof tests must live under .plumbline/proofs/\");\n if (!existsSync(test)) throw new Error(`test not found: ${args.test}`);\n if (args.command.length === 0) throw new Error(\"pass the test command after --\");\n\n const options = { cwd: root, encoding: \"utf8\", timeout: 5 * 60 * 1000, maxBuffer: 16 * 1024 * 1024, windowsHide: true } as const;\n // Windows needs a shell to run .cmd shims such as npm and pnpm, so quote the arguments for it.\n const quote = (a: string) => (/^[\\w@%+=:,./\\\\-]+$/.test(a) ? a : `\"${a.replace(/\"/g, '\"\"')}\"`);\n const [cmd, ...rest] = args.command as [string, ...string[]];\n const result =\n process.platform === \"win32\"\n ? spawnSync(args.command.map(quote).join(\" \"), { ...options, shell: true })\n : spawnSync(cmd, rest, options);\n const output = `${result.stdout ?? \"\"}${result.stderr ?? \"\"}`;\n const record: RecordedProof = {\n ref,\n sha256: hashFile(test),\n headSha: resolveHead(root),\n command: args.command.join(\" \"),\n exitCode: result.status ?? 1,\n output: output.length > OUTPUT_LIMIT ? output.slice(-OUTPUT_LIMIT) : output,\n ...(args.passedOnBase === undefined ? {} : { passedOnBase: args.passedOnBase }),\n recordedAt: new Date().toISOString(),\n };\n\n const run = findRun(root, args.run) ?? createRun(root);\n const prior = readRunJson<RecordedProof[]>(run, \"proofs.json\") ?? [];\n writeRunJson(run, \"proofs.json\", [...prior.filter((p) => p.ref !== ref), record]);\n return record;\n}\n\nfunction resolveHead(root: string): string {\n const result = spawnSync(\"git\", [\"rev-parse\", \"HEAD\"], { cwd: root, encoding: \"utf8\", windowsHide: true });\n return result.stdout.trim();\n}\n\nexport interface ReportArgs {\n cwd: string;\n run?: string;\n findings?: string;\n /** Inline findings, used by the MCP tool. */\n findingsValue?: unknown;\n base?: string;\n baseBranch?: string;\n contractFrom?: \"head\" | \"base\";\n useGate?: boolean;\n useLane?: boolean;\n}\n\nexport interface ReportOutput {\n report: ReportV1;\n run: RunDir;\n paths: Record<string, string>;\n}\n\n/**\n * Finalize a run. The scope and graph are recomputed here instead of read from the run directory,\n * so the proof gate checks model findings against the repository, not against editable files.\n */\nexport async function runReport(args: ReportArgs): Promise<ReportOutput> {\n const root = repoRoot(args.cwd);\n const found = findRun(root, args.run);\n if (args.run && !found) throw new Error(`run not found: ${args.run}`);\n const run = found ?? createRun(root);\n\n const meta = readRunJson<RunMeta>(run, \"run.json\");\n const scope = resolveScope({ cwd: root, target: meta?.target, base: args.base ?? meta?.base });\n const contract = contractFor(scope, args.contractFrom ?? \"head\");\n const graph = await runDeterministic(scope, contract);\n writeRunJson(run, \"scope.json\", scope);\n writeRunJson(run, \"graph.json\", graph.diff);\n writeRunJson(run, \"check.json\", graph.check);\n\n let modelFile: unknown = args.findingsValue;\n if (modelFile === undefined && args.findings) modelFile = JSON.parse(readFileSync(resolve(args.cwd, args.findings), \"utf8\"));\n if (modelFile === undefined) modelFile = readRunJson<unknown>(run, \"findings.json\") ?? undefined;\n if (modelFile !== undefined) writeRunJson(run, \"findings.json\", modelFile);\n\n const lenses = listLenses(root);\n const report = finalizeReport({\n runId: run.id,\n startedAt: new Date(meta?.startedAt ?? Date.now()),\n version: VERSION,\n scope,\n contract,\n graph,\n modelFile,\n recordedProofs: readRunJson<RecordedProof[]>(run, \"proofs.json\") ?? [],\n baseBranch: args.baseBranch,\n useGate: args.useGate,\n useLane: args.useLane,\n lenses,\n });\n const paths = writeReport(run, report, lenses);\n return { report, run, paths };\n}\n\nconst IGNORED_DIRS = new Set([\"node_modules\", \"dist\", \"build\", \"out\", \"coverage\", \"vendor\", \"test\", \"tests\", \"__tests__\", \"__mocks__\", \"fixtures\", \"public\", \"assets\", \"static\", \"types\"]);\n\nfunction subdirs(dir: string): string[] {\n if (!existsSync(dir)) return [];\n return readdirSync(dir)\n .filter((n) => !n.startsWith(\".\") && !IGNORED_DIRS.has(n) && statSync(join(dir, n)).isDirectory())\n .sort();\n}\n\n/** Guess modules from the folder structure. */\nexport function guessModules(root: string): Record<string, string> {\n const out: Record<string, string> = {};\n for (const parent of [\"src\", \"lib\", \"app\"]) {\n for (const name of subdirs(join(root, parent))) out[name] ??= `${parent}/${name}/**`;\n }\n for (const parent of [\"packages\", \"apps\", \"services\"]) {\n for (const name of subdirs(join(root, parent))) out[name] ??= `${parent}/${name}/**`;\n }\n return out;\n}\n\nexport function renderSkeleton(modules: Record<string, string>): string {\n const names = Object.keys(modules);\n const width = Math.max(0, ...names.map((n) => yamlKey(n).length));\n const moduleLines =\n names.length > 0\n ? names.map((n) => ` ${`${yamlKey(n)}:`.padEnd(width + 2)}[\"${modules[n]}\"]`).join(\"\\n\")\n : ' # app: [\"src/app/**\"]';\n return `# Plumbline architecture contract. Docs: https://tanzir71.github.io/plumbline/docs/contract/\nversion: 1\n\n# Module name -> globs. These were guessed from your folders, so check them.\nmodules:${names.length > 0 ? \"\" : \" {}\"}\n${moduleLines}\n\n# Top to bottom. A lower layer may not import a higher one.\n# layers:\n# - [api]\n# - [billing, orgs]\n# - [db]\n\n# Rules Plumbline can prove, plus judgement calls for the model.\n# rules:\n# - id: no-billing-to-orgs\n# forbid: billing -> orgs\n# because: \"ADR-012: billing ships on its own\"\n# - id: tenant-scope\n# require: \"repository methods scope queries by org_id\"\n# check: llm\n# paths: [\"src/**/repo/**\"]\n\nproof:\n P0: [failing_test, graph_diff]\n P1: [failing_test, graph_diff, broken_rule]\n\n# Fail the CI job when the merge score is below the minimum.\n# gate:\n# - branches: [\"main\", \"release/*\"]\n# min_merge_score: 3\n\n# Label low-risk PRs. A lane never approves or merges.\nlanes:\n light:\n label: \"plumbline:light-review\"\n when: { merge_score: 5, max_severity: P3, max_changed_lines: 200 }\n never: [\"**/migrations/**\", \".github/**\"]\n`;\n}\n\nconst yamlKey = (name: string) => (/^[\\w/-]+$/.test(name) ? name : JSON.stringify(name));\n\nexport function runInit(cwd: string, force = false): { file: string; modules: string[]; content: string } {\n const root = repoRoot(cwd);\n const file = join(root, CONTRACT_FILE);\n if (existsSync(file) && !force) throw new Error(`${CONTRACT_FILE} already exists (use --force to replace it)`);\n const modules = guessModules(root);\n const content = renderSkeleton(modules);\n parseContract(content);\n writeFileSync(file, content);\n return { file, modules: Object.keys(modules), content };\n}\n","{\n \"name\": \"@tanziro/plumbline\",\n \"version\": \"1.0.0\",\n \"description\": \"Plumbline CLI and MCP server: scope, import graph diff, contract checks and reports.\",\n \"license\": \"MIT\",\n \"type\": \"module\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/tanzir71/plumbline.git\",\n \"directory\": \"packages/cli\"\n },\n \"homepage\": \"https://tanzir71.github.io/plumbline/\",\n \"engines\": {\n \"node\": \">=20.12.0\"\n },\n \"bin\": {\n \"plumbline\": \"./bin/plumbline.js\"\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/lib.d.ts\",\n \"import\": \"./dist/lib.js\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"bin\",\n \"dist\",\n \"lenses\"\n ],\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"scripts\": {\n \"build\": \"tsup && node ../../scripts/copy-lenses.mjs\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@modelcontextprotocol/sdk\": \"^1.32.2\",\n \"@tanziro/plumbline-core\": \"workspace:^\",\n \"yaml\": \"^2.9.1\",\n \"zod\": \"^4.6.7\"\n }\n}\n"],"mappings":";AAAA,SAAS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