@plurnk/plurnk-plurnkdown 1.14.2 → 1.16.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.
- package/README.md +1 -1
- package/SPEC.md +12 -17
- package/dist/PacketLint.d.ts +2 -1
- package/dist/PacketLint.d.ts.map +1 -1
- package/dist/Plurnkdown.js +7 -7
- package/dist/Plurnkdown.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Plurnkdown — the [plurnk-service](https://github.com/plurnk/plurnk-service) pa
|
|
|
5
5
|
[`SPEC.md`](./SPEC.md) is the tagged Markdown contract for outbound packets. The linter enforces
|
|
6
6
|
its three diagnostic rules:
|
|
7
7
|
|
|
8
|
-
- `op-fence` — a bare Plurnk op in prose belongs in
|
|
8
|
+
- `op-fence` — a bare Plurnk op in prose belongs in an `example` fence.
|
|
9
9
|
- `op-syntax` — fenced ops parse statement-level via `@plurnk/plurnk-contracts`.
|
|
10
10
|
- `run-on` — soft-warn on multi-compound run-ons; prose stays atomic (split, don't weld).
|
|
11
11
|
|
package/SPEC.md
CHANGED
|
@@ -52,9 +52,9 @@ flowchart LR
|
|
|
52
52
|
| `definition` | system | Bare `plurnk.md`; no wrapper heading | {§definition-table-projection} |
|
|
53
53
|
| `system-policy` | system | Authored Markdown | {§policy-sections} |
|
|
54
54
|
| `project-policy` | system | Authored Markdown | {§policy-sections} |
|
|
55
|
-
| `schemes` | system | `
|
|
55
|
+
| `schemes` | system | `example` fence | {§schemes-directory} |
|
|
56
56
|
| `inject` | system | Authored Markdown | {§packet-inject} |
|
|
57
|
-
| `log` | user |
|
|
57
|
+
| `log` | user | Markdown H3 records with JSON metadata | {§log-wire-format} |
|
|
58
58
|
| `child-streams` | user | `* <status> <path>` pointers | {§child-orientation} |
|
|
59
59
|
| `child-workers` | user | `* <status> <path>` pointers | {§child-orientation} |
|
|
60
60
|
| `errors` | user | `* <status> log:///<coordinate>` pointers | {§operation-results} |
|
|
@@ -77,29 +77,24 @@ Plurnkdown preserves the semantic evidence supplied by section owners.
|
|
|
77
77
|
| Addressability | Paths, URI fragments, log coordinates, scopes, and coordinate-prefixed body lines remain usable without translation. |
|
|
78
78
|
| Weighability | The Budget line and log-row `tokens` / `itemsTokenTotal` values remain attached to the artifacts they measure. |
|
|
79
79
|
| Honesty | Statuses, Problems, body visibility, chunk extents, and bodyless rows render as produced; presentation never upgrades or suppresses truth. |
|
|
80
|
-
| Structure |
|
|
80
|
+
| Structure | Operation examples remain typed fences; Log identities, metadata, and coordinate lines retain their record boundaries. |
|
|
81
81
|
|
|
82
82
|
## §packet-operation-fences PLURNK operation fences
|
|
83
83
|
|
|
84
|
-
Model-facing operation examples use fenced blocks with the `
|
|
85
|
-
PLURNK operation heading outside such a fence is an `op-fence` error. Each `
|
|
84
|
+
Model-facing operation examples use fenced blocks with the `example` info string. A structural
|
|
85
|
+
PLURNK operation heading outside such a fence is an `op-fence` error. Each `example` fence is parsed statement-by-statement by
|
|
86
86
|
`@plurnk/plurnk-contracts`; bounded diagnostics and {§unparsed-tail-boundary} surface as
|
|
87
87
|
`op-syntax` diagnostics under {§parse-diagnostics}.
|
|
88
88
|
|
|
89
89
|
Inline code may name a short operation form without becoming a block example. Other code-fence
|
|
90
90
|
languages are opaque to the PLURNK syntax check.
|
|
91
91
|
|
|
92
|
-
## §packet-
|
|
92
|
+
## §packet-log-records Log records
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
spaces. The closing quote appears at column zero before
|
|
99
|
-
either the object close or a following `chunk` member.
|
|
100
|
-
Coordinate prefixes keep source backticks out of the CommonMark closing-fence position, so content
|
|
101
|
-
cannot close the fixed fence. `@plurnk/plurnk-contracts` owns the deterministic transform that
|
|
102
|
-
recovers strict JSON.
|
|
94
|
+
Plurnkdown preserves Core's {§log-wire-format}: one `log:///` H3 identity, one strict JSON metadata
|
|
95
|
+
line, then any coordinate-prefixed body lines. One blank line separates records. It adds no fence,
|
|
96
|
+
wrapper, prose, or escaping. Because every body line begins with a numeric or anchored coordinate,
|
|
97
|
+
source headings and blank lines cannot become record boundaries.
|
|
103
98
|
|
|
104
99
|
## §packet-atomic-prose Atomic prose
|
|
105
100
|
|
|
@@ -117,8 +112,8 @@ document-size limit.
|
|
|
117
112
|
|
|
118
113
|
| Rule | Severity | Trigger |
|
|
119
114
|
| ----------- | ---------------- | -------------------------------------------------------------------------- |
|
|
120
|
-
| `op-fence` | error | A PLURNK operation heading occurs outside
|
|
121
|
-
| `op-syntax` | error or warning |
|
|
115
|
+
| `op-fence` | error | A PLURNK operation heading occurs outside an `example` fence. |
|
|
116
|
+
| `op-syntax` | error or warning | An `example` fence contains a parser diagnostic, advisory, or unparsed tail.|
|
|
122
117
|
| `run-on` | warning | Paragraph prose crosses an atomic-prose threshold. |
|
|
123
118
|
|
|
124
119
|
`PacketLint.lintDir` evaluates byte-exact digest files named
|
package/dist/PacketLint.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Diagnostic } from "./types.ts";
|
|
2
|
-
|
|
2
|
+
interface PacketFinding extends Diagnostic {
|
|
3
3
|
file: string;
|
|
4
4
|
}
|
|
5
5
|
export interface PacketLintResult {
|
|
@@ -9,4 +9,5 @@ export interface PacketLintResult {
|
|
|
9
9
|
export default class PacketLint {
|
|
10
10
|
static lintDir(dir: string): PacketLintResult;
|
|
11
11
|
}
|
|
12
|
+
export {};
|
|
12
13
|
//# sourceMappingURL=PacketLint.d.ts.map
|
package/dist/PacketLint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PacketLint.d.ts","sourceRoot":"","sources":["../src/PacketLint.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,
|
|
1
|
+
{"version":3,"file":"PacketLint.d.ts","sourceRoot":"","sources":["../src/PacketLint.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,UAAU,aAAc,SAAQ,UAAU;IACtC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC7B;AAGD,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAQ5C;CACJ"}
|
package/dist/Plurnkdown.js
CHANGED
|
@@ -11,7 +11,7 @@ export default class Plurnkdown {
|
|
|
11
11
|
const diagnostics = [];
|
|
12
12
|
let line = 1;
|
|
13
13
|
for (const token of Lexer.lex(source)) {
|
|
14
|
-
if (token.type === "code" && token.lang === "
|
|
14
|
+
if (token.type === "code" && token.lang === "example") {
|
|
15
15
|
this.#checkFencedOps(token.text, line, diagnostics);
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
@@ -27,20 +27,20 @@ export default class Plurnkdown {
|
|
|
27
27
|
// it as a heading, not prose, so inspect every non-fence block. {§op-shapes}
|
|
28
28
|
#checkBareOps(token, line, diagnostics) {
|
|
29
29
|
token.raw.split("\n").forEach((text, index) => {
|
|
30
|
-
const match = /^(#{
|
|
30
|
+
const match = /^(#{2,3}) ([A-Z]+)[A-Za-z0-9_]*(?=$|[ \t])/.exec(text);
|
|
31
31
|
if (match === null)
|
|
32
32
|
return;
|
|
33
33
|
const [, marks, op] = match;
|
|
34
34
|
const isProtocolHeading = op === "PLAN"
|
|
35
|
-
? marks === "
|
|
36
|
-
: marks === "
|
|
37
|
-
const isClientHeading = marks === "
|
|
35
|
+
? marks === "##"
|
|
36
|
+
: marks === "###" && PROTOCOL_OPS.has(op);
|
|
37
|
+
const isClientHeading = marks === "###" && CLIENT_OPS.has(op);
|
|
38
38
|
if (!isProtocolHeading && !isClientHeading)
|
|
39
39
|
return;
|
|
40
40
|
diagnostics.push({
|
|
41
41
|
rule: "op-fence",
|
|
42
42
|
severity: "error",
|
|
43
|
-
message: "Bare Plurnk op in prose; wrap it in
|
|
43
|
+
message: "Bare Plurnk op in prose; wrap it in an ```example fence.",
|
|
44
44
|
line: line + index,
|
|
45
45
|
column: 1,
|
|
46
46
|
});
|
|
@@ -70,7 +70,7 @@ export default class Plurnkdown {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
// Delegate
|
|
73
|
+
// Delegate an ```example fence's ops to the contracts grammar; surface every diagnostic and
|
|
74
74
|
// tail at its absolute point. Fence line 1 sits below the opener. {§packet-operation-fences}
|
|
75
75
|
#checkFencedOps(text, line, diagnostics) {
|
|
76
76
|
const parsed = PlurnkParser.parseStatements(text);
|
package/dist/Plurnkdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plurnkdown.js","sourceRoot":"","sources":["../src/Plurnkdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA2B,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGpE,MAAM,WAAW,GAAG,GAAG,CAAC,CAAC,wCAAwC;AACjE,MAAM,UAAU,GAAG,GAAG,CAAC,CAAE,wDAAwD;AACjF,MAAM,YAAY,GAAG,IAAI,GAAG,CAAS,UAAU,CAAC,CAAC;AACjD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7C,6EAA6E;AAC7E,6FAA6F;AAC7F,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,IAAI,CAAC,MAAc;QACf,MAAM,WAAW,GAAiB,EAAE,CAAC;QACrC,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACpC,IAAI,KA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K,CAAC,MAAM;aACvB,CAAC,CAAC;QACP,CAAC;QACD,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACpC,WAAW,CAAC,IAAI,CAAC;gBACb,IAAI,EAAE,WAAW;gBACjB,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,MAAM,CAAC,YAAY,CAAC,MAAM;gBACnC,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI;gBAC1C,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM;aAC1C,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAED,YAAY,CAAC,MAAe;QACxB,IAAI,GAAG,GAAG,EAAE,CAAC;QACb,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YACzB,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI;gBAAE,SAAS;YAClC,MAAM,QAAQ,GAAI,KAA8B,CAAC,MAAM,CAAC;YACxD,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAAC,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAAC,SAAS;YAAC,CAAC;YACtF,MAAM,IAAI,GAAG,KAAwC,CAAC;YACtD,GAAG,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;QACvC,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC;IAED,SAAS,CAAC,GAAW;QACjB,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IACtC,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-plurnkdown",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "Plurnkdown — the plurnk packet house style (GFM + Mermaid + fenced Plurnk ops) and its linter.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plurnk",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"node": ">=26"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@plurnk/plurnk-contracts": "1.
|
|
17
|
+
"@plurnk/plurnk-contracts": "1.16.0",
|
|
18
18
|
"marked": "^18.0.5"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|