@intentset/publisher 0.12.0 → 0.14.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 +3 -1
- package/dist/generate.d.ts +5 -4
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +0 -1
- package/dist/generate.js.map +1 -1
- package/dist/help.d.ts +3 -0
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +3 -1
- package/dist/publish.js.map +1 -1
- package/dist/review.d.ts +21 -3
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +32 -6
- package/dist/review.js.map +1 -1
- package/package.json +3 -3
- package/src/generate.ts +5 -5
- package/src/help.ts +3 -0
- package/src/index.ts +3 -0
- package/src/publish.ts +3 -1
- package/src/review.ts +35 -6
package/README.md
CHANGED
|
@@ -25,7 +25,9 @@ installed. The command is always `@intentset/cli`'s: this package has no `intent
|
|
|
25
25
|
for `intentset` alone would fetch an unrelated unscoped package from the registry.
|
|
26
26
|
|
|
27
27
|
From code, `publish(graph, registries, request, { snapshot, publishedAt })` returns the documents, the index, the help
|
|
28
|
-
file and the diagnostics, and refuses the whole request when any field is missing or undeclared (PUB001).
|
|
28
|
+
file and the diagnostics, and refuses the whole request when any field is missing or undeclared (PUB001). The
|
|
29
|
+
snapshot, the commit and graph hash the run read, is named once, in the index and the help file; each document pins
|
|
30
|
+
what it was made from by its sources' hashes, so its bytes change only when those sources do.
|
|
29
31
|
`@intentset/help` reads the help file in the product.
|
|
30
32
|
|
|
31
33
|
## Learn more
|
package/dist/generate.d.ts
CHANGED
|
@@ -13,14 +13,17 @@
|
|
|
13
13
|
* path appears only in a projection that admits internal records; sources
|
|
14
14
|
* outside the projection are counted, not named; availability is the
|
|
15
15
|
* request's own values, so a document does not list the other editions,
|
|
16
|
-
* roles or releases its knowledge also serves.
|
|
16
|
+
* roles or releases its knowledge also serves. The block carries no snapshot:
|
|
17
|
+
* that is the same for every document in a run and moves with any record in
|
|
18
|
+
* the model, so the run names it once, in the help file and the index
|
|
19
|
+
* (publication §2, §5; ADR 0019), and a document's bytes change only when what
|
|
20
|
+
* it was made from does.
|
|
17
21
|
*
|
|
18
22
|
* The result is checked as Markset before it is emitted: a Markset error is
|
|
19
23
|
* PUB003, and a `:::` directive outside Markset's vocabulary is PUB004
|
|
20
24
|
* (CLAUDE.md invariant 5: profiles never add a directive).
|
|
21
25
|
*/
|
|
22
26
|
import type { Artifact, Diagnostic, Graph, Visibility } from "@intentset/core";
|
|
23
|
-
import type { Snapshot } from "./project.ts";
|
|
24
27
|
import { type PublicationRequest } from "./request.ts";
|
|
25
28
|
export declare const PUBLICATION_PROFILE = "intentset/publication/0.2";
|
|
26
29
|
/** The top-level frontmatter key of a generated document. */
|
|
@@ -45,7 +48,6 @@ export interface PublicationMeta {
|
|
|
45
48
|
sources: SourceStamp[];
|
|
46
49
|
/** How many explained artifacts are outside the projection and so not named. */
|
|
47
50
|
withheldSources: number;
|
|
48
|
-
snapshot: Snapshot;
|
|
49
51
|
audience: string;
|
|
50
52
|
/** The request's values, and the flags the knowledge requires (every one of them named by the request). */
|
|
51
53
|
availability: {
|
|
@@ -60,7 +62,6 @@ export interface PublicationMeta {
|
|
|
60
62
|
publishedAt: string;
|
|
61
63
|
}
|
|
62
64
|
export interface GenerateOptions {
|
|
63
|
-
snapshot: Snapshot;
|
|
64
65
|
publishedAt: string;
|
|
65
66
|
}
|
|
66
67
|
export interface GeneratedDocument {
|
package/dist/generate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAA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;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,eAAe,CAAC;CAC9B;AAED,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,8GAA8G;AAC9G,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,eAAe,GACvB,eAAe,CAqCjB;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CASnH;AAED,kFAAkF;AAClF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,eAAe,GACvB;IAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAAC,WAAW,EAAE,UAAU,EAAE,CAAA;CAAE,CA0BnE;AAED,iGAAiG;AACjG,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,UAAU,EAAE,CAsEtG"}
|
package/dist/generate.js
CHANGED
|
@@ -40,7 +40,6 @@ export function publicationMeta(graph, artifact, request, options) {
|
|
|
40
40
|
source,
|
|
41
41
|
sources,
|
|
42
42
|
withheldSources,
|
|
43
|
-
snapshot: { commit: options.snapshot.commit, graphHash: options.snapshot.graphHash },
|
|
44
43
|
audience: request.audience,
|
|
45
44
|
availability: {
|
|
46
45
|
product: request.product,
|
package/dist/generate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"
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CAAC;IACrD,CAAC,CAAC;IACF,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAElB,IAAI,MAAM,CAAC,WAAW,EAAE,OAAO,KAAK,CAAC,EAAE,CAAC;QACtC,WAAW,CAAC,IAAI,CACd,qBAAqB,CAAC;YACpB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,OAAO,EAAE,iCAAiC,EAAE,sCAAsC;YAClF,WAAW,EACT,wGAAwG;SAC3G,CAAC,CACH,CAAC;IACJ,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;QAC1D,IAAI,CAAC,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,IAAI,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAAE,SAAS;QAC1G,WAAW,CAAC,IAAI,CACd,qBAAqB,CAAC;YACpB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC;YAClC,OAAO,EAAE,8BAA8B,EAAE,0BAA0B,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG;YAC7G,WAAW,EACT,2GAA2G;SAC9G,CAAC,CACH,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/dist/help.d.ts
CHANGED
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
* binds a control to the ID has already written it where the same reader can
|
|
11
11
|
* see it, and nothing else of that artifact is carried: never its title, path,
|
|
12
12
|
* status or prose. Two documents tipping one ID: the lower knowledge ID wins.
|
|
13
|
+
*
|
|
14
|
+
* It is also where the run names its snapshot, the commit and graph hash it
|
|
15
|
+
* was published from; the documents beside it do not carry one (ADR 0019).
|
|
13
16
|
*/
|
|
14
17
|
import type { Graph, Visibility } from "@intentset/core";
|
|
15
18
|
import type { Snapshot } from "./project.ts";
|
package/dist/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAY,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,YAAY,uBAAuB,CAAC;AACjD,sDAAsD;AACtD,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,OAAO;IACtB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,+CAA+C;AAC/C,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,OAAO,YAAY,CAAC;IAC7B,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACnG,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wFAAwF;AACxF,wBAAgB,QAAQ,CACtB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,SAAS,MAAM,EAAE,EAC/B,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,WAAW,GACnB,QAAQ,CAgCV"}
|
package/dist/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC;AACjD,sDAAsD;AACtD,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AAoCrC,wFAAwF;AACxF,MAAM,UAAU,QAAQ,CACtB,KAAY,EACZ,YAA+B,EAC/B,OAA2B,EAC3B,OAAoB;IAEpB,MAAM,GAAG,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACnD,MAAM,SAAS,GAAoB,EAAE,CAAC;IACtC,MAAM,IAAI,GAA4B,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC3C,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC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,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;SACxD;QACD,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS;QACT,IAAI;KACL,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export { EXCLUSION_REASONS, type Exclusion, type ExclusionReason, type ProjectOp
|
|
|
11
11
|
export { type PublicationIndex, type PublishOptions, type PublishResult, type PublishedDocument, REFUSAL_REASONS, type RefusalReason, publish, renderDocument, } from "./publish.ts";
|
|
12
12
|
export { type Reference, type ReferenceKind, checkReferences, checkTitles, findReferences, resolveTarget, titlePattern, } from "./references.ts";
|
|
13
13
|
export { type IndexedRequest, PROJECTION_ADMITS, type PublicationRequest, REQUEST_DIMENSIONS, type RequestDimension, admits, checkRequest, indexedRequest, } from "./request.ts";
|
|
14
|
-
export { CURRENT_PIN, REVIEW_EXTENSION, type ReviewRecord, type ReviewStatus, bindReviewPins, knowledgeReport, readReviewRecord, reviewSources, reviewStatus, } from "./review.ts";
|
|
14
|
+
export { CURRENT_PIN, PIN_KINDS, type PinKind, REVIEW_EXTENSION, type ReviewRecord, type ReviewStatus, bindReviewPins, knowledgeReport, pinHash, readReviewRecord, reviewSources, reviewStatus, } from "./review.ts";
|
|
15
15
|
export { YamlEmitError, type YamlValue, emitYaml } from "./yaml.ts";
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,eAAe,EACf,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,eAAe,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,YAAY,EACZ,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,eAAe,EACf,cAAc,EACd,OAAO,GACR,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,eAAe,EACf,KAAK,aAAa,EAClB,OAAO,EACP,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,cAAc,EACnB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,MAAM,EACN,YAAY,EACZ,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],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EACjB,cAAc,EACd,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,6 @@ export { EXCLUSION_REASONS, exclusionReason, plannedSources, project, } from "./
|
|
|
11
11
|
export { REFUSAL_REASONS, publish, renderDocument, } from "./publish.js";
|
|
12
12
|
export { checkReferences, checkTitles, findReferences, resolveTarget, titlePattern, } from "./references.js";
|
|
13
13
|
export { PROJECTION_ADMITS, REQUEST_DIMENSIONS, admits, checkRequest, indexedRequest, } from "./request.js";
|
|
14
|
-
export { CURRENT_PIN, REVIEW_EXTENSION, bindReviewPins, knowledgeReport, readReviewRecord, reviewSources, reviewStatus, } from "./review.js";
|
|
14
|
+
export { CURRENT_PIN, PIN_KINDS, REVIEW_EXTENSION, bindReviewPins, knowledgeReport, pinHash, readReviewRecord, reviewSources, reviewStatus, } from "./review.js";
|
|
15
15
|
export { YamlEmitError, emitYaml } from "./yaml.js";
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAmD,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAGL,eAAe,EACf,mBAAmB,EAGnB,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,eAAe,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,YAAY,EAKZ,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EAMjB,eAAe,EACf,cAAc,EACd,OAAO,GACR,MAAM,cAAc,CAAC;AACtB,OAAO,EAKL,eAAe,EAEf,OAAO,EACP,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,iBAAiB,EAEjB,kBAAkB,EAElB,MAAM,EACN,YAAY,EACZ,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,gBAAgB,EAGhB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAkB,QAAQ,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAmD,QAAQ,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAGL,eAAe,EACf,mBAAmB,EAGnB,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,eAAe,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,YAAY,EAKZ,QAAQ,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EAMjB,eAAe,EACf,cAAc,EACd,OAAO,GACR,MAAM,cAAc,CAAC;AACtB,OAAO,EAKL,eAAe,EAEf,OAAO,EACP,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,eAAe,EACf,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,iBAAiB,EAEjB,kBAAkB,EAElB,MAAM,EACN,YAAY,EACZ,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,SAAS,EAET,gBAAgB,EAGhB,cAAc,EACd,eAAe,EACf,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAkB,QAAQ,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/publish.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"AA4BA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,UAAU,EAIhB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAoB,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,KAAK,QAAQ,EAAY,MAAM,WAAW,CAAC;AACpD,OAAO,EAAwB,KAAK,QAAQ,EAAW,MAAM,cAAc,CAAC;AAE5E,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,kBAAkB,EAA0B,MAAM,cAAc,CAAC;AACpG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,yEAAyE;AACzE,eAAO,MAAM,eAAe,YAAI,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,CAAU,CAAC;AACvF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,kGAAkG;IAClG,WAAW,EAAE,MAAM,CAAC;IACpB,mGAAmG;IACnG,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,4EAA4E;IAC5E,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,+DAA+D;IAC/D,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,KAAK,EAAE,gBAAgB,CAAC;IACxB,oFAAoF;IACpF,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,EAAE,EAAE,OAAO,CAAC;CACb;AAED,wBAAgB,OAAO,CACrB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,cAAc,GACtB,aAAa,CA+Ef;AAUD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,GAAG,MAAM,CAOpF"}
|
package/dist/publish.js
CHANGED
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
* here is refused in turn; this repeats until nothing more is refused.
|
|
14
14
|
*
|
|
15
15
|
* The help file (help.ts) carries every published document's tips, keyed by
|
|
16
|
-
* the ID each explains, for a product's runtime.
|
|
16
|
+
* the ID each explains, for a product's runtime, and names the snapshot. The
|
|
17
|
+
* documents do not (ADR 0019): it is the same for all of them and moves with
|
|
18
|
+
* any record, so a document's bytes would change on every record change.
|
|
17
19
|
*
|
|
18
20
|
* The index is what a customer-facing tool may read (Core §10): the snapshot,
|
|
19
21
|
* the request without its authorization flags, the published IDs, and the
|
package/dist/publish.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"AA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AAE,CAAC,CAAC;IACrG,MAAM,IAAI,GAAG,+CAA+C,eAAe,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;IAC9G,MAAM,MAAM,GAAG,0BAA0B,CAAC;IAC1C,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,KAAK,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC5F,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACpC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1G,CAAC"}
|
package/dist/review.d.ts
CHANGED
|
@@ -18,17 +18,31 @@
|
|
|
18
18
|
* rules that govern each explained behavior: a rule changing under a behavior
|
|
19
19
|
* changes what the behavior promises, which is catalog case P04.
|
|
20
20
|
*
|
|
21
|
+
* A pin is one of two kinds, named by the record's `hash` (publication §3,
|
|
22
|
+
* ADR 0018). Without `hash`, a pin is the source's `sourceHash`, the bytes of
|
|
23
|
+
* the whole file, which every review made before 0.13.0 holds. With
|
|
24
|
+
* `hash: content-v1`, it is the source's `contentHash`, which leaves out the
|
|
25
|
+
* lifecycle and review fields, so approving or implementing a source, or
|
|
26
|
+
* marking its delivery, leaves the knowledge current. Any other `hash` is a
|
|
27
|
+
* kind this version does not know: every pin reads as changed.
|
|
28
|
+
*
|
|
21
29
|
* A pin of the literal `@current` is a fixture placeholder: `bindReviewPins`
|
|
22
|
-
* replaces it with the source's hash
|
|
23
|
-
* case can say "reviewed against what is there now"
|
|
24
|
-
* hash. Unbound, it never equals a hash, so it reads as
|
|
30
|
+
* replaces it with the source's hash of the record's kind in the snapshot
|
|
31
|
+
* being checked, so a case can say "reviewed against what is there now"
|
|
32
|
+
* without computing a hash. Unbound, it never equals a hash, so it reads as
|
|
33
|
+
* changed.
|
|
25
34
|
*/
|
|
26
35
|
import { type Artifact, type Graph, type KnowledgeReportSection } from "@intentset/core";
|
|
27
36
|
export declare const REVIEW_EXTENSION = "intentset.org/review";
|
|
28
37
|
export declare const CURRENT_PIN = "@current";
|
|
38
|
+
/** The pin kinds a review record can name in `hash` (publication §3). Absent means `source`, the whole file. */
|
|
39
|
+
export declare const PIN_KINDS: readonly ["content-v1"];
|
|
40
|
+
export type PinKind = (typeof PIN_KINDS)[number];
|
|
29
41
|
export interface ReviewRecord {
|
|
30
42
|
/** Source ID -> the source hash it was reviewed against. Entries that are not strings are dropped. */
|
|
31
43
|
sources: Record<string, string>;
|
|
44
|
+
/** What the pins hash: absent for the whole file, `content-v1` for the content hash, anything else unknown. */
|
|
45
|
+
hash?: string;
|
|
32
46
|
snapshot?: string;
|
|
33
47
|
}
|
|
34
48
|
export interface ReviewStatus {
|
|
@@ -37,6 +51,8 @@ export interface ReviewStatus {
|
|
|
37
51
|
changed: string[];
|
|
38
52
|
/** Sources the review record does not pin. */
|
|
39
53
|
missing: string[];
|
|
54
|
+
/** The record's `hash` when this version does not know it, so no pin can match; null otherwise. */
|
|
55
|
+
unknownHash: string | null;
|
|
40
56
|
/** `reviewedBy`, or null when the knowledge names no reviewer. */
|
|
41
57
|
reviewer: string | null;
|
|
42
58
|
/** `reviewedAt`, or null when absent. */
|
|
@@ -48,6 +64,8 @@ export declare function reviewSources(graph: Graph, artifact: Artifact): string[
|
|
|
48
64
|
export declare function readReviewRecord(artifact: Artifact): ReviewRecord | null;
|
|
49
65
|
/** Core §9: whether the knowledge is current against the sources it was reviewed against. */
|
|
50
66
|
export declare function reviewStatus(graph: Graph, artifact: Artifact): ReviewStatus;
|
|
67
|
+
/** The hash a pin of this kind holds for a source, or null for a kind this version does not know. */
|
|
68
|
+
export declare function pinHash(kind: string | undefined): ((source: Artifact) => string) | null;
|
|
51
69
|
/**
|
|
52
70
|
* Bind every `@current` pin to the pinned source's hash in this graph, for
|
|
53
71
|
* fixtures. Returns a new graph; the given one is not modified, and nothing
|
package/dist/review.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../src/review.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../src/review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAa,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAGpG,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AACvD,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC,gHAAgH;AAChH,eAAO,MAAM,SAAS,YAAI,YAAY,CAAU,CAAC;AACjD,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,sGAAsG;IACtG,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,+GAA+G;IAC/G,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,SAAS,GAAG,cAAc,CAAC;IACnC,2FAA2F;IAC3F,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,mGAAmG;IACnG,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,kEAAkE;IAClE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,yCAAyC;IACzC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,oHAAoH;AACpH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE,CAQxE;AAED,iHAAiH;AACjH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,IAAI,CAYxE;AAED,6FAA6F;AAC7F,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAgB3E;AAED,qGAAqG;AACrG,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,KAAK,MAAM,CAAC,GAAG,IAAI,CAIvF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAkBlD;AAUD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,sBAAsB,CAoBpE"}
|
package/dist/review.js
CHANGED
|
@@ -18,15 +18,26 @@
|
|
|
18
18
|
* rules that govern each explained behavior: a rule changing under a behavior
|
|
19
19
|
* changes what the behavior promises, which is catalog case P04.
|
|
20
20
|
*
|
|
21
|
+
* A pin is one of two kinds, named by the record's `hash` (publication §3,
|
|
22
|
+
* ADR 0018). Without `hash`, a pin is the source's `sourceHash`, the bytes of
|
|
23
|
+
* the whole file, which every review made before 0.13.0 holds. With
|
|
24
|
+
* `hash: content-v1`, it is the source's `contentHash`, which leaves out the
|
|
25
|
+
* lifecycle and review fields, so approving or implementing a source, or
|
|
26
|
+
* marking its delivery, leaves the knowledge current. Any other `hash` is a
|
|
27
|
+
* kind this version does not know: every pin reads as changed.
|
|
28
|
+
*
|
|
21
29
|
* A pin of the literal `@current` is a fixture placeholder: `bindReviewPins`
|
|
22
|
-
* replaces it with the source's hash
|
|
23
|
-
* case can say "reviewed against what is there now"
|
|
24
|
-
* hash. Unbound, it never equals a hash, so it reads as
|
|
30
|
+
* replaces it with the source's hash of the record's kind in the snapshot
|
|
31
|
+
* being checked, so a case can say "reviewed against what is there now"
|
|
32
|
+
* without computing a hash. Unbound, it never equals a hash, so it reads as
|
|
33
|
+
* changed.
|
|
25
34
|
*/
|
|
26
35
|
import { graphHash } from "@intentset/core";
|
|
27
36
|
import { compareStrings, sortedUnique } from "./diagnostic.js";
|
|
28
37
|
export const REVIEW_EXTENSION = "intentset.org/review";
|
|
29
38
|
export const CURRENT_PIN = "@current";
|
|
39
|
+
/** The pin kinds a review record can name in `hash` (publication §3). Absent means `source`, the whole file. */
|
|
40
|
+
export const PIN_KINDS = ["content-v1"];
|
|
30
41
|
/** The sources a review must pin: everything explained, and the rules governing each explained behavior. Sorted. */
|
|
31
42
|
export function reviewSources(graph, artifact) {
|
|
32
43
|
const ids = [];
|
|
@@ -50,6 +61,8 @@ export function readReviewRecord(artifact) {
|
|
|
50
61
|
sources[id] = pin;
|
|
51
62
|
}
|
|
52
63
|
const record = { sources };
|
|
64
|
+
if (value.hash !== undefined)
|
|
65
|
+
record.hash = typeof value.hash === "string" ? value.hash : JSON.stringify(value.hash);
|
|
53
66
|
if (typeof value.snapshot === "string")
|
|
54
67
|
record.snapshot = value.snapshot;
|
|
55
68
|
return record;
|
|
@@ -57,19 +70,30 @@ export function readReviewRecord(artifact) {
|
|
|
57
70
|
/** Core §9: whether the knowledge is current against the sources it was reviewed against. */
|
|
58
71
|
export function reviewStatus(graph, artifact) {
|
|
59
72
|
const record = readReviewRecord(artifact);
|
|
73
|
+
const hashOf = pinHash(record?.hash);
|
|
74
|
+
const unknownHash = record?.hash !== undefined && hashOf === null ? record.hash : null;
|
|
60
75
|
const changed = [];
|
|
61
76
|
const missing = [];
|
|
62
77
|
for (const id of reviewSources(graph, artifact)) {
|
|
63
78
|
const pin = record?.sources[id];
|
|
79
|
+
const source = graph.artifacts.get(id);
|
|
64
80
|
if (pin === undefined)
|
|
65
81
|
missing.push(id);
|
|
66
|
-
else if (
|
|
82
|
+
else if (source === undefined || hashOf === null || hashOf(source) !== pin)
|
|
67
83
|
changed.push(id);
|
|
68
84
|
}
|
|
69
85
|
const reviewer = nonEmpty(artifact.meta.reviewedBy);
|
|
70
86
|
const reviewedAt = nonEmpty(artifact.meta.reviewedAt);
|
|
71
87
|
const current = changed.length === 0 && missing.length === 0 && reviewer !== null && reviewedAt !== null;
|
|
72
|
-
return { status: current ? "current" : "needs-review", changed, missing, reviewer, reviewedAt };
|
|
88
|
+
return { status: current ? "current" : "needs-review", changed, missing, unknownHash, reviewer, reviewedAt };
|
|
89
|
+
}
|
|
90
|
+
/** The hash a pin of this kind holds for a source, or null for a kind this version does not know. */
|
|
91
|
+
export function pinHash(kind) {
|
|
92
|
+
if (kind === undefined)
|
|
93
|
+
return (source) => source.sourceHash;
|
|
94
|
+
if (kind === "content-v1")
|
|
95
|
+
return (source) => source.contentHash;
|
|
96
|
+
return null;
|
|
73
97
|
}
|
|
74
98
|
/**
|
|
75
99
|
* Bind every `@current` pin to the pinned source's hash in this graph, for
|
|
@@ -85,9 +109,11 @@ export function bindReviewPins(graph) {
|
|
|
85
109
|
artifacts.set(id, artifact);
|
|
86
110
|
continue;
|
|
87
111
|
}
|
|
112
|
+
const hashOf = pinHash(typeof value.hash === "string" || value.hash === undefined ? value.hash : "");
|
|
88
113
|
const sources = {};
|
|
89
114
|
for (const [source, pin] of Object.entries(value.sources)) {
|
|
90
|
-
|
|
115
|
+
const found = graph.artifacts.get(source);
|
|
116
|
+
sources[source] = pin === CURRENT_PIN && found !== undefined && hashOf !== null ? hashOf(found) : pin;
|
|
91
117
|
}
|
|
92
118
|
const extensions = { ...artifact.meta.extensions, [REVIEW_EXTENSION]: { ...value, sources } };
|
|
93
119
|
artifacts.set(id, { ...artifact, meta: { ...artifact.meta, extensions } });
|
package/dist/review.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.js","sourceRoot":"","sources":["../src/review.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"review.js","sourceRoot":"","sources":["../src/review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAA6B,SAAS,EAA+B,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AACvD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AACtC,gHAAgH;AAChH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,YAAY,CAAU,CAAC;AAyBjD,oHAAoH;AACpH,MAAM,UAAU,aAAa,CAAC,KAAY,EAAE,QAAkB;IAC5D,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;QACpD,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACb,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACvC,IAAI,MAAM,EAAE,IAAI,CAAC,IAAI,KAAK,UAAU;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC;AAED,iHAAiH;AACjH,MAAM,UAAU,gBAAgB,CAAC,QAAkB;IACjD,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,gBAAgB,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C7C,OAAO;gBACL,EAAE;gBACF,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;gBAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,OAAO,EAAE,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC;gBACvC,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;gBACjD,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;gBACjD,QAAQ,EAAE,CAAC;aACZ,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentset/publisher",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Audience and release projection of reviewed knowledge into Markset documents with provenance.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intentset",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@intentset/core": "^0.
|
|
39
|
-
"@intentset/markset-adapter": "^0.
|
|
38
|
+
"@intentset/core": "^0.14.0",
|
|
39
|
+
"@intentset/markset-adapter": "^0.14.0",
|
|
40
40
|
"@markset-lang/parser": "0.4.1",
|
|
41
41
|
"@markset-lang/render-html": "0.4.1"
|
|
42
42
|
}
|
package/src/generate.ts
CHANGED
|
@@ -13,7 +13,11 @@
|
|
|
13
13
|
* path appears only in a projection that admits internal records; sources
|
|
14
14
|
* outside the projection are counted, not named; availability is the
|
|
15
15
|
* request's own values, so a document does not list the other editions,
|
|
16
|
-
* roles or releases its knowledge also serves.
|
|
16
|
+
* roles or releases its knowledge also serves. The block carries no snapshot:
|
|
17
|
+
* that is the same for every document in a run and moves with any record in
|
|
18
|
+
* the model, so the run names it once, in the help file and the index
|
|
19
|
+
* (publication §2, §5; ADR 0019), and a document's bytes change only when what
|
|
20
|
+
* it was made from does.
|
|
17
21
|
*
|
|
18
22
|
* The result is checked as Markset before it is emitted: a Markset error is
|
|
19
23
|
* PUB003, and a `:::` directive outside Markset's vocabulary is PUB004
|
|
@@ -24,7 +28,6 @@ import { marksetCarrier } from "@intentset/markset-adapter";
|
|
|
24
28
|
import { BLOCK_DIRECTIVE_NAMES, parseDocument } from "@markset-lang/parser";
|
|
25
29
|
import { bodyLineOffset } from "./body.ts";
|
|
26
30
|
import { publicationDiagnostic, sortedUnique } from "./diagnostic.ts";
|
|
27
|
-
import type { Snapshot } from "./project.ts";
|
|
28
31
|
import { type PublicationRequest, admits } from "./request.ts";
|
|
29
32
|
import { type YamlValue, emitYaml } from "./yaml.ts";
|
|
30
33
|
|
|
@@ -51,7 +54,6 @@ export interface PublicationMeta {
|
|
|
51
54
|
sources: SourceStamp[];
|
|
52
55
|
/** How many explained artifacts are outside the projection and so not named. */
|
|
53
56
|
withheldSources: number;
|
|
54
|
-
snapshot: Snapshot;
|
|
55
57
|
audience: string;
|
|
56
58
|
/** The request's values, and the flags the knowledge requires (every one of them named by the request). */
|
|
57
59
|
availability: { product: string; release: string; role: string; edition: string; flags: string[] };
|
|
@@ -61,7 +63,6 @@ export interface PublicationMeta {
|
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
export interface GenerateOptions {
|
|
64
|
-
snapshot: Snapshot;
|
|
65
66
|
publishedAt: string;
|
|
66
67
|
}
|
|
67
68
|
|
|
@@ -109,7 +110,6 @@ export function publicationMeta(
|
|
|
109
110
|
source,
|
|
110
111
|
sources,
|
|
111
112
|
withheldSources,
|
|
112
|
-
snapshot: { commit: options.snapshot.commit, graphHash: options.snapshot.graphHash },
|
|
113
113
|
audience: request.audience,
|
|
114
114
|
availability: {
|
|
115
115
|
product: request.product,
|
package/src/help.ts
CHANGED
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
* binds a control to the ID has already written it where the same reader can
|
|
11
11
|
* see it, and nothing else of that artifact is carried: never its title, path,
|
|
12
12
|
* status or prose. Two documents tipping one ID: the lower knowledge ID wins.
|
|
13
|
+
*
|
|
14
|
+
* It is also where the run names its snapshot, the commit and graph hash it
|
|
15
|
+
* was published from; the documents beside it do not carry one (ADR 0019).
|
|
13
16
|
*/
|
|
14
17
|
import type { Artifact, Graph, Visibility } from "@intentset/core";
|
|
15
18
|
import { compareStrings } from "./diagnostic.ts";
|
package/src/index.ts
CHANGED
|
@@ -69,11 +69,14 @@ export {
|
|
|
69
69
|
} from "./request.ts";
|
|
70
70
|
export {
|
|
71
71
|
CURRENT_PIN,
|
|
72
|
+
PIN_KINDS,
|
|
73
|
+
type PinKind,
|
|
72
74
|
REVIEW_EXTENSION,
|
|
73
75
|
type ReviewRecord,
|
|
74
76
|
type ReviewStatus,
|
|
75
77
|
bindReviewPins,
|
|
76
78
|
knowledgeReport,
|
|
79
|
+
pinHash,
|
|
77
80
|
readReviewRecord,
|
|
78
81
|
reviewSources,
|
|
79
82
|
reviewStatus,
|
package/src/publish.ts
CHANGED
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
* here is refused in turn; this repeats until nothing more is refused.
|
|
14
14
|
*
|
|
15
15
|
* The help file (help.ts) carries every published document's tips, keyed by
|
|
16
|
-
* the ID each explains, for a product's runtime.
|
|
16
|
+
* the ID each explains, for a product's runtime, and names the snapshot. The
|
|
17
|
+
* documents do not (ADR 0019): it is the same for all of them and moves with
|
|
18
|
+
* any record, so a document's bytes would change on every record change.
|
|
17
19
|
*
|
|
18
20
|
* The index is what a customer-facing tool may read (Core §10): the snapshot,
|
|
19
21
|
* the request without its authorization flags, the published IDs, and the
|
package/src/review.ts
CHANGED
|
@@ -18,20 +18,34 @@
|
|
|
18
18
|
* rules that govern each explained behavior: a rule changing under a behavior
|
|
19
19
|
* changes what the behavior promises, which is catalog case P04.
|
|
20
20
|
*
|
|
21
|
+
* A pin is one of two kinds, named by the record's `hash` (publication §3,
|
|
22
|
+
* ADR 0018). Without `hash`, a pin is the source's `sourceHash`, the bytes of
|
|
23
|
+
* the whole file, which every review made before 0.13.0 holds. With
|
|
24
|
+
* `hash: content-v1`, it is the source's `contentHash`, which leaves out the
|
|
25
|
+
* lifecycle and review fields, so approving or implementing a source, or
|
|
26
|
+
* marking its delivery, leaves the knowledge current. Any other `hash` is a
|
|
27
|
+
* kind this version does not know: every pin reads as changed.
|
|
28
|
+
*
|
|
21
29
|
* A pin of the literal `@current` is a fixture placeholder: `bindReviewPins`
|
|
22
|
-
* replaces it with the source's hash
|
|
23
|
-
* case can say "reviewed against what is there now"
|
|
24
|
-
* hash. Unbound, it never equals a hash, so it reads as
|
|
30
|
+
* replaces it with the source's hash of the record's kind in the snapshot
|
|
31
|
+
* being checked, so a case can say "reviewed against what is there now"
|
|
32
|
+
* without computing a hash. Unbound, it never equals a hash, so it reads as
|
|
33
|
+
* changed.
|
|
25
34
|
*/
|
|
26
35
|
import { type Artifact, type Graph, graphHash, type KnowledgeReportSection } from "@intentset/core";
|
|
27
36
|
import { compareStrings, sortedUnique } from "./diagnostic.ts";
|
|
28
37
|
|
|
29
38
|
export const REVIEW_EXTENSION = "intentset.org/review";
|
|
30
39
|
export const CURRENT_PIN = "@current";
|
|
40
|
+
/** The pin kinds a review record can name in `hash` (publication §3). Absent means `source`, the whole file. */
|
|
41
|
+
export const PIN_KINDS = ["content-v1"] as const;
|
|
42
|
+
export type PinKind = (typeof PIN_KINDS)[number];
|
|
31
43
|
|
|
32
44
|
export interface ReviewRecord {
|
|
33
45
|
/** Source ID -> the source hash it was reviewed against. Entries that are not strings are dropped. */
|
|
34
46
|
sources: Record<string, string>;
|
|
47
|
+
/** What the pins hash: absent for the whole file, `content-v1` for the content hash, anything else unknown. */
|
|
48
|
+
hash?: string;
|
|
35
49
|
snapshot?: string;
|
|
36
50
|
}
|
|
37
51
|
|
|
@@ -41,6 +55,8 @@ export interface ReviewStatus {
|
|
|
41
55
|
changed: string[];
|
|
42
56
|
/** Sources the review record does not pin. */
|
|
43
57
|
missing: string[];
|
|
58
|
+
/** The record's `hash` when this version does not know it, so no pin can match; null otherwise. */
|
|
59
|
+
unknownHash: string | null;
|
|
44
60
|
/** `reviewedBy`, or null when the knowledge names no reviewer. */
|
|
45
61
|
reviewer: string | null;
|
|
46
62
|
/** `reviewedAt`, or null when absent. */
|
|
@@ -68,6 +84,7 @@ export function readReviewRecord(artifact: Artifact): ReviewRecord | null {
|
|
|
68
84
|
if (typeof pin === "string") sources[id] = pin;
|
|
69
85
|
}
|
|
70
86
|
const record: ReviewRecord = { sources };
|
|
87
|
+
if (value.hash !== undefined) record.hash = typeof value.hash === "string" ? value.hash : JSON.stringify(value.hash);
|
|
71
88
|
if (typeof value.snapshot === "string") record.snapshot = value.snapshot;
|
|
72
89
|
return record;
|
|
73
90
|
}
|
|
@@ -75,17 +92,27 @@ export function readReviewRecord(artifact: Artifact): ReviewRecord | null {
|
|
|
75
92
|
/** Core §9: whether the knowledge is current against the sources it was reviewed against. */
|
|
76
93
|
export function reviewStatus(graph: Graph, artifact: Artifact): ReviewStatus {
|
|
77
94
|
const record = readReviewRecord(artifact);
|
|
95
|
+
const hashOf = pinHash(record?.hash);
|
|
96
|
+
const unknownHash = record?.hash !== undefined && hashOf === null ? record.hash : null;
|
|
78
97
|
const changed: string[] = [];
|
|
79
98
|
const missing: string[] = [];
|
|
80
99
|
for (const id of reviewSources(graph, artifact)) {
|
|
81
100
|
const pin = record?.sources[id];
|
|
101
|
+
const source = graph.artifacts.get(id);
|
|
82
102
|
if (pin === undefined) missing.push(id);
|
|
83
|
-
else if (
|
|
103
|
+
else if (source === undefined || hashOf === null || hashOf(source) !== pin) changed.push(id);
|
|
84
104
|
}
|
|
85
105
|
const reviewer = nonEmpty(artifact.meta.reviewedBy);
|
|
86
106
|
const reviewedAt = nonEmpty(artifact.meta.reviewedAt);
|
|
87
107
|
const current = changed.length === 0 && missing.length === 0 && reviewer !== null && reviewedAt !== null;
|
|
88
|
-
return { status: current ? "current" : "needs-review", changed, missing, reviewer, reviewedAt };
|
|
108
|
+
return { status: current ? "current" : "needs-review", changed, missing, unknownHash, reviewer, reviewedAt };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** The hash a pin of this kind holds for a source, or null for a kind this version does not know. */
|
|
112
|
+
export function pinHash(kind: string | undefined): ((source: Artifact) => string) | null {
|
|
113
|
+
if (kind === undefined) return (source) => source.sourceHash;
|
|
114
|
+
if (kind === "content-v1") return (source) => source.contentHash;
|
|
115
|
+
return null;
|
|
89
116
|
}
|
|
90
117
|
|
|
91
118
|
/**
|
|
@@ -102,9 +129,11 @@ export function bindReviewPins(graph: Graph): Graph {
|
|
|
102
129
|
artifacts.set(id, artifact);
|
|
103
130
|
continue;
|
|
104
131
|
}
|
|
132
|
+
const hashOf = pinHash(typeof value.hash === "string" || value.hash === undefined ? value.hash : "");
|
|
105
133
|
const sources: Record<string, unknown> = {};
|
|
106
134
|
for (const [source, pin] of Object.entries(value.sources)) {
|
|
107
|
-
|
|
135
|
+
const found = graph.artifacts.get(source);
|
|
136
|
+
sources[source] = pin === CURRENT_PIN && found !== undefined && hashOf !== null ? hashOf(found) : pin;
|
|
108
137
|
}
|
|
109
138
|
const extensions = { ...artifact.meta.extensions, [REVIEW_EXTENSION]: { ...value, sources } };
|
|
110
139
|
artifacts.set(id, { ...artifact, meta: { ...artifact.meta, extensions } });
|