specgov 0.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +22 -0
  3. package/README.md +389 -0
  4. package/RELEASING.md +50 -0
  5. package/SECURITY.md +14 -0
  6. package/action.yml +36 -0
  7. package/dist/action/action.d.ts +1 -0
  8. package/dist/action/artifacts.d.ts +6 -0
  9. package/dist/action/checks.d.ts +16 -0
  10. package/dist/action/cli-app.d.ts +5 -0
  11. package/dist/action/cli.d.ts +2 -0
  12. package/dist/action/errors.d.ts +4 -0
  13. package/dist/action/git.d.ts +7 -0
  14. package/dist/action/index.d.ts +5 -0
  15. package/dist/action/index.js +42 -0
  16. package/dist/action/licenses.txt +561 -0
  17. package/dist/action/manifest.d.ts +6 -0
  18. package/dist/action/match.d.ts +1 -0
  19. package/dist/action/package.json +3 -0
  20. package/dist/action/paths.d.ts +3 -0
  21. package/dist/action/report.d.ts +6 -0
  22. package/dist/action/types.d.ts +84 -0
  23. package/dist/action.d.ts +1 -0
  24. package/dist/action.js +45 -0
  25. package/dist/artifacts.d.ts +6 -0
  26. package/dist/artifacts.js +151 -0
  27. package/dist/checks.d.ts +16 -0
  28. package/dist/checks.js +121 -0
  29. package/dist/cli-app.d.ts +5 -0
  30. package/dist/cli-app.js +125 -0
  31. package/dist/cli.d.ts +2 -0
  32. package/dist/cli.js +7 -0
  33. package/dist/errors.d.ts +4 -0
  34. package/dist/errors.js +8 -0
  35. package/dist/git.d.ts +7 -0
  36. package/dist/git.js +47 -0
  37. package/dist/index.d.ts +5 -0
  38. package/dist/index.js +5 -0
  39. package/dist/manifest.d.ts +6 -0
  40. package/dist/manifest.js +232 -0
  41. package/dist/match.d.ts +1 -0
  42. package/dist/match.js +9 -0
  43. package/dist/paths.d.ts +3 -0
  44. package/dist/paths.js +13 -0
  45. package/dist/report.d.ts +6 -0
  46. package/dist/report.js +95 -0
  47. package/dist/types.d.ts +84 -0
  48. package/dist/types.js +1 -0
  49. package/package.json +71 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 - 2026-06-28
4
+
5
+ - Initial public CLI with `init`, `scan`, `check-pr`, `trace`, and `drift`.
6
+ - GitHub Action for advisory or strict pull request governance checks.
7
+ - Example manifests for docs-only, ADR-heavy, and framework-folder projects.
8
+ - Static documentation site for adoption guidance.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fernando Paladini
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md ADDED
@@ -0,0 +1,389 @@
1
+ # SpecGov
2
+
3
+ [![CI](https://github.com/paladini/specgov/actions/workflows/ci.yml/badge.svg)](https://github.com/paladini/specgov/actions/workflows/ci.yml)
4
+ [![MIT License](https://img.shields.io/badge/license-MIT-0f766e.svg)](LICENSE)
5
+ [![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-2f6f4e.svg)](https://paladini.github.io/specgov/)
6
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D20-339933.svg)](package.json)
7
+ [![Status](https://img.shields.io/badge/status-pre--release-f59e0b.svg)](#project-status)
8
+
9
+ **Spec governance for Git repositories. Keep code, docs, ADRs, requirements,
10
+ and spec folders aligned in every pull request.**
11
+
12
+ SpecGov is a deterministic CLI and GitHub Action for teams that use specs as
13
+ engineering contracts. It maps implementation paths to the source-of-truth
14
+ artifacts that explain them, then reports when code changes bypass those
15
+ artifacts.
16
+
17
+ It is not another spec framework. SpecGov works with the files you already
18
+ have: product requirements, ADRs, design docs, `.specs` folders, Kiro specs,
19
+ Spec Kit plans, and custom Markdown contracts.
20
+
21
+ - **Framework agnostic:** Bring any spec convention and describe it in one
22
+ `.specgov.yml` manifest.
23
+ - **PR native:** Run locally or as a GitHub Action during review.
24
+ - **Advisory first:** Start with warnings, then move trusted areas to strict
25
+ enforcement.
26
+ - **Audit friendly:** Emit Markdown for humans and JSON for automation.
27
+ - **Private by default:** No hosted service, API key, model call, telemetry, or
28
+ repository upload.
29
+
30
+ ## Contents
31
+
32
+ - [Why SpecGov exists](#why-specgov-exists)
33
+ - [How it works](#how-it-works)
34
+ - [Core capabilities](#core-capabilities)
35
+ - [Installation](#installation)
36
+ - [Quick start](#quick-start)
37
+ - [Manifest](#manifest)
38
+ - [Commands](#commands)
39
+ - [GitHub Action](#github-action)
40
+ - [Adoption recipes](#adoption-recipes)
41
+ - [Report example](#report-example)
42
+ - [Enterprise-friendly defaults](#enterprise-friendly-defaults)
43
+ - [How SpecGov differs from SpecTrace](#how-specgov-differs-from-spectrace)
44
+ - [Development](#development)
45
+ - [Security and privacy](#security-and-privacy)
46
+ - [Project status](#project-status)
47
+
48
+ ## Why SpecGov exists
49
+
50
+ Spec-driven development breaks down when Git accepts code-only pull requests
51
+ for behavior that was supposed to be governed by requirements, ADRs, product
52
+ docs, or design plans. The result is familiar:
53
+
54
+ - requirements become stale after the implementation moves on;
55
+ - ADRs lose authority because reviewers cannot see when they were bypassed;
56
+ - AI-assisted changes become hard to audit after the conversation is gone;
57
+ - teams adopt multiple spec formats, then lose one shared governance layer;
58
+ - compliance and platform teams need traceability without a heavyweight tool.
59
+
60
+ SpecGov gives repositories a small contract:
61
+
62
+ 1. Declare the artifacts that define expected behavior.
63
+ 2. Map code paths to the artifacts that must move with them.
64
+ 3. Check pull requests for missing spec impact.
65
+ 4. Generate trace and drift reports that humans and automation can inspect.
66
+
67
+ ## How it works
68
+
69
+ ```mermaid
70
+ flowchart LR
71
+ artifacts["Docs, ADRs, specs, and plans"]
72
+ manifest[".specgov.yml"]
73
+ changes["Changed code paths"]
74
+ specgov["SpecGov CLI or Action"]
75
+ report["Markdown or JSON report"]
76
+ review["Reviewers and CI"]
77
+
78
+ artifacts --> specgov
79
+ manifest --> specgov
80
+ changes --> specgov
81
+ specgov --> report
82
+ report --> review
83
+ ```
84
+
85
+ SpecGov does not parse your business logic or invent a new workflow. It reads
86
+ your manifest, discovers governed artifacts, compares changed files with your
87
+ declared mappings, and reports whether the review has enough spec context.
88
+
89
+ ## Core capabilities
90
+
91
+ | Capability | What it gives you |
92
+ | ----------------------- | ------------------------------------------------------------ |
93
+ | Artifact discovery | Finds governed docs, ADRs, specs, and requirements by glob. |
94
+ | Lifecycle metadata | Reads optional `status`, `owner`, and verification metadata. |
95
+ | PR impact checks | Flags code changes that skip mapped spec artifacts. |
96
+ | Unmapped code detection | Finds changed files outside your declared governance map. |
97
+ | Trace index | Emits JSON linking artifacts, mappings, and matched files. |
98
+ | Drift report | Reports stale, empty, orphaned, or superseded artifacts. |
99
+ | GitHub Action | Runs the same deterministic checks inside pull requests. |
100
+ | Advisory/strict modes | Lets teams observe first, then block trusted paths later. |
101
+
102
+ ## Installation
103
+
104
+ Install the CLI from npm:
105
+
106
+ ```bash
107
+ npm install -g specgov
108
+ ```
109
+
110
+ You can also run it without a global install:
111
+
112
+ ```bash
113
+ npx specgov --help
114
+ ```
115
+
116
+ After installation, the `specgov` command is available on your machine:
117
+
118
+ ```bash
119
+ specgov --help
120
+ ```
121
+
122
+ ## Quick start
123
+
124
+ From the repository you want to govern:
125
+
126
+ ```bash
127
+ specgov init
128
+ specgov scan
129
+ specgov check-pr --changed-file src/auth/session.ts
130
+ specgov trace --out .specgov.trace.json
131
+ specgov drift
132
+ ```
133
+
134
+ Start in `advisory` mode so contributors can see findings without blocking
135
+ merges. Move selected repositories or paths to `strict` after the mapping has
136
+ earned trust in real pull requests.
137
+
138
+ ## Manifest
139
+
140
+ SpecGov is configured with one YAML file:
141
+
142
+ ```yaml
143
+ version: 1
144
+ mode: advisory
145
+
146
+ artifacts:
147
+ - path: "docs/**/*.md"
148
+ kind: documentation
149
+ owner: docs
150
+ - path: "adr/**/*.md"
151
+ kind: decision
152
+ owner: architecture
153
+ - path: ".specs/**/*.md"
154
+ kind: specification
155
+ owner: engineering
156
+
157
+ mappings:
158
+ - code: "src/auth/**"
159
+ specs:
160
+ - "docs/auth/**"
161
+ - "adr/auth/**"
162
+ - ".specs/features/auth/**"
163
+ description: Authentication behavior must stay aligned with its specs.
164
+
165
+ rules:
166
+ require_spec_impact_for_code_changes: true
167
+ require_lifecycle_status: false
168
+ require_owner_for_active_specs: false
169
+ stale_after_days: 180
170
+
171
+ ignore:
172
+ - "node_modules/**"
173
+ - "dist/**"
174
+ - ".git/**"
175
+ ```
176
+
177
+ ### Governed artifacts
178
+
179
+ Each `artifacts` entry tells SpecGov which files belong to your spec layer. Use
180
+ the folder convention your team already has:
181
+
182
+ - `docs/**/*.md` for product or engineering docs.
183
+ - `adr/**/*.md` for architectural decisions.
184
+ - `.specs/**/*.md` for TLC Spec Driven or custom specs.
185
+ - `.kiro/specs/**/*.md` for Kiro-style spec folders.
186
+ - `specs/**/*.md` for Spec Kit or repository-local plans.
187
+
188
+ ### Code-to-spec mappings
189
+
190
+ Each `mappings` entry connects implementation paths to the artifacts that must
191
+ move with them. If `src/auth/**` changes and no mapped artifact changes,
192
+ SpecGov reports `SPEC_IMPACT_MISSING`.
193
+
194
+ When `require_spec_impact_for_code_changes` is enabled, SpecGov also reports
195
+ `CODE_CHANGE_UNMAPPED` for changed files that are not covered by any mapping,
196
+ are not governed artifacts, and are not ignored.
197
+
198
+ ### Lifecycle frontmatter
199
+
200
+ Governed Markdown files can include optional lifecycle metadata:
201
+
202
+ ```markdown
203
+ ---
204
+ status: active
205
+ owner: platform
206
+ last_verified: 2026-06-27
207
+ ---
208
+
209
+ # Authentication session contract
210
+ ```
211
+
212
+ Supported statuses are `draft`, `active`, `superseded`, `deprecated`, and
213
+ `archived`. Superseded artifacts can declare `superseded_by` so readers know
214
+ where the current source of truth moved.
215
+
216
+ ## Commands
217
+
218
+ | Command | Purpose | Common use |
219
+ | ------------------ | ---------------------------------------------------- | ---------------------- |
220
+ | `specgov init` | Create a starter `.specgov.yml`. | First-time setup. |
221
+ | `specgov scan` | Discover governed artifacts and lifecycle findings. | Local audit. |
222
+ | `specgov check-pr` | Compare changed files against code-to-spec mappings. | Pull request checks. |
223
+ | `specgov trace` | Generate a machine-readable trace index. | Automation and audits. |
224
+ | `specgov drift` | Report stale, empty, orphaned, or superseded specs. | Maintenance reviews. |
225
+
226
+ All report commands default to Markdown output. Use `--format json` when
227
+ another tool needs to consume the result:
228
+
229
+ ```bash
230
+ specgov scan --format json
231
+ specgov check-pr --format json --changed-file src/payments/checkout.ts
232
+ ```
233
+
234
+ Exit codes:
235
+
236
+ - `0`: pass, or warnings in `advisory` mode.
237
+ - `1`: governance failure in `strict` mode.
238
+ - `2`: runtime or configuration error.
239
+
240
+ ## GitHub Action
241
+
242
+ Run SpecGov on pull requests:
243
+
244
+ ```yaml
245
+ name: SpecGov
246
+
247
+ on:
248
+ pull_request:
249
+
250
+ jobs:
251
+ specgov:
252
+ runs-on: ubuntu-latest
253
+ steps:
254
+ - uses: actions/checkout@v5
255
+ with:
256
+ fetch-depth: 0
257
+
258
+ - uses: paladini/specgov@v0.1.0
259
+ with:
260
+ mode: advisory
261
+ base-ref: ${{ github.event.pull_request.base.sha }}
262
+ head-ref: ${{ github.event.pull_request.head.sha }}
263
+ ```
264
+
265
+ Pin the Action to a version tag for repeatable CI behavior.
266
+
267
+ Use `mode: strict` when governance findings should block the pull request.
268
+
269
+ ### Action inputs
270
+
271
+ | Input | Default | Description |
272
+ | --------------- | -------------- | -------------------------------------------------------- |
273
+ | `config` | `.specgov.yml` | Path to the manifest. |
274
+ | `mode` | `advisory` | `advisory` reports warnings; `strict` fails on warnings. |
275
+ | `base-ref` | unset | Base git ref for pull request comparison. |
276
+ | `head-ref` | unset | Head git ref for pull request comparison. |
277
+ | `output-format` | `markdown` | Report format for logs and `report-json`. |
278
+ | `changed-files` | unset | Newline-delimited file list when you provide the diff. |
279
+
280
+ ### Action outputs
281
+
282
+ | Output | Description |
283
+ | ------------- | ----------------------------------------------- |
284
+ | `status` | `pass`, `warn`, `fail`, or `error`. |
285
+ | `report-json` | Serialized `SpecGovReport` for downstream jobs. |
286
+
287
+ ## Adoption recipes
288
+
289
+ The `examples/` folder includes starter manifests for common repository shapes:
290
+
291
+ | Repository style | Example |
292
+ | ----------------- | ------------------------------------------------------------------------------------ |
293
+ | Docs-only | [`examples/docs-only/.specgov.yml`](examples/docs-only/.specgov.yml) |
294
+ | ADR-heavy | [`examples/adr-heavy/.specgov.yml`](examples/adr-heavy/.specgov.yml) |
295
+ | Framework folders | [`examples/framework-folders/.specgov.yml`](examples/framework-folders/.specgov.yml) |
296
+
297
+ A practical rollout usually looks like this:
298
+
299
+ 1. Run `specgov init`.
300
+ 2. Add one or two high-value mappings, not the whole repository.
301
+ 3. Run `specgov scan` and fix obvious empty globs.
302
+ 4. Add the GitHub Action in `advisory` mode.
303
+ 5. Review warnings in a few pull requests.
304
+ 6. Tighten high-confidence areas with `mode: strict`.
305
+ 7. Schedule `specgov drift` as a periodic maintenance check.
306
+
307
+ ## Report example
308
+
309
+ ```markdown
310
+ # SpecGov check-pr report
311
+
312
+ Status: **warn**
313
+ Mode: `advisory`
314
+ Findings: 1 (0 errors, 1 warnings, 0 info)
315
+
316
+ ## Changed Files
317
+
318
+ - `src/auth/session.ts`
319
+
320
+ ## Findings
321
+
322
+ - **WARNING SPEC_IMPACT_MISSING**: Code changed under src/auth/** without a
323
+ related spec artifact change.
324
+ - Related: `src/auth/session.ts`, `docs/auth/**`, `adr/auth/**`
325
+ - Suggestion: Update a mapped spec artifact or run in advisory mode until
326
+ this mapping is ready to enforce.
327
+ ```
328
+
329
+ ## Enterprise-friendly defaults
330
+
331
+ SpecGov is small, but its defaults are designed for serious engineering teams:
332
+
333
+ - **No data leaves your runner.** SpecGov reads local files and git metadata.
334
+ - **No vendor workflow lock-in.** The manifest points to any docs, ADRs, or
335
+ spec folders your organization already uses.
336
+ - **No all-at-once migration.** Advisory mode lets teams learn before
337
+ enforcement.
338
+ - **Machine-readable outputs.** JSON reports can feed dashboards, policy jobs,
339
+ or release evidence.
340
+ - **Review-first governance.** Findings appear where engineers already make
341
+ decisions: pull requests and local checks.
342
+
343
+ ## How SpecGov differs from SpecTrace
344
+
345
+ SpecTrace for AI Coding verifies whether a specific AI-assisted change
346
+ satisfies explicit requirements and evidence maps. SpecGov operates one layer
347
+ higher: it governs living spec artifacts across Git workflows regardless of
348
+ author, framework, or whether AI was involved.
349
+
350
+ They work well together:
351
+
352
+ - Use SpecGov to keep the repository's source-of-truth artifacts aligned.
353
+ - Use SpecTrace to audit the evidence behind a specific implementation change.
354
+
355
+ ## Development
356
+
357
+ ```bash
358
+ npm ci
359
+ npm test
360
+ npm run build
361
+ npm run lint
362
+ npm run typecheck
363
+ npm run format:check
364
+ ```
365
+
366
+ SpecGov uses TLC Spec Driven internally. Public behavior changes should update
367
+ the relevant files under `.specs/`, tests, and README examples in the same pull
368
+ request.
369
+
370
+ ## Security and privacy
371
+
372
+ SpecGov runs locally or in your CI runner. Version 0.1 does not call external
373
+ services, require API keys, or send repository contents to a model.
374
+
375
+ See [`SECURITY.md`](SECURITY.md) for vulnerability reporting.
376
+
377
+ ## Project status
378
+
379
+ SpecGov is in pre-release development. The CLI, report shape, and Action inputs
380
+ are usable today, but may still change before the first tagged release.
381
+
382
+ Current project links:
383
+
384
+ - Website: <https://paladini.github.io/specgov/>
385
+ - npm: <https://www.npmjs.com/package/specgov>
386
+ - Repository: <https://github.com/paladini/specgov>
387
+ - Roadmap: [`.specs/project/ROADMAP.md`](.specs/project/ROADMAP.md)
388
+ - Release process: [`RELEASING.md`](RELEASING.md)
389
+ - Contribution guide: [`CONTRIBUTING.md`](CONTRIBUTING.md)
package/RELEASING.md ADDED
@@ -0,0 +1,50 @@
1
+ # Releasing SpecGov
2
+
3
+ SpecGov releases are tag-driven. A pushed `vX.Y.Z` tag runs the release
4
+ workflow, validates the package, publishes the npm version when it is not
5
+ already present, and creates or updates the matching GitHub Release.
6
+
7
+ ## One-time npm setup
8
+
9
+ The release workflow supports both npm Trusted Publishing and an `NPM_TOKEN`
10
+ repository secret. Trusted Publishing is preferred because it uses GitHub OIDC
11
+ instead of a long-lived token.
12
+
13
+ For Trusted Publishing, configure the npm package with:
14
+
15
+ - Package: `specgov`
16
+ - Repository: `paladini/specgov`
17
+ - Workflow: `release.yml`
18
+ - Environment: leave blank unless the workflow is later changed to use one
19
+
20
+ Docs: <https://docs.npmjs.com/trusted-publishers/>
21
+
22
+ If Trusted Publishing is not configured, add an `NPM_TOKEN` secret to the
23
+ GitHub repository before pushing a release tag.
24
+
25
+ ## Release a new version
26
+
27
+ From a clean `main` branch:
28
+
29
+ ```bash
30
+ npm version patch
31
+ git push origin main --follow-tags
32
+ ```
33
+
34
+ Use `npm version minor` or `npm version major` when the change warrants it. The
35
+ version commit updates `package.json` and `package-lock.json`, and the tag
36
+ triggers `.github/workflows/release.yml`.
37
+
38
+ ## Verify a release
39
+
40
+ After the workflow completes, check:
41
+
42
+ ```bash
43
+ npm view specgov version
44
+ gh release view vX.Y.Z --repo paladini/specgov
45
+ npx specgov@latest --help
46
+ ```
47
+
48
+ The first release can be bootstrapped locally with `npm publish --access public`
49
+ when the package has not yet been created on npm. After that, prefer the tag
50
+ workflow.
package/SECURITY.md ADDED
@@ -0,0 +1,14 @@
1
+ # Security Policy
2
+
3
+ SpecGov is a local and CI-oriented developer tool. Version 0.1 does not call
4
+ external services, require API keys, or send repository contents to a model.
5
+
6
+ ## Reporting
7
+
8
+ Please report security issues privately to the repository maintainer. Do not
9
+ open a public issue for vulnerabilities involving repository data exposure,
10
+ CI behavior, or dependency compromise.
11
+
12
+ ## Supported Versions
13
+
14
+ The current `main` branch is supported during the pre-1.0 period.
package/action.yml ADDED
@@ -0,0 +1,36 @@
1
+ name: SpecGov
2
+ description: Validate spec governance impact for Git pull requests.
3
+ author: Fernando Paladini
4
+
5
+ inputs:
6
+ config:
7
+ description: Path to the SpecGov manifest.
8
+ required: false
9
+ default: .specgov.yml
10
+ mode:
11
+ description: Enforcement mode. Use advisory for warnings only or strict to fail on governance findings.
12
+ required: false
13
+ default: advisory
14
+ base-ref:
15
+ description: Base git ref for pull request comparison.
16
+ required: false
17
+ head-ref:
18
+ description: Head git ref for pull request comparison.
19
+ required: false
20
+ output-format:
21
+ description: Report format for logs and the report-json output.
22
+ required: false
23
+ default: markdown
24
+ changed-files:
25
+ description: Optional newline-delimited changed files. Overrides git diff discovery when provided.
26
+ required: false
27
+
28
+ outputs:
29
+ status:
30
+ description: "SpecGov status: pass, warn, fail, or error."
31
+ report-json:
32
+ description: JSON report for downstream automation.
33
+
34
+ runs:
35
+ using: node24
36
+ main: dist/action/index.js
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { ArtifactDiscovery, ArtifactMetadata, Finding, GovernedArtifact, SpecGovConfig } from "./types.js";
2
+ export declare function discoverArtifacts(config: SpecGovConfig, cwd: string): Promise<ArtifactDiscovery>;
3
+ export declare function readArtifactMetadata(filePath: string): Promise<ArtifactMetadata>;
4
+ export declare function buildArtifactFindings(config: SpecGovConfig, discovery: ArtifactDiscovery, now?: Date): Finding[];
5
+ export declare function artifactPathsMatching(artifacts: GovernedArtifact[], patterns: string | string[]): string[];
6
+ export declare function isArtifactPath(config: SpecGovConfig, filePath: string): boolean;
@@ -0,0 +1,16 @@
1
+ import type { SpecGovConfig, SpecGovReport, TraceIndex } from "./types.js";
2
+ interface BaseOptions {
3
+ cwd: string;
4
+ config: SpecGovConfig;
5
+ }
6
+ export interface CheckPrOptions extends BaseOptions {
7
+ baseRef?: string;
8
+ headRef?: string;
9
+ changedFiles?: string[];
10
+ mode?: "advisory" | "strict";
11
+ }
12
+ export declare function runScan(options: BaseOptions): Promise<SpecGovReport>;
13
+ export declare function runCheckPr(options: CheckPrOptions): Promise<SpecGovReport>;
14
+ export declare function runTrace(options: BaseOptions): Promise<TraceIndex>;
15
+ export declare function runDrift(options: BaseOptions): Promise<SpecGovReport>;
16
+ export {};
@@ -0,0 +1,5 @@
1
+ export interface CliIo {
2
+ stdout: (text: string) => void;
3
+ stderr: (text: string) => void;
4
+ }
5
+ export declare function runCli(argv: string[], cwd: string, io: CliIo): Promise<number>;
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare class SpecGovError extends Error {
2
+ readonly exitCode: number;
3
+ constructor(message: string, exitCode?: number);
4
+ }
@@ -0,0 +1,7 @@
1
+ export interface ChangedFileOptions {
2
+ cwd: string;
3
+ baseRef?: string;
4
+ headRef?: string;
5
+ explicitFiles?: string[];
6
+ }
7
+ export declare function getChangedFiles(options: ChangedFileOptions): Promise<string[]>;
@@ -0,0 +1,5 @@
1
+ export * from "./artifacts.js";
2
+ export * from "./checks.js";
3
+ export * from "./manifest.js";
4
+ export * from "./report.js";
5
+ export * from "./types.js";