@unbrained/pm-lint 0.0.0-stage → 2026.10.28
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/CHANGELOG.md +32 -0
- package/LICENSE +21 -0
- package/README.md +446 -2
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/src/baseline-file.d.ts +7 -0
- package/dist/src/baseline-file.d.ts.map +1 -0
- package/dist/src/baseline-file.js +79 -0
- package/dist/src/baseline-file.js.map +1 -0
- package/dist/src/baseline.d.ts +39 -0
- package/dist/src/baseline.d.ts.map +1 -0
- package/dist/src/baseline.js +68 -0
- package/dist/src/baseline.js.map +1 -0
- package/dist/src/commands.d.ts +33 -0
- package/dist/src/commands.d.ts.map +1 -0
- package/dist/src/commands.js +94 -0
- package/dist/src/commands.js.map +1 -0
- package/dist/src/engine.d.ts +48 -0
- package/dist/src/engine.d.ts.map +1 -0
- package/dist/src/engine.js +124 -0
- package/dist/src/engine.js.map +1 -0
- package/dist/src/incremental-command.d.ts +6 -0
- package/dist/src/incremental-command.d.ts.map +1 -0
- package/dist/src/incremental-command.js +27 -0
- package/dist/src/incremental-command.js.map +1 -0
- package/dist/src/incremental-contract.d.ts +72 -0
- package/dist/src/incremental-contract.d.ts.map +1 -0
- package/dist/src/incremental-contract.js +142 -0
- package/dist/src/incremental-contract.js.map +1 -0
- package/dist/src/incremental-file.d.ts +13 -0
- package/dist/src/incremental-file.d.ts.map +1 -0
- package/dist/src/incremental-file.js +119 -0
- package/dist/src/incremental-file.js.map +1 -0
- package/dist/src/incremental.d.ts +41 -0
- package/dist/src/incremental.d.ts.map +1 -0
- package/dist/src/incremental.js +116 -0
- package/dist/src/incremental.js.map +1 -0
- package/dist/src/repair-command.d.ts +6 -0
- package/dist/src/repair-command.d.ts.map +1 -0
- package/dist/src/repair-command.js +26 -0
- package/dist/src/repair-command.js.map +1 -0
- package/dist/src/repair-snapshot.d.ts +5 -0
- package/dist/src/repair-snapshot.d.ts.map +1 -0
- package/dist/src/repair-snapshot.js +66 -0
- package/dist/src/repair-snapshot.js.map +1 -0
- package/dist/src/repairs.d.ts +64 -0
- package/dist/src/repairs.d.ts.map +1 -0
- package/dist/src/repairs.js +129 -0
- package/dist/src/repairs.js.map +1 -0
- package/dist/src/rule-pack-command.d.ts +8 -0
- package/dist/src/rule-pack-command.d.ts.map +1 -0
- package/dist/src/rule-pack-command.js +30 -0
- package/dist/src/rule-pack-command.js.map +1 -0
- package/dist/src/rule-pack.d.ts +79 -0
- package/dist/src/rule-pack.d.ts.map +1 -0
- package/dist/src/rule-pack.js +174 -0
- package/dist/src/rule-pack.js.map +1 -0
- package/dist/src/rules.d.ts +28 -0
- package/dist/src/rules.d.ts.map +1 -0
- package/dist/src/rules.js +153 -0
- package/dist/src/rules.js.map +1 -0
- package/dist/src/settings.d.ts +31 -0
- package/dist/src/settings.d.ts.map +1 -0
- package/dist/src/settings.js +109 -0
- package/dist/src/settings.js.map +1 -0
- package/dist/src/sidecar-publication.d.ts +39 -0
- package/dist/src/sidecar-publication.d.ts.map +1 -0
- package/dist/src/sidecar-publication.js +105 -0
- package/dist/src/sidecar-publication.js.map +1 -0
- package/dist/src/statuses.d.ts +8 -0
- package/dist/src/statuses.d.ts.map +1 -0
- package/dist/src/statuses.js +10 -0
- package/dist/src/statuses.js.map +1 -0
- package/dist/src/types.d.ts +44 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/witness-command.d.ts +6 -0
- package/dist/src/witness-command.d.ts.map +1 -0
- package/dist/src/witness-command.js +27 -0
- package/dist/src/witness-command.js.map +1 -0
- package/dist/src/witnesses.d.ts +74 -0
- package/dist/src/witnesses.d.ts.map +1 -0
- package/dist/src/witnesses.js +171 -0
- package/dist/src/witnesses.js.map +1 -0
- package/docs/incremental-example.md +64 -0
- package/docs/incremental-validation.md +99 -0
- package/docs/portable-rule-packs-validation.md +86 -0
- package/docs/repair-preview-example.md +43 -0
- package/docs/repair-preview-validation.md +42 -0
- package/examples/authoring-rules.json +30 -0
- package/manifest.json +13 -0
- package/package.json +150 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2026.10.28 - 2026-10-28
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Preserve complete lint results with incremental rule invalidation ([pm-lint-incremental-invalidation](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/features/pm-lint-incremental-invalidation.toon))
|
|
8
|
+
- Preview minimal authoring repairs without writing tracker state ([pm-lint-authoring-repair-previews](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/features/pm-lint-authoring-repair-previews.toon))
|
|
9
|
+
- Enforce portable organization authoring rule packs ([pm-lint-portable-rule-packs](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/features/pm-lint-portable-rule-packs.toon))
|
|
10
|
+
- Acknowledge lint debt with source-bound evidence ([pm-lint-lint-baselines](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/features/pm-lint-lint-baselines.toon))
|
|
11
|
+
- Validate declared acceptance criterion witnesses without executing code ([pm-lint-criterion-witnesses](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/features/pm-lint-criterion-witnesses.toon))
|
|
12
|
+
- Certify complete tracker lint reads ([pm-lint-engine](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/features/pm-lint-engine.toon))
|
|
13
|
+
- Register host rendered lint command ([pm-lint-cli](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/features/pm-lint-cli.toon))
|
|
14
|
+
- Configure lint rules through SDK settings ([pm-lint-settings](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/features/pm-lint-settings.toon))
|
|
15
|
+
- Dogfood improvement round: precise PML003, finding excerpts, scopes, lint rules and read_output ([pm-lint-trap](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/features/pm-lint-trap.toon))
|
|
16
|
+
- Implement ten authoring quality rules ([pm-lint-rules](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/features/pm-lint-rules.toon))
|
|
17
|
+
- Certify package CI and packed consumers ([pm-lint-gate](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/features/pm-lint-gate.toon))
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Adopt pm-github 2026.10.16: default-branch-safe gated sync and daily gated closeout PRs ([pm-lint-8kis](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/chores/pm-lint-8kis.toon))
|
|
22
|
+
- Enable the gated GitHub issue sync and drop the braces chain ([pm-lint-maint1014](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/chores/pm-lint-maint1014.toon))
|
|
23
|
+
|
|
24
|
+
### Other
|
|
25
|
+
|
|
26
|
+
- Release readiness behind PM_RELEASE_APPROVED ([pm-lint-release-gate](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/chores/pm-lint-release-gate.toon))
|
|
27
|
+
- Publish pm-lint as @unbrained/pm-lint ([pm-lint-scoped-npm-name](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/chores/pm-lint-scoped-npm-name.toon))
|
|
28
|
+
- Use the pm SDK for baseline command refusals ([pm-lint-sdk-adoption-1025](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/tasks/pm-lint-sdk-adoption-1025.toon))
|
|
29
|
+
- Reconcile stale in-progress tracker records (2026-10-23) ([pm-lint-reconcile-1023](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/chores/pm-lint-reconcile-1023.toon))
|
|
30
|
+
- Cover package tooling: gates, workflows and packed consumers ([pm-lint-vh3f](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/tasks/pm-lint-vh3f.toon))
|
|
31
|
+
- Register merge drivers during CI install ([pm-lint-41oh](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/tasks/pm-lint-41oh.toon))
|
|
32
|
+
- Declare the schema capability so packed command flags activate ([pm-lint-1c6j](https://github.com/unbraind/pm-lint/blob/main/.agents/pm/tasks/pm-lint-1c6j.toon))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 unbraind
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,3 +1,447 @@
|
|
|
1
|
-
#
|
|
1
|
+
# pm-lint
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Project management = context management. Vague work items waste agent time because they cannot explain what to do, how to verify it, or what already happened. `pm-lint` judges authoring quality. Use it alongside `pm validate` for structure and references, `pm health` for workspace health, and `pm duplicates` for duplicate discovery.
|
|
4
|
+
|
|
5
|
+
The npm package is `@unbrained/pm-lint`. The pm extension identity, catalog display name and command names remain `pm-lint`: existing `pm lint` commands do not change. The public package homepage remains <https://pm-cli.unbrained.dev/packages/pm-lint>.
|
|
6
|
+
|
|
7
|
+
This package is unreleased and under local review. Registry commands become available after maintainer-approved publication. Minimum host SDK: `2026.10.23`; Node `>=22.18.0`.
|
|
8
|
+
|
|
9
|
+
With a pm host already installed, activate the registry package in your tracker:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
pm install npm:@unbrained/pm-lint
|
|
13
|
+
# Equivalent current spelling:
|
|
14
|
+
pm package install npm:@unbrained/pm-lint
|
|
15
|
+
pm lint
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The pinned pm host requires the `npm:` source prefix for registry packages, including scoped names. A bare `pm install @unbrained/pm-lint` is interpreted as a local source. Installation activates the manifest named `pm-lint` in the tracker; npm and Bun installation alone do not activate it.
|
|
19
|
+
|
|
20
|
+
For a local SDK dependency and tracker activation:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install --save-dev @unbrained/pm-lint @unbrained/pm-cli
|
|
24
|
+
npx pm package install ./node_modules/@unbrained/pm-lint
|
|
25
|
+
npx pm lint
|
|
26
|
+
|
|
27
|
+
bun add --dev @unbrained/pm-lint @unbrained/pm-cli
|
|
28
|
+
bunx --bun pm package install ./node_modules/@unbrained/pm-lint
|
|
29
|
+
bunx --bun pm lint
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Global package-manager installation is also available:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npm i -g @unbrained/pm-lint
|
|
36
|
+
bun add -g @unbrained/pm-lint
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This extension exports an SDK and has no standalone executable. `npx @unbrained/pm-lint` and `bunx @unbrained/pm-lint` cannot run it directly; invoke the pm host instead:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npx --package @unbrained/pm-cli pm package install npm:@unbrained/pm-lint
|
|
43
|
+
bunx --bun --package @unbrained/pm-cli pm package install npm:@unbrained/pm-lint
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For review before publication, build a tarball in the package checkout:
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
npm ci
|
|
50
|
+
npm run build
|
|
51
|
+
npm pack
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
In a fresh directory outside any Git repository, install the host and initialize a tracker, then install the packed artifact (copy it into that directory first):
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
npm install @unbrained/pm-cli@2026.10.23
|
|
58
|
+
npx pm init lint-consumer --defaults --agent-guidance skip
|
|
59
|
+
npx pm install ./unbrained-pm-lint-2026.10.13.tgz
|
|
60
|
+
npx pm lint --json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The same packed artifact works with `bun add` and `bunx --bun pm`. Other lint commands include:
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
pm lint rules --json
|
|
67
|
+
pm lint --output-include item_id,rule,title,excerpt --output-budget 2000
|
|
68
|
+
pm lint --rule PML002 --rule PML004 --fail-on warn
|
|
69
|
+
pm lint --disable PML006 --severity error --type Feature --status open
|
|
70
|
+
pm lint --id project-abcd --id project-efgh --since 2026-10-01
|
|
71
|
+
pm --pm-path path/to/tracker/.agents/pm lint --json
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`--rule`, `--disable` and `--id` are repeatable. `--rule` selects exactly those rules and can re-enable rules disabled in settings; `--disable` wins when both flags name the same rule. `--severity` overrides every enabled rule's severity. `--fail-on` defaults to `error` and is inclusive: `warn` fails on warnings and errors, `info` on every finding. `--since` selects items updated on or after a calendar date (UTC) or explicitly zoned ISO timestamp. Types match exact SDK metadata values. `--status` accepts comma-separated statuses and overrides each rule's default scope for the selected items. Item IDs must exist in the certified corpus.
|
|
75
|
+
|
|
76
|
+
The commands use the host renderer: TOON by default and global `--json` for automation. Every finding has `item_id`, `rule`, `severity`, `field`, `hint`, the item `title`, and an `excerpt` of the offending value trimmed to at most 160 characters. Missing-field findings use an empty excerpt. PML003 excerpts the first failing criterion; PML009 excerpts the unresolvable blocker reference. Treat diagnostic output as source context: it may contain private item text.
|
|
77
|
+
|
|
78
|
+
`summary` counts findings for every rule and severity, including zeros. `scanned` is the selected item count; `corpus_count` and `complete_list` prove the entire tracker was read before selection. Lint never edits an item or records test results in the scanned tracker. Both `pm lint` and `pm lint rules` declare the SDK `read_output` contract, so host projection (`--output-include` / `--output-exclude`), row limits, output budgets and `--output-cursor` continuations apply. Bounded output can contain fewer rows than `count`; read the host truncation receipt and follow every cursor, or use `--output-budget unbounded --output-limit unbounded` for a full report. Exit status and summary describe the full evaluation even when rendered rows are bounded.
|
|
79
|
+
|
|
80
|
+
`pm lint rules` lists each rule's code, default severity, default scope, field, description, hint and settings key.
|
|
81
|
+
|
|
82
|
+
## Incremental complete lint
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pm lint incremental --state lint.local.json --rebuild --json
|
|
86
|
+
# After editing an item:
|
|
87
|
+
pm lint incremental --state lint.local.json --json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The first scan requires `--rebuild`. Later scans retain the **complete** result,
|
|
91
|
+
including findings on unchanged items. Each rule/item pair records its declared
|
|
92
|
+
native-field dependencies and outcome. An unchanged local predicate and its
|
|
93
|
+
bounded excerpt are reused; titles and full source digests come from the current
|
|
94
|
+
SDK read. `incremental.by_rule` reports actual predicate calls and reused pairs.
|
|
95
|
+
The receipt and findings support the host's TOON/JSON projection, output budgets
|
|
96
|
+
and continuation controls. The checkpoint itself is never printed.
|
|
97
|
+
|
|
98
|
+
| Rules | Declared inputs |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| PML001 | title |
|
|
101
|
+
| PML002 | type, acceptance criteria |
|
|
102
|
+
| PML003 | title, acceptance criteria |
|
|
103
|
+
| PML004 | title, resolution, actual result, close reason/time, comments |
|
|
104
|
+
| PML006 | type, files, tests |
|
|
105
|
+
| PML008 | title, description, notes |
|
|
106
|
+
| PML005, PML007, PML009, PML010 | Global: clock/activity, hierarchy, local blocker references, SDK duplicate clusters |
|
|
107
|
+
|
|
108
|
+
Status affects every pair's applicability. Global predicates run on every scan
|
|
109
|
+
within their configured scope; duplicate analysis remains owned by the SDK.
|
|
110
|
+
Every scan still certifies the complete corpus, hashes native metadata and
|
|
111
|
+
drains SDK event pages. This reduces rule evaluation work, while retaining full
|
|
112
|
+
read and certification costs. It is separate from `pm lint --since`, which
|
|
113
|
+
selects a partial set of items by time.
|
|
114
|
+
|
|
115
|
+
Cursor loss, missing history anchors, unrecorded native imports, rule/dependency
|
|
116
|
+
version changes and policy/status-role drift refuse explicitly. Review the
|
|
117
|
+
typed `refusal.code` and `refusal.remedy`, then use `--rebuild`. Foreign state is
|
|
118
|
+
skipped even with `--rebuild`; choose a separate file. A malformed checkpoint
|
|
119
|
+
must be preserved or removed deliberately before rebuilding. Limits are 50,000
|
|
120
|
+
items, 1,000,000 event rows per invocation (including anchor verification) and
|
|
121
|
+
64 MiB per checkpoint. No scan silently truncates.
|
|
122
|
+
|
|
123
|
+
Keep this derived cache in a trusted, ignored file: it includes item ids,
|
|
124
|
+
dependency hashes, outcome bits and bounded finding excerpts. Its checksum
|
|
125
|
+
detects accidental damage; it is not an authenticity signature. The file adapter
|
|
126
|
+
uses a core token-owned lease, checks current checkpoint ownership and re-reads
|
|
127
|
+
all source revisions through the SDK before fenced atomic publication. Peers'
|
|
128
|
+
checkpoints and foreign records are preserved. Native item state is read only.
|
|
129
|
+
Checkpoint and baseline publication finishes all awaited work before a final
|
|
130
|
+
synchronous generation/byte/access-policy check and rename under its held lease
|
|
131
|
+
or lock. New sidecars are owner-only (`0600` or stricter under the umask);
|
|
132
|
+
existing access bits, owner and group are retained. Staging files stay private
|
|
133
|
+
until commit, and cleanup verifies staging identity, owned bytes and access
|
|
134
|
+
policy before unlinking. Foreign data is retained even when it overwrites the
|
|
135
|
+
same staging inode.
|
|
136
|
+
|
|
137
|
+
The typed SDK exposes `lintIncremental`, `IncrementalLintSource`,
|
|
138
|
+
`IncrementalCheckpoint`, strict checkpoint/request parsers, `RULE_DEPENDENCIES`
|
|
139
|
+
and `IncrementalRefusal`. A source injects native SDK complete reads, event pages
|
|
140
|
+
and configured policy/roles, so hosted adapters can use their own compare-and-set
|
|
141
|
+
checkpoint storage. The optional `filesystemLintSource` / `lintIncrementalFile`
|
|
142
|
+
adapter implements the CLI's local cache. See the [SDK example](docs/incremental-example.md)
|
|
143
|
+
and [measured validation](docs/incremental-validation.md).
|
|
144
|
+
|
|
145
|
+
## Install and release approval
|
|
146
|
+
|
|
147
|
+
The first npm release is pending the maintainer's interactive bootstrap. After
|
|
148
|
+
that first publish, the maintainer configures npm trusted publishing for
|
|
149
|
+
`release.yml` and sets the repository variable `PM_RELEASE_APPROVED` to `true`.
|
|
150
|
+
The daily workflow and manual dispatch both require this variable and `main`.
|
|
151
|
+
Publishing uses OIDC with provenance; no stored npm token is needed.
|
|
152
|
+
|
|
153
|
+
Once published, install the package and compatible pm host, then activate the
|
|
154
|
+
extension in an initialized pm project:
|
|
155
|
+
|
|
156
|
+
```sh
|
|
157
|
+
npm install @unbrained/pm-lint @unbrained/pm-cli
|
|
158
|
+
npx --no-install pm package install ./node_modules/@unbrained/pm-lint
|
|
159
|
+
|
|
160
|
+
bun add @unbrained/pm-lint @unbrained/pm-cli
|
|
161
|
+
bunx --bun --no-install pm package install ./node_modules/@unbrained/pm-lint
|
|
162
|
+
|
|
163
|
+
pm package install npm:@unbrained/pm-lint
|
|
164
|
+
pm lint --help
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
The package exports its SDK through `main` and `types` and registers commands
|
|
168
|
+
with pm. It has no standalone `bin`: use `npx pm` or `bunx --bun pm` through
|
|
169
|
+
the installed host. npm/Bun dependency installation alone does not activate it.
|
|
170
|
+
|
|
171
|
+
## Evidence-backed baselines
|
|
172
|
+
|
|
173
|
+
Use a baseline to keep specific old findings visible while failing every new finding. Each finding now includes `rule_version`, a SHA-256 `source_digest` of its full canonical source item, and `disposition` (`new` or `debt`). Digests include all item metadata and full text, including text beyond the displayed excerpt. Any source-item change invalidates its acknowledgments; unrelated new items preserve existing debt. Rule semantics changes require a `RULE_VERSION` increment and invalidate older evidence.
|
|
174
|
+
|
|
175
|
+
```sh
|
|
176
|
+
pm lint --json --output-include item_id,rule,rule_version,source_digest
|
|
177
|
+
# Copy one observed finding's identity, version and digest; review its full source.
|
|
178
|
+
pm lint acknowledge --baseline lint-baseline.json \
|
|
179
|
+
--id project-abcd --rule PML002 --reason 'Legacy criteria debt; repair scheduled' \
|
|
180
|
+
--rule-version <observed-version> --source-digest <observed-sha256>
|
|
181
|
+
pm lint --baseline lint-baseline.json --json
|
|
182
|
+
pm lint --baseline lint-baseline.json \
|
|
183
|
+
--output-include item_id,rule,disposition --output-budget 2000
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Acknowledgment creates or updates only the named JSON file. It rechecks the complete tracker and refuses missing findings or changed evidence. A nonempty reason of at most 1,000 characters is required. There is no bulk acknowledgment or wildcard. Commit the reviewable baseline file alongside the policy decision. Cooperating CLI writers use an exclusive lock and atomic replacement; a busy lock returns a retry remedy. Do not edit the file concurrently with a command.
|
|
187
|
+
|
|
188
|
+
The baseline gate requires the complete tracker and all ten default rules. It refuses selection flags, severity/failure-threshold overrides, disabled rules and nondefault lint settings with `unsafe_policy`; restore default settings before using it. Output retains **all** findings and the ordinary per-rule summary, adds `debt_count`, `new_count`, `stale_count`, and labels each row. `stale_count` includes resolved findings and obsolete evidence; stale entries never count as debt. Exit `0` means no new findings, `1` means new findings at **any** severity (`fail_on: info`), and `2` is a typed baseline refusal with `code`, `message` and `remedy`. Malformed or missing baseline files fail closed. Host projection and continuation controls apply to baseline checks too.
|
|
189
|
+
|
|
190
|
+
The SDK exports `LintBaseline`, `Acknowledgment`, `BaselineRefusal`, `parseBaseline`, `sourceDigest`, `RULE_VERSION` and `acknowledgeFinding`. `lintItems(client, pmRoot, { baseline })` uses the same complete gate on any SDK tracker backend. SDK baseline refusals throw `BaselineRefusal`. CLI command handlers adapt them with `createPmCliExpectedError`: exit 2, the same domain code and message, and the remedy in `context.nextSteps`. The host owns error rendering and expected-error classification. This replaces the former successful-output `{ ok: false, refusal: { code, message, remedy } }` envelope; CLI consumers must read the native error diagnostic instead (on the error stream). Successful lint and acknowledgment receipts are unchanged. See [the SDK example](docs/baseline-example.md), [public-data validation](docs/baseline-validation.md) and [SDK adoption evidence](docs/sdk-adoption-validation.md). A baseline records an explicit authoring-debt decision; it does not certify that the finding or its reason is true.
|
|
191
|
+
|
|
192
|
+
## Acceptance-criterion witnesses
|
|
193
|
+
|
|
194
|
+
`pm lint witnesses --contract criterion-witnesses.json` checks the declared link
|
|
195
|
+
from **every** stored criterion to a linked test, a file observation, or explicitly
|
|
196
|
+
pending proof. It never runs code, reads a Git history, fetches URLs, or guesses
|
|
197
|
+
that prose establishes support. Core SDK criteria parsing and certified complete
|
|
198
|
+
reads apply to every lifecycle status, including closed and canceled items.
|
|
199
|
+
|
|
200
|
+
```sh
|
|
201
|
+
pm lint witnesses --contract criterion-witnesses.json --json
|
|
202
|
+
pm lint witnesses --contract criterion-witnesses.json \
|
|
203
|
+
--output-include item_id,criterion,state,citation --output-budget 2000
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
The strict version 1 JSON contract contains `bindings`, each with `item_id`, exact
|
|
207
|
+
`criterion` text, and a nonempty `witnesses` array. Unknown keys and duplicate
|
|
208
|
+
item/criterion bindings refuse. Criteria use core's semicolon boundaries; exact
|
|
209
|
+
text identity survives reordering and unrelated item edits. Every criterion
|
|
210
|
+
without a binding reports `missing`, even if its item contains tests or comments.
|
|
211
|
+
|
|
212
|
+
| Witness kind | Required fields beyond `kind` | Meaning |
|
|
213
|
+
| --- | --- | --- |
|
|
214
|
+
| `test` | `command` and/or `path`, `sha256`, `outcome` | Match one exact linked-test declaration; `sourceDigest(test)` binds all metadata, including provenance and assertions |
|
|
215
|
+
| `observation` | `path`, `sha256`, `outcome` | Hash the exact local artifact bytes with `observationDigest(bytes)` |
|
|
216
|
+
| `pending` | `reason` | Explicitly unfinished proof with a nonblank reason |
|
|
217
|
+
|
|
218
|
+
Test and observation outcomes are explicitly declared `pass` or `fail`. A
|
|
219
|
+
`supported` row means the reference and digest match the declaration. It does
|
|
220
|
+
**not** certify that a test ran, that an observation proves the criterion, or
|
|
221
|
+
that a claimed outcome is true. Digest refreshes require evidence review.
|
|
222
|
+
`pending` is visible unfinished work and always fails the gate.
|
|
223
|
+
|
|
224
|
+
| State | Interpretation |
|
|
225
|
+
| --- | --- |
|
|
226
|
+
| `supported` | Evidence reference and complete digest match a declared pass |
|
|
227
|
+
| `pending` | Proof is explicitly deferred |
|
|
228
|
+
| `missing` | Current criterion has no declared binding |
|
|
229
|
+
| `dangling` | Referenced item, linked test, or file does not exist |
|
|
230
|
+
| `stale` | Criterion text was removed/changed, or referenced evidence digest changed |
|
|
231
|
+
| `contradictory` | Outcome declares failure against the criterion, or test identity is ambiguous |
|
|
232
|
+
|
|
233
|
+
Each witness produces a row. A failing outcome plus stale/dangling evidence
|
|
234
|
+
produces both findings so neither condition hides the other. Mixed pass/fail
|
|
235
|
+
witnesses remain contradictory; passing evidence cannot suppress any failure or
|
|
236
|
+
pending proof. Removed-item bindings are dangling; removed-criterion bindings
|
|
237
|
+
are stale, and replacement criteria remain missing until explicitly bound.
|
|
238
|
+
|
|
239
|
+
Observation paths are relative to the evidence workspace. They retain exact
|
|
240
|
+
citation spelling, including `:line[:column]` or `#Lline[-Lline]`; the digest
|
|
241
|
+
covers the whole file. Traversal, absolute observation paths and symlinks escaping
|
|
242
|
+
the workspace refuse. Missing files are dangling; unreadable artifacts refuse.
|
|
243
|
+
Test paths are exact tracker identities, with no filesystem lookup.
|
|
244
|
+
|
|
245
|
+
The host renders TOON by default or JSON with `--json`. `findings` rows carry
|
|
246
|
+
`item_id`, `criterion`, `state`, exact `citation`, and a remedy. Rows sort by exact
|
|
247
|
+
UTF-16 `item_id`, `criterion`, `citation`, then `state`, independently of host locale
|
|
248
|
+
and declaration order. Unicode spellings are never normalized. Counts and summary
|
|
249
|
+
cover the full evaluation; host projection, budgets, row limits and cursor
|
|
250
|
+
continuations apply. `count` counts finding rows, `criteria_count` counts stored
|
|
251
|
+
criteria, and `corpus_count` counts certified items. Exit `0` means every finding is
|
|
252
|
+
`supported`, including when the tracker has no criteria (a contract binding for a
|
|
253
|
+
removed item still emits `dangling` and exits `1`), `1` means any
|
|
254
|
+
unfinished/invalid proof, and `2` means a typed refusal with `code`, `message` and
|
|
255
|
+
`remedy`. SDK input/I/O refusals throw `WitnessRefusal`; incomplete tracker reads
|
|
256
|
+
remain SDK errors and never become a passing empty corpus.
|
|
257
|
+
|
|
258
|
+
SDK exports include `lintWitnesses(client, contract, evidenceRoot)`,
|
|
259
|
+
`parseWitnessContract`, `readWitnessContract`, `observationDigest`,
|
|
260
|
+
`WitnessRefusal`, and typed contract/result interfaces. The sidecar and artifacts
|
|
261
|
+
are caller-owned local inputs; the client can target any supported tracker
|
|
262
|
+
backend. No witness command changes tracker data. See the
|
|
263
|
+
[SDK and JSON example](docs/witness-example.md) and
|
|
264
|
+
[public tracker validation](docs/witness-validation.md).
|
|
265
|
+
|
|
266
|
+
## Without git
|
|
267
|
+
|
|
268
|
+
Linting, incremental checkpoints, rule listing, acknowledgment, baseline checks and witness checks work in plain directory trackers without a git executable. These commands do not require repository history. The SDK baseline model is independent of git and tracker storage; CLI baseline and checkpoint files use the local filesystem.
|
|
269
|
+
|
|
270
|
+
| Code | Default severity | Default scope | Field | Checks |
|
|
271
|
+
| --- | --- | --- | --- | --- |
|
|
272
|
+
| PML001 | warn | non_terminal | title | Placeholder, under three words, or ticket-only title |
|
|
273
|
+
| PML002 | error | non_terminal | acceptance_criteria | Feature, Issue or Task lacks criteria |
|
|
274
|
+
| PML003 | warn | non_terminal | acceptance_criteria | Placeholder criterion, title restatement, or fewer than three words without an observable noun or verb |
|
|
275
|
+
| PML004 | error | closed | resolution | Missing closure evidence beyond the title |
|
|
276
|
+
| PML005 | warn | active | updated_at | Stale in-progress work or stale ownership without recent activity |
|
|
277
|
+
| PML006 | info | all | files | Feature has neither linked files nor linked tests |
|
|
278
|
+
| PML007 | warn | non_terminal | parent | Epic has no children in the complete tracker |
|
|
279
|
+
| PML008 | info | non_terminal | description | Description or notes only repeat the title |
|
|
280
|
+
| PML009 | error | blocked | blocked_reason | Missing blocker reason or unresolvable local blocker |
|
|
281
|
+
| PML010 | warn | active | title | Active titles form SDK duplicate clusters |
|
|
282
|
+
|
|
283
|
+
Authoring rules skip terminal history by default. `non_terminal` and `active` cover unfinished statuses, including blocked and draft. PML010 uses statuses carrying the SDK registry's active or blocked roles. Scope restricts which items emit findings; hierarchy and duplicate context still use the complete corpus. A per-rule `scope` setting changes that default; explicit `--status` takes precedence over settings and evaluates every enabled rule on the named lifecycle. Rule-specific conditions still apply (for example, PML002 checks only work types and PML005 checks working or owned work). Working statuses carry the active role without default-open; custom status names retain those semantics.
|
|
284
|
+
|
|
285
|
+
PML003 deliberately flags vague assertions rather than requiring every fragment to match a verb whitelist. `works`, `done`, `fixed`, `complete`, `ok`, `as expected`, `looks good`, `should work`, `TBD`, `N/A`, and `see description` are rejected, as are assertions identical to the title. Concrete examples such as `pm-cli-data.json regenerated`, `Any drifted snippet is corrected in all locales`, and `Publication and deployment state distinguished from candidate validation` pass. Semicolons and newlines delimit assertions; the first vague fragment produces one item-level finding. This conservative heuristic does not prove that an outcome is true or sufficiently specified.
|
|
286
|
+
|
|
287
|
+
Each rule is individually configurable. Heuristics are authoring prompts and do not certify the truth of item evidence. PML010 uses the public SDK `analyzeDuplicateItems` capability on the certified active corpus. It preserves the SDK scorer and candidate-pair safety bound. The SDK caps output at 1,000 clusters; reaching that cap causes an error because complete duplicate findings cannot be proven. A refused SDK analysis fails the command rather than reporting a passing gate.
|
|
288
|
+
|
|
289
|
+
Place a `lint` section in the tracker's `settings.json`:
|
|
290
|
+
|
|
291
|
+
```json
|
|
292
|
+
{
|
|
293
|
+
"lint": {
|
|
294
|
+
"enable": ["PML001"],
|
|
295
|
+
"disable": ["PML006"],
|
|
296
|
+
"failOn": "error",
|
|
297
|
+
"rules": {
|
|
298
|
+
"PML003": { "severity": "info", "scope": "all" },
|
|
299
|
+
"PML005": { "parameters": { "staleDays": 14 } },
|
|
300
|
+
"PML010": { "enabled": true, "parameters": { "threshold": 0.92 } }
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
All rules start enabled. Settings apply enable/disable lists, then per-rule entries, then CLI overrides. Supported severities are `error`, `warn`, and `info`. Supported scopes are `all`, `non_terminal`, `active`, `terminal`, `closed`, `canceled`, `open`, `in_progress`, and `blocked`. Lifecycle scopes use configured SDK registry roles: closed means terminal-done, canceled means terminal-canceled, open means default-open, and in-progress means active without default-open. `staleDays` must be finite and positive; duplicate `threshold` must be greater than zero and at most one. Unknown codes, parameters, keys and invalid values are errors. The current SDK strips custom sections from `readSettings`, so the package validates core settings through that API and retrieves the custom section using public SDK settings-path and storage helpers.
|
|
307
|
+
|
|
308
|
+
Exit code `0` means no finding met the failure threshold. Exit code `1` means one or more findings met it. Invalid arguments, settings, incomplete storage, or refused duplicate analysis cause a host error and nonzero exit, rather than a clean lint receipt.
|
|
309
|
+
|
|
310
|
+
A tracker quality gate can start with errors and progressively adopt warnings:
|
|
311
|
+
|
|
312
|
+
```yaml
|
|
313
|
+
- run: npm ci
|
|
314
|
+
- run: pm lint --fail-on error --json
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Run the host in a workspace where the package is activated. The package's own `release:check` covers identity/privacy, TypeScript, ESLint, jscpd, docstrings, all authored source coverage, production audit, package contents, changelog, release attestation and packed npm/native-Bun consumers. Scheduled and manual GitHub releases require `PM_RELEASE_APPROVED=true` on the canonical repository's main branch. Local npm publication remains a maintainer-authenticated action with prepublish checks.
|
|
318
|
+
|
|
319
|
+
Dogfood receipts, heuristic tuning decisions, coverage and behavioural revert proofs are recorded in the package tracker. The aggregate before/after corpus comparison and hand-checked PML003 sample are in [the dogfood report](docs/dogfood-round.md). Public evidence contains only aggregate counts and generic verdicts; raw titles, criteria and tracker configuration stay out of the repository.
|
|
320
|
+
|
|
321
|
+
## Portable organization authoring rules
|
|
322
|
+
|
|
323
|
+
`pm lint pack --pack authoring-rules.json` checks semantic authoring conventions
|
|
324
|
+
through the same certified complete reader as the built-in rules. It reads every
|
|
325
|
+
status, then applies the pack's explicit selectors. It does not change items or
|
|
326
|
+
settings. pm-presets can distribute configuration and templates; core owns field
|
|
327
|
+
types; this contract adds organization-specific assertions over canonical text.
|
|
328
|
+
See the shipped [example pack](examples/authoring-rules.json).
|
|
329
|
+
Measured public-data and adapter evidence is in the
|
|
330
|
+
[validation report](docs/portable-rule-packs-validation.md).
|
|
331
|
+
|
|
332
|
+
```sh
|
|
333
|
+
pm lint pack --pack examples/authoring-rules.json
|
|
334
|
+
pm lint pack --pack examples/authoring-rules.json --json
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
The strict version 1 contract is `{ "version": 1, "rules": [...] }`. Each rule
|
|
338
|
+
requires `id`, `field`, `predicate`, `severity`, `explanation`, and `remedy`.
|
|
339
|
+
Rule ids are unique, case-sensitive ASCII identifiers beginning with a letter;
|
|
340
|
+
subsequent characters may be letters, digits, `_`, `.` or `-`. Unknown keys fail
|
|
341
|
+
at every level, including predicates and selectors; unknown versions fail closed.
|
|
342
|
+
|
|
343
|
+
| Property | Version 1 semantics |
|
|
344
|
+
| --- | --- |
|
|
345
|
+
| `field` | `title`, `description`, `acceptance_criteria`, `definition_of_ready`, `resolution`, `blocked_reason`, `outcome`, `value`, `why_now` |
|
|
346
|
+
| `predicate` | `{ "op": "present" }`, or `{ "op": "contains" / "not_contains" / "starts_with", "value": "literal" }`, or `{ "op": "min_length" / "max_length", "value": integer }` |
|
|
347
|
+
| `severity` | `info`, `warn`, `error`; only failed `error` assertions fail the gate |
|
|
348
|
+
| `explanation`, `remedy` | Required nonblank organization-authored diagnostic text, at most 256 characters each |
|
|
349
|
+
| `when` | Optional object with `statuses` and/or `types` exact string arrays; OR within each array, AND between them; no selector means all items |
|
|
350
|
+
|
|
351
|
+
Matching is case-sensitive and literal, including characters such as `*` and `+`.
|
|
352
|
+
Missing text fields behave as empty strings. `present` tests trimmed nonemptiness;
|
|
353
|
+
other predicates use the original text. Length counts UTF-16 code units.
|
|
354
|
+
Regex, glob and executable expression modes refuse with `unsafe_pattern` and a
|
|
355
|
+
literal-predicate remedy. There are no imports, nested expressions or commands.
|
|
356
|
+
|
|
357
|
+
Hard ceilings are 64 KiB of UTF-8 JSON, 64 rules, 64 characters per id/selector,
|
|
358
|
+
32 values per selector list, 512 characters per literal, 65,536 characters per
|
|
359
|
+
checked item field or length threshold, 100,000 potential item/rule pairs before
|
|
360
|
+
selection, and 1,000 findings. Empty rule/selector arrays refuse. Exceeding a
|
|
361
|
+
ceiling returns `limit_exceeded`; no partial result can pass. For SDK input the
|
|
362
|
+
byte ceiling applies to the detached canonical pack; for files it also applies
|
|
363
|
+
to the raw bytes, including whitespace. Regular files only are accepted.
|
|
364
|
+
|
|
365
|
+
Rows contain `item_id`, `rule`, `field`, `severity`, `explanation` and `remedy`.
|
|
366
|
+
They sort by exact item id then rule id, independent of locale, declaration order
|
|
367
|
+
and storage order. Receipts include corpus/check/finding counts, severity counts
|
|
368
|
+
and core's complete-list certificate. Item titles and text are not copied into
|
|
369
|
+
rows. Host output budgets and continuation controls apply to `findings` in TOON
|
|
370
|
+
and JSON. Exit codes are 0 for no error findings, 1 for error findings, and 2 for
|
|
371
|
+
typed pack refusals (`invalid_pack`, `unsafe_pattern`, `limit_exceeded`, `pack_io`).
|
|
372
|
+
Core read/certification failures retain core's diagnostic instead of becoming a
|
|
373
|
+
successful or partial pack result. Baseline acknowledgments do not suppress pack
|
|
374
|
+
rules; they belong to the separate built-in lint command.
|
|
375
|
+
|
|
376
|
+
```ts
|
|
377
|
+
import { PmClient } from '@unbrained/pm-cli/sdk';
|
|
378
|
+
import { lintRulePack, readRulePack, RulePackRefusal } from '@unbrained/pm-lint';
|
|
379
|
+
import type { RulePack } from '@unbrained/pm-lint';
|
|
380
|
+
|
|
381
|
+
const pack: RulePack = await readRulePack('authoring-rules.json');
|
|
382
|
+
try {
|
|
383
|
+
const result = await lintRulePack(new PmClient({ pmRoot: '.agents/pm' }), pack);
|
|
384
|
+
console.log(result.summary, result.exit_code);
|
|
385
|
+
} catch (error) {
|
|
386
|
+
if (error instanceof RulePackRefusal) console.error(error.code, error.remedy);
|
|
387
|
+
else throw error;
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
`parseRulePack(unknown)` validates SDK-supplied data. `lintRulePack` accepts the
|
|
392
|
+
`listAllComplete` portion of the typed `PmClient` contract so adapters can supply
|
|
393
|
+
the same certified canonical metadata without filesystem access in the evaluator.
|
|
394
|
+
Tests compare real TOON and legacy JSON Markdown reader results; the pinned host
|
|
395
|
+
migrates legacy Markdown during reading. These tests do not attest hosted database
|
|
396
|
+
or network deployment. Pack semantics never inspect storage paths or invoke git.
|
|
397
|
+
|
|
398
|
+
## Without git
|
|
399
|
+
|
|
400
|
+
All lint commands, baselines, witness validation and portable packs work in a
|
|
401
|
+
plain tracker directory. No lint command requires a git repository. Package
|
|
402
|
+
release changelog generation uses git tags separately from tracker linting.
|
|
403
|
+
|
|
404
|
+
## Minimal authoring repair previews
|
|
405
|
+
|
|
406
|
+
`pm lint repair --id pm-example-abcd --json` returns one revision-bound patch
|
|
407
|
+
and explicit questions. `--revision <sha256>` refuses saved context after a
|
|
408
|
+
source edit. TOON is the default; JSON uses the same compact receipt. A successful
|
|
409
|
+
preview exits 0 even when questions remain. Typed refusals exit 2 with a code and
|
|
410
|
+
remedy; incomplete SDK reads remain errors.
|
|
411
|
+
|
|
412
|
+
The only patches are title-edge whitespace and SDK tag normalization (including
|
|
413
|
+
duplicates). Blank titles, missing or vague acceptance criteria, absent Issue
|
|
414
|
+
expected behavior, and other lint findings stay questions. Markdown body,
|
|
415
|
+
criteria, relationships, status, ownership and evidence are never authored.
|
|
416
|
+
Patches are limited to 16 KiB and one target per invocation. `remaining_mechanical`
|
|
417
|
+
is the projected mechanical count; `validation` carries core's disposable semantic
|
|
418
|
+
validation and its unresolved commit constraints. This does not certify substantive
|
|
419
|
+
answers or future application.
|
|
420
|
+
|
|
421
|
+
`previewAuthoringRepairs(pmRoot, { id, revision? })` exposes the same typed SDK
|
|
422
|
+
receipt and throws `RepairRefusal` with `code` and `remedy`. Revisions bind original
|
|
423
|
+
item bytes and all SDK-read native fields; plan keys also bind the certified
|
|
424
|
+
corpus and lint configuration. Every invocation reads fresh state. There is no
|
|
425
|
+
apply, saved-plan import, sync, journal recovery or background worker. A consumer
|
|
426
|
+
that applies a patch must revalidate the target revision under its SDK mutation
|
|
427
|
+
preconditions immediately before writing.
|
|
428
|
+
|
|
429
|
+
SDK reads can create caches and migrate legacy documents, so all reads and core
|
|
430
|
+
mutation validation run in an owned temporary snapshot. Source fingerprints
|
|
431
|
+
reject concurrent edits; preview leaves source files, caches, history and journals
|
|
432
|
+
unchanged. Foreign runtime, lock, journal, checkpoint, search and executable extension state is excluded with
|
|
433
|
+
reasons in `excluded_state`; no peer record is replayed or deleted. Scratch files
|
|
434
|
+
are removed when the invocation finishes. Referenced schema must stay in retained tracker directories (for example `schema/`); references into excluded operational state refuse rather than falling back to defaults. Configuration and regular native
|
|
435
|
+
tracker files are required; unsafe filesystem entries refuse with a remedy.
|
|
436
|
+
|
|
437
|
+
Repair previews work in plain directory trackers without git. They require local
|
|
438
|
+
tracker storage for byte-bound evidence; hosted database/network execution is not
|
|
439
|
+
attested. See [the SDK example](docs/repair-preview-example.md) and
|
|
440
|
+
[validation evidence](docs/repair-preview-validation.md).
|
|
441
|
+
|
|
442
|
+
Every workflow job granted write permissions, including CodeQL, Dependabot and
|
|
443
|
+
reusable workflow calls, requires the exact repository `unbraind/pm-lint`.
|
|
444
|
+
The approval variable controls GitHub releases; it does not impose a local npm
|
|
445
|
+
publishing hold. Maintainers run the prepublish checks and authenticate with npm
|
|
446
|
+
for local publication. The first local publish uses `--provenance=false`; daily
|
|
447
|
+
GitHub OIDC releases keep provenance enabled.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ExtensionApi } from '@unbrained/pm-cli/sdk/authoring';
|
|
2
|
+
/** Expose complete incremental scans using caller-injected native SDK capabilities. */
|
|
3
|
+
export { lintIncremental, incrementalRuleVersion } from './src/incremental.ts';
|
|
4
|
+
export type { IncrementalLintSource, IncrementalLintResult, IncrementalBoundary } from './src/incremental.ts';
|
|
5
|
+
/** Expose strict portable checkpoint contracts and dependency declarations. */
|
|
6
|
+
export { parseIncrementalCheckpoint, parseIncrementalRequest, IncrementalRefusal, INCREMENTAL_LIMITS, RULE_DEPENDENCIES } from './src/incremental-contract.ts';
|
|
7
|
+
export type { IncrementalCheckpoint, IncrementalRequest, IncrementalCursor, IncrementalItemState, IncrementalRefusalCode, RuleDependency } from './src/incremental-contract.ts';
|
|
8
|
+
/** Expose the optional local checkpoint adapter; hosted callers keep their own compare-and-set storage. */
|
|
9
|
+
export { filesystemLintSource, lintIncrementalFile, readIncrementalCheckpoint } from './src/incremental-file.ts';
|
|
10
|
+
export type { IncrementalFileBoundary } from './src/incremental-file.ts';
|
|
11
|
+
export type { LintStatusRegistry } from './src/statuses.ts';
|
|
12
|
+
/** Expose bounded revision-bound authoring previews and typed refusals. */
|
|
13
|
+
export { previewAuthoringRepairs, RepairRefusal } from './src/repairs.ts';
|
|
14
|
+
/** Expose mechanical patches and explicit author-question contracts. */
|
|
15
|
+
export type { RepairRequest, RepairPatch, RepairPreview, RepairQuestion, RepairRefusalCode, MechanicalFinding, RepairBoundary, RepairPreviewOptions } from './src/repairs.ts';
|
|
16
|
+
/** Expose portable organization rules, bounded parsing and typed recovery guidance. */
|
|
17
|
+
export { lintRulePack, parseRulePack, readRulePack, RulePackRefusal, RULE_PACK_FIELDS, RULE_PACK_LIMITS } from './src/rule-pack.ts';
|
|
18
|
+
/** Expose the versioned semantic contract and compact diagnostic receipt. */
|
|
19
|
+
export type { AuthoringPredicate, AuthoringRule, RulePack, RulePackFinding, RulePackResult, RulePackRefusalCode } from './src/rule-pack.ts';
|
|
20
|
+
/** Expose portable acceptance witness validation and strict contract parsing. */
|
|
21
|
+
export { lintWitnesses, parseWitnessContract, readWitnessContract, observationDigest, WitnessRefusal } from './src/witnesses.ts';
|
|
22
|
+
/** Expose explicit criterion, evidence, refusal and receipt contracts. */
|
|
23
|
+
export type { CriterionWitness, CriterionBinding, WitnessContract, WitnessState, WitnessFinding, WitnessResult, WitnessRefusalCode } from './src/witnesses.ts';
|
|
24
|
+
/** Expose portable evidence-backed baseline operations and typed refusals. */
|
|
25
|
+
export { acknowledgeFinding, BaselineRefusal, parseBaseline, RULE_VERSION, sourceDigest } from './src/baseline.ts';
|
|
26
|
+
/** Expose baseline contracts for agents using any tracker backend. */
|
|
27
|
+
export type { Acknowledgment, BaselineRefusalCode, LintBaseline } from './src/baseline.ts';
|
|
28
|
+
/** Expose the same complete-reader engine used by the host command. */
|
|
29
|
+
export { lintItems, SEVERITY_RANK } from './src/engine.ts';
|
|
30
|
+
/** Expose strict settings resolution for embedded consumers. */
|
|
31
|
+
export { resolveConfig, scopeValue, RULE_SCOPES } from './src/settings.ts';
|
|
32
|
+
/** Expose the documented stable authoring rule registry. */
|
|
33
|
+
export { RULES } from './src/rules.ts';
|
|
34
|
+
/** Expose diagnostic and configuration contracts without a second data model. */
|
|
35
|
+
export type { Finding, RuleCode, RuleScope, RuleConfig, LintConfig, Severity } from './src/types.ts';
|
|
36
|
+
/** Expose engine selection options to embedded callers. */
|
|
37
|
+
export type { LintOptions } from './src/settings.ts';
|
|
38
|
+
/** Expose the certified lint receipt contract. */
|
|
39
|
+
export type { LintResult } from './src/engine.ts';
|
|
40
|
+
/** Expose the rule table listing contract behind `pm lint rules`. */
|
|
41
|
+
export type { RuleListing, RulesResult } from './src/commands.ts';
|
|
42
|
+
/** Activate read-only item linting through the host command registry. */
|
|
43
|
+
declare const _default: {
|
|
44
|
+
name: string;
|
|
45
|
+
version: string;
|
|
46
|
+
description: string;
|
|
47
|
+
/** Register one observational command; the package never mutates items. */
|
|
48
|
+
activate(api: ExtensionApi): void;
|
|
49
|
+
};
|
|
50
|
+
export default _default;
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAOpE,uFAAuF;AACvF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC9G,+EAA+E;AAC/E,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC/J,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAChL,2GAA2G;AAC3G,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACjH,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,2EAA2E;AAC3E,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC1E,wEAAwE;AACxE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE9K,uFAAuF;AACvF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACpI,6EAA6E;AAC7E,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE5I,iFAAiF;AACjF,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACjI,0EAA0E;AAC1E,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE/J,8EAA8E;AAC9E,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACnH,sEAAsE;AACtE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE3F,uEAAuE;AACvE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,gEAAgE;AAChE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC3E,4DAA4D;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,iFAAiF;AACjF,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrG,2DAA2D;AAC3D,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,kDAAkD;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,qEAAqE;AACrE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAElE,yEAAyE;;;;;IAGvE,2EAA2E;kBAC7D,YAAY,GAAG,IAAI"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineExtension } from '@unbrained/pm-cli/sdk/authoring';
|
|
2
|
+
import { registerLintCommand } from './src/commands.js';
|
|
3
|
+
import { registerWitnessCommand } from './src/witness-command.js';
|
|
4
|
+
import { registerRepairCommand } from './src/repair-command.js';
|
|
5
|
+
import { registerRulePackCommand } from './src/rule-pack-command.js';
|
|
6
|
+
import { registerIncrementalCommand } from './src/incremental-command.js';
|
|
7
|
+
/** Expose complete incremental scans using caller-injected native SDK capabilities. */
|
|
8
|
+
export { lintIncremental, incrementalRuleVersion } from './src/incremental.js';
|
|
9
|
+
/** Expose strict portable checkpoint contracts and dependency declarations. */
|
|
10
|
+
export { parseIncrementalCheckpoint, parseIncrementalRequest, IncrementalRefusal, INCREMENTAL_LIMITS, RULE_DEPENDENCIES } from './src/incremental-contract.js';
|
|
11
|
+
/** Expose the optional local checkpoint adapter; hosted callers keep their own compare-and-set storage. */
|
|
12
|
+
export { filesystemLintSource, lintIncrementalFile, readIncrementalCheckpoint } from './src/incremental-file.js';
|
|
13
|
+
/** Expose bounded revision-bound authoring previews and typed refusals. */
|
|
14
|
+
export { previewAuthoringRepairs, RepairRefusal } from './src/repairs.js';
|
|
15
|
+
/** Expose portable organization rules, bounded parsing and typed recovery guidance. */
|
|
16
|
+
export { lintRulePack, parseRulePack, readRulePack, RulePackRefusal, RULE_PACK_FIELDS, RULE_PACK_LIMITS } from './src/rule-pack.js';
|
|
17
|
+
/** Expose portable acceptance witness validation and strict contract parsing. */
|
|
18
|
+
export { lintWitnesses, parseWitnessContract, readWitnessContract, observationDigest, WitnessRefusal } from './src/witnesses.js';
|
|
19
|
+
/** Expose portable evidence-backed baseline operations and typed refusals. */
|
|
20
|
+
export { acknowledgeFinding, BaselineRefusal, parseBaseline, RULE_VERSION, sourceDigest } from './src/baseline.js';
|
|
21
|
+
/** Expose the same complete-reader engine used by the host command. */
|
|
22
|
+
export { lintItems, SEVERITY_RANK } from './src/engine.js';
|
|
23
|
+
/** Expose strict settings resolution for embedded consumers. */
|
|
24
|
+
export { resolveConfig, scopeValue, RULE_SCOPES } from './src/settings.js';
|
|
25
|
+
/** Expose the documented stable authoring rule registry. */
|
|
26
|
+
export { RULES } from './src/rules.js';
|
|
27
|
+
/** Activate read-only item linting through the host command registry. */
|
|
28
|
+
export default defineExtension({
|
|
29
|
+
name: 'pm-lint', version: "2026.10.28", description: 'Authoring-quality rules for useful pm context',
|
|
30
|
+
/** Register one observational command; the package never mutates items. */
|
|
31
|
+
activate(api) { registerLintCommand(api); registerWitnessCommand(api); registerRulePackCommand(api); registerRepairCommand(api); registerIncrementalCommand(api); },
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,uFAAuF;AACvF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,+EAA+E;AAC/E,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAE/J,2GAA2G;AAC3G,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAIjH,2EAA2E;AAC3E,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAI1E,uFAAuF;AACvF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAIpI,iFAAiF;AACjF,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIjI,8EAA8E;AAC9E,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAInH,uEAAuE;AACvE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,gEAAgE;AAChE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC3E,4DAA4D;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAUvC,yEAAyE;AACzE,eAAe,eAAe,CAAC;IAC7B,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,+CAA+C;IACpG,2EAA2E;IAC3E,QAAQ,CAAC,GAAiB,IAAU,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,0BAA0B,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACxL,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Acknowledgment, LintBaseline } from './baseline.ts';
|
|
2
|
+
import type { Finding } from './types.ts';
|
|
3
|
+
/** Read an explicit baseline; only acknowledgment creation may start from a missing file. */
|
|
4
|
+
export declare function readBaseline(path: string, allowMissing?: boolean): Promise<LintBaseline>;
|
|
5
|
+
/** Serialize cooperating writers with exclusive creation and publish one complete atomic document. */
|
|
6
|
+
export declare function acknowledgeBaselineFile(path: string, findings: readonly Finding[], request: Acknowledgment): Promise<LintBaseline>;
|
|
7
|
+
//# sourceMappingURL=baseline-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseline-file.d.ts","sourceRoot":"","sources":["../../src/baseline-file.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,6FAA6F;AAC7F,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,UAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAS5F;AAWD,sGAAsG;AACtG,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAcxI"}
|