@metaobjectsdev/codegen-ts 0.23.1 → 0.24.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/dist/column-mapper.d.ts +32 -0
- package/dist/column-mapper.d.ts.map +1 -1
- package/dist/column-mapper.js +91 -8
- package/dist/column-mapper.js.map +1 -1
- package/dist/enum-meta.d.ts +20 -0
- package/dist/enum-meta.d.ts.map +1 -1
- package/dist/enum-meta.js +32 -1
- package/dist/enum-meta.js.map +1 -1
- package/dist/generator.d.ts +9 -0
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js.map +1 -1
- package/dist/generators/api-field-shape.js +1 -1
- package/dist/generators/api-field-shape.js.map +1 -1
- package/dist/generators/api-model.d.ts.map +1 -1
- package/dist/generators/api-model.js +71 -42
- package/dist/generators/api-model.js.map +1 -1
- package/dist/generators/docs-data-builder.d.ts.map +1 -1
- package/dist/generators/docs-data-builder.js +36 -1
- package/dist/generators/docs-data-builder.js.map +1 -1
- package/dist/generators/docs-data.d.ts +14 -0
- package/dist/generators/docs-data.d.ts.map +1 -1
- package/dist/generators/docs-file.d.ts.map +1 -1
- package/dist/generators/docs-file.js +13 -4
- package/dist/generators/docs-file.js.map +1 -1
- package/dist/generators/extractor-file.d.ts.map +1 -1
- package/dist/generators/extractor-file.js +7 -11
- package/dist/generators/extractor-file.js.map +1 -1
- package/dist/generators/index.d.ts +4 -0
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +5 -0
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/output-parser-file.d.ts.map +1 -1
- package/dist/generators/output-parser-file.js +12 -7
- package/dist/generators/output-parser-file.js.map +1 -1
- package/dist/generators/output-prompt-file.d.ts.map +1 -1
- package/dist/generators/output-prompt-file.js +14 -24
- package/dist/generators/output-prompt-file.js.map +1 -1
- package/dist/generators/requirement-tests.d.ts +44 -0
- package/dist/generators/requirement-tests.d.ts.map +1 -0
- package/dist/generators/requirement-tests.js +127 -0
- package/dist/generators/requirement-tests.js.map +1 -0
- package/dist/generators/requirements-file.d.ts +9 -0
- package/dist/generators/requirements-file.d.ts.map +1 -0
- package/dist/generators/requirements-file.js +53 -0
- package/dist/generators/requirements-file.js.map +1 -0
- package/dist/generators/requirements-markdown.d.ts +10 -0
- package/dist/generators/requirements-markdown.d.ts.map +1 -0
- package/dist/generators/requirements-markdown.js +71 -0
- package/dist/generators/requirements-markdown.js.map +1 -0
- package/dist/generators/requirements-toon.d.ts +3 -0
- package/dist/generators/requirements-toon.d.ts.map +1 -0
- package/dist/generators/requirements-toon.js +47 -0
- package/dist/generators/requirements-toon.js.map +1 -0
- package/dist/generators/requirements-view.d.ts +32 -0
- package/dist/generators/requirements-view.d.ts.map +1 -0
- package/dist/generators/requirements-view.js +64 -0
- package/dist/generators/requirements-view.js.map +1 -0
- package/dist/generators/trace-helper-file.d.ts.map +1 -1
- package/dist/generators/trace-helper-file.js +19 -11
- package/dist/generators/trace-helper-file.js.map +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/dist/metaobjects-config.d.ts +12 -20
- package/dist/metaobjects-config.d.ts.map +1 -1
- package/dist/metaobjects-config.js +5 -1
- package/dist/metaobjects-config.js.map +1 -1
- package/dist/orphan-sweep.d.ts +38 -0
- package/dist/orphan-sweep.d.ts.map +1 -0
- package/dist/orphan-sweep.js +129 -0
- package/dist/orphan-sweep.js.map +1 -0
- package/dist/overwrite-policy.d.ts +97 -3
- package/dist/overwrite-policy.d.ts.map +1 -1
- package/dist/overwrite-policy.js +293 -81
- package/dist/overwrite-policy.js.map +1 -1
- package/dist/projection/build-projection-views.d.ts +8 -0
- package/dist/projection/build-projection-views.d.ts.map +1 -1
- package/dist/projection/build-projection-views.js +2 -0
- package/dist/projection/build-projection-views.js.map +1 -1
- package/dist/projection/extract-view-spec.d.ts.map +1 -1
- package/dist/projection/extract-view-spec.js +70 -6
- package/dist/projection/extract-view-spec.js.map +1 -1
- package/dist/reconcile-orphans.d.ts +80 -0
- package/dist/reconcile-orphans.d.ts.map +1 -0
- package/dist/reconcile-orphans.js +61 -0
- package/dist/reconcile-orphans.js.map +1 -0
- package/dist/render-engine/embedded-templates.generated.js +1 -1
- package/dist/render-engine/embedded-templates.generated.js.map +1 -1
- package/dist/requirement-walk.d.ts +57 -0
- package/dist/requirement-walk.d.ts.map +1 -0
- package/dist/requirement-walk.js +94 -0
- package/dist/requirement-walk.js.map +1 -0
- package/dist/runner.d.ts +35 -0
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +217 -21
- package/dist/runner.js.map +1 -1
- package/dist/templates/drizzle-schema.d.ts.map +1 -1
- package/dist/templates/drizzle-schema.js +67 -4
- package/dist/templates/drizzle-schema.js.map +1 -1
- package/dist/templates/extractor.d.ts +4 -4
- package/dist/templates/extractor.d.ts.map +1 -1
- package/dist/templates/extractor.js +18 -22
- package/dist/templates/extractor.js.map +1 -1
- package/dist/templates/filter-allowlist.d.ts.map +1 -1
- package/dist/templates/filter-allowlist.js +4 -2
- package/dist/templates/filter-allowlist.js.map +1 -1
- package/dist/templates/filter-type.d.ts.map +1 -1
- package/dist/templates/filter-type.js +6 -2
- package/dist/templates/filter-type.js.map +1 -1
- package/dist/templates/find-inbound.d.ts +44 -0
- package/dist/templates/find-inbound.d.ts.map +1 -0
- package/dist/templates/find-inbound.js +69 -0
- package/dist/templates/find-inbound.js.map +1 -0
- package/dist/templates/output-format-spec-emitter.d.ts.map +1 -1
- package/dist/templates/output-format-spec-emitter.js +7 -4
- package/dist/templates/output-format-spec-emitter.js.map +1 -1
- package/dist/templates/output-parser.d.ts +8 -3
- package/dist/templates/output-parser.d.ts.map +1 -1
- package/dist/templates/output-parser.js +71 -31
- package/dist/templates/output-parser.js.map +1 -1
- package/dist/templates/output-prompt.d.ts +6 -5
- package/dist/templates/output-prompt.d.ts.map +1 -1
- package/dist/templates/output-prompt.js +26 -37
- package/dist/templates/output-prompt.js.map +1 -1
- package/dist/templates/queries.js +1 -1
- package/dist/templates/queries.js.map +1 -1
- package/dist/templates/requirement-test.d.ts +12 -0
- package/dist/templates/requirement-test.d.ts.map +1 -0
- package/dist/templates/requirement-test.js +120 -0
- package/dist/templates/requirement-test.js.map +1 -0
- package/dist/templates/zod-validators.d.ts.map +1 -1
- package/dist/templates/zod-validators.js +32 -15
- package/dist/templates/zod-validators.js.map +1 -1
- package/package.json +7 -6
- package/src/column-mapper.ts +124 -8
- package/src/enum-meta.ts +37 -1
- package/src/generator.ts +9 -0
- package/src/generators/api-field-shape.ts +1 -1
- package/src/generators/api-model.ts +69 -44
- package/src/generators/docs-data-builder.ts +37 -0
- package/src/generators/docs-data.ts +15 -0
- package/src/generators/docs-file.ts +13 -4
- package/src/generators/extractor-file.ts +7 -11
- package/src/generators/index.ts +11 -0
- package/src/generators/output-parser-file.ts +12 -7
- package/src/generators/output-prompt-file.ts +14 -27
- package/src/generators/requirement-tests.ts +203 -0
- package/src/generators/requirements-file.ts +71 -0
- package/src/generators/requirements-markdown.ts +72 -0
- package/src/generators/requirements-toon.ts +64 -0
- package/src/generators/requirements-view.ts +93 -0
- package/src/generators/trace-helper-file.ts +20 -10
- package/src/index.ts +47 -1
- package/src/metaobjects-config.ts +17 -22
- package/src/orphan-sweep.ts +178 -0
- package/src/overwrite-policy.ts +362 -89
- package/src/projection/build-projection-views.ts +10 -0
- package/src/projection/extract-view-spec.ts +88 -4
- package/src/reconcile-orphans.ts +136 -0
- package/src/reference/barrel.ts +4 -0
- package/src/reference/entity.ts +4 -0
- package/src/reference/queries.ts +4 -0
- package/src/reference/routes.ts +4 -0
- package/src/render-engine/embedded-templates.generated.ts +1 -1
- package/src/requirement-walk.ts +124 -0
- package/src/runner.ts +266 -27
- package/src/templates/drizzle-schema.ts +70 -6
- package/src/templates/extractor.ts +19 -24
- package/src/templates/filter-allowlist.ts +4 -2
- package/src/templates/filter-type.ts +6 -2
- package/src/templates/find-inbound.ts +96 -0
- package/src/templates/output-format-spec-emitter.ts +7 -4
- package/src/templates/output-parser.ts +76 -34
- package/src/templates/output-prompt.ts +29 -42
- package/src/templates/queries.ts +1 -1
- package/src/templates/requirement-test.ts +140 -0
- package/src/templates/zod-validators.ts +32 -15
- package/templates/docs/entity-page.md.mustache +8 -0
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
//
|
|
17
17
|
// Consumer wiring (metaobjects.config.ts):
|
|
18
18
|
// generators: [..., entityFile(), queriesFile(), traceHelperFile(), barrel()]
|
|
19
|
-
import { TYPE_OBJECT, TYPE_TEMPLATE, TEMPLATE_SUBTYPE_PROMPT, TEMPLATE_ATTR_PAYLOAD_REF, TEMPLATE_ATTR_RESPONSE_REF, TEMPLATE_ATTR_FORMAT, TEMPLATE_ATTR_TEXT_REF, } from "@metaobjectsdev/metadata";
|
|
19
|
+
import { TYPE_OBJECT, TYPE_TEMPLATE, TEMPLATE_SUBTYPE_PROMPT, TEMPLATE_ATTR_PAYLOAD_REF, TEMPLATE_ATTR_RESPONSE_REF, TEMPLATE_ATTR_FORMAT, RESPONSE_FORMAT_XML, TEMPLATE_ATTR_TEXT_REF, } from "@metaobjectsdev/metadata";
|
|
20
|
+
import { responseFormatOf } from "../templates/find-inbound.js";
|
|
20
21
|
import { perEntity, } from "../generator.js";
|
|
21
22
|
import { generatePayloadInterfacesBatch } from "../payload-codegen.js";
|
|
22
23
|
import { GENERATED_HEADER } from "../constants.js";
|
|
@@ -84,13 +85,18 @@ export const traceHelperFile = function traceHelperFile(opts) {
|
|
|
84
85
|
const recordBuildArg = sti
|
|
85
86
|
? `{ ...input, callType: ${JSON.stringify(callTypeValue)}, status, errorDetail }`
|
|
86
87
|
: `{ ...input, status, errorDetail }`;
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
// ADR-0053: the REPLY's syntax is @responseFormat, not @format.
|
|
89
|
+
//
|
|
90
|
+
// This site used to read @format twice — once as the reply's syntax and once
|
|
91
|
+
// as the prompt body's — under a comment calling them "two intentionally
|
|
92
|
+
// different shapes". They are two different FACTS, not two shapes of one:
|
|
93
|
+
// a plain-text prompt can elicit an XML reply, and the shipped docs-site
|
|
94
|
+
// fixture is exactly that. Reading @format here mis-parsed every prompt whose
|
|
95
|
+
// body format differed from its reply's.
|
|
96
|
+
//
|
|
97
|
+
// The same rule the output-parser / extractor / response-format-fragment
|
|
98
|
+
// generators use — all four now go through responseFormatOf().
|
|
99
|
+
const formatLiteral = responseFormatOf(prompt) === RESPONSE_FORMAT_XML ? "Format.XML" : "Format.JSON";
|
|
94
100
|
// Collect VO names for interface emission (dedupe via batch emitter).
|
|
95
101
|
// Both refs are guaranteed strings by the guards above. ADR-0042: a bare
|
|
96
102
|
// ref resolves in the prompt's package.
|
|
@@ -101,9 +107,11 @@ export const traceHelperFile = function traceHelperFile(opts) {
|
|
|
101
107
|
// ADR-0039: resolving — a prompt may inherit @textRef via extends.
|
|
102
108
|
const textRef = prompt.attr(TEMPLATE_ATTR_TEXT_REF);
|
|
103
109
|
const renderable = typeof textRef === "string";
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
//
|
|
110
|
+
// render() takes the raw format string of the prompt BODY — @format, which is
|
|
111
|
+
// genuinely this attribute's job. Distinct from formatLiteral above, which is
|
|
112
|
+
// the REPLY's syntax and comes from @responseFormat (ADR-0053).
|
|
113
|
+
// ADR-0039: resolving — a prompt may inherit @format via extends.
|
|
114
|
+
const promptFormat = prompt.attr(TEMPLATE_ATTR_FORMAT);
|
|
107
115
|
const renderFormat = typeof promptFormat === "string" ? promptFormat : "text";
|
|
108
116
|
// Build the import block — all imports MUST stay at the top of the emitted file.
|
|
109
117
|
// `extract` + `render` both live in @metaobjectsdev/render: import them together
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace-helper-file.js","sourceRoot":"","sources":["../../src/generators/trace-helper-file.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,wDAAwD;AACxD,EAAE;AACF,uFAAuF;AACvF,oFAAoF;AACpF,iFAAiF;AACjF,oFAAoF;AACpF,yCAAyC;AACzC,EAAE;AACF,mFAAmF;AACnF,+EAA+E;AAC/E,+BAA+B;AAC/B,EAAE;AACF,2CAA2C;AAC3C,gFAAgF;AAEhF,OAAO,EACL,WAAW,EACX,aAAa,EACb,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"trace-helper-file.js","sourceRoot":"","sources":["../../src/generators/trace-helper-file.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,wDAAwD;AACxD,EAAE;AACF,uFAAuF;AACvF,oFAAoF;AACpF,iFAAiF;AACjF,oFAAoF;AACpF,yCAAyC;AACzC,EAAE;AACF,mFAAmF;AACnF,+EAA+E;AAC/E,+BAA+B;AAC/B,EAAE;AACF,2CAA2C;AAC3C,gFAAgF;AAEhF,OAAO,EACL,WAAW,EACX,aAAa,EACb,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAIL,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,0EAA0E;AAC1E,MAAM,aAAa,GAAG,aAAa,CAAC;AASpC,mEAAmE;AACnE,SAAS,WAAW,CAAC,GAAe;IA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;iBAC1B,CAAC,CAAC;QACL,CAAC,CAAC;KACH,CAAC;IACF,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;QACjB,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACjC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAsC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type { TemplateSpecEntry, TemplateSpecFile } from "./template-codegen/tem
|
|
|
10
10
|
export type { TemplateScope } from "./generators/template-generator.js";
|
|
11
11
|
export { generatorRegistry, listGenerators, getGenerator, } from "./generator-registry.js";
|
|
12
12
|
export type { GeneratorRegistryEntry, GeneratorTier } from "./generator-registry.js";
|
|
13
|
-
export type { MetaobjectsGenConfig, NormalizedMetaobjectsGenConfig, ResolvedGenConfig, Dialect, ExtStyle, ColumnNamingStrategy, MetaDataTypeProvider, GeneratorSpec, DocsConfig, ResolvedDocsConfig, DocsSurface, ApiSurface
|
|
13
|
+
export type { MetaobjectsGenConfig, NormalizedMetaobjectsGenConfig, ResolvedGenConfig, Dialect, ExtStyle, ColumnNamingStrategy, MetaDataTypeProvider, GeneratorSpec, DocsConfig, ResolvedDocsConfig, DocsSurface, ApiSurface } from "./metaobjects-config.js";
|
|
14
14
|
export { defineConfig, normalizeConfig, resolveGenerators, resolveDocsConfig } from "./metaobjects-config.js";
|
|
15
15
|
export { apiLabel } from "./generators/api-label.js";
|
|
16
16
|
export type { ColumnSpec, DefaultExpr } from "./column-mapper.js";
|
|
@@ -75,4 +75,16 @@ export type { EntityDocData, StorageFieldDoc, IdentityDoc, RelationshipDoc, Used
|
|
|
75
75
|
export { buildEntityDocData } from "./generators/docs-data-builder.js";
|
|
76
76
|
export type { TemplateDocData, TemplateOutputPart } from "./generators/template-doc-data.js";
|
|
77
77
|
export { buildTemplateDocData } from "./generators/template-doc-builder.js";
|
|
78
|
+
export { requirementTests } from "./generators/requirement-tests.js";
|
|
79
|
+
export { requirementsFile } from "./generators/requirements-file.js";
|
|
80
|
+
export type { RequirementRow } from "./generators/requirements-view.js";
|
|
81
|
+
export type { RequirementTestsOpts, RequirementTestRenderer, } from "./generators/requirement-tests.js";
|
|
82
|
+
export { walkRequirements, groupByConcern, concernOf, NO_CONCERN, } from "./requirement-walk.js";
|
|
83
|
+
export type { RequirementView, ResolvedClaim, WalkedRequirement, } from "./requirement-walk.js";
|
|
84
|
+
export { renderRequirementTest } from "./templates/requirement-test.js";
|
|
85
|
+
export type { RequirementTestArgs } from "./templates/requirement-test.js";
|
|
86
|
+
export { reconcileOrphans, refusedOrphanMessage } from "./reconcile-orphans.js";
|
|
87
|
+
export type { OrphanDecision, ReconcileOrphansArgs, OrphanPolicy, } from "./reconcile-orphans.js";
|
|
88
|
+
export { sweepOrphans } from "./orphan-sweep.js";
|
|
89
|
+
export type { OrphanJob, SweepOrphansArgs, SweepOrphansResult, } from "./orphan-sweep.js";
|
|
78
90
|
//# 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":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5D,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB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AE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,YAAY,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,YAAY,EACV,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,eAAe,EACf,aAAa,EACb,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAO3E,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAChF,YAAY,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,GACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -87,4 +87,22 @@ export { templateGenerator, } from "./generators/template-generator.js";
|
|
|
87
87
|
export { FileSystemProvider, ProviderChain, frameworkTemplatesProvider, projectProvider, } from "./render-engine/framework-provider.js";
|
|
88
88
|
export { buildEntityDocData } from "./generators/docs-data-builder.js";
|
|
89
89
|
export { buildTemplateDocData } from "./generators/template-doc-builder.js";
|
|
90
|
+
// FR-038 — requirement-derived test stubs.
|
|
91
|
+
//
|
|
92
|
+
// Both the factory AND its primitives are exported deliberately. Scaffold-and-own
|
|
93
|
+
// means the application owns its generator file, but that is only a real escape
|
|
94
|
+
// hatch if it can compose one from parts — otherwise an app needing one different
|
|
95
|
+
// behaviour must reimplement the requirement walk, and reimplementing it badly is
|
|
96
|
+
// worse than the bug report this is meant to avoid.
|
|
97
|
+
export { requirementTests } from "./generators/requirement-tests.js";
|
|
98
|
+
export { requirementsFile } from "./generators/requirements-file.js";
|
|
99
|
+
export { walkRequirements, groupByConcern, concernOf, NO_CONCERN, } from "./requirement-walk.js";
|
|
100
|
+
export { renderRequirementTest } from "./templates/requirement-test.js";
|
|
101
|
+
// FR-038 §8 — deletion integrity. Pure decision logic: which no-longer-generated
|
|
102
|
+
// files may be removed, and which were hand-edited and must be refused instead.
|
|
103
|
+
// `OrphanPolicy` is the Generator field an app sets to opt in; `sweepOrphans` is
|
|
104
|
+
// the filesystem binding, exported so an app composing its own generator can
|
|
105
|
+
// reconcile the same way the runner does instead of hand-rolling the walk.
|
|
106
|
+
export { reconcileOrphans, refusedOrphanMessage } from "./reconcile-orphans.js";
|
|
107
|
+
export { sweepOrphans } from "./orphan-sweep.js";
|
|
90
108
|
//# 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,qDAAqD;AACrD,EAAE;AACF,yCAAyC;AACzC,wEAAwE;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE7E,+EAA+E;AAC/E,kEAAkE;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,qCAAqC,CAAC;AAS7C,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAIlG,0EAA0E;AAC1E,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,YAAY,GACb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,E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;AAG9E,uEAAuE;AACvE,OAAO,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEvH,6EAA6E;AAC7E,sEAAsE;AACtE,mCAAmC;AACnC,OAAO,EACL,iBAAiB,GAIlB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,0BAA0B,EAC1B,eAAe,GAChB,MAAM,uCAAuC,CAAC;AAS/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,2CAA2C;AAC3C,EAAE;AACF,kFAAkF;AAClF,gFAAgF;AAChF,kFAAkF;AAClF,kFAAkF;AAClF,oDAAoD;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAMrE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,UAAU,GACX,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,iFAAiF;AACjF,gFAAgF;AAChF,iFAAiF;AACjF,6EAA6E;AAC7E,2EAA2E;AAC3E,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAMhF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -146,29 +146,21 @@ export interface MetaobjectsGenConfig extends Omit<ResolvedGenConfig, "dbImport"
|
|
|
146
146
|
* loader. Composed AFTER the default core+forge bundle.
|
|
147
147
|
*/
|
|
148
148
|
providers?: readonly MetaDataTypeProvider[];
|
|
149
|
-
/** `meta verify` settings. Nothing here affects codegen. */
|
|
150
|
-
verify?: VerifyConfig;
|
|
151
|
-
}
|
|
152
|
-
/** `meta verify` settings. */
|
|
153
|
-
export interface VerifyConfig {
|
|
154
149
|
/**
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* **What counts as a test file is the project's call.** The built-in patterns cover
|
|
158
|
-
* the conventions this repo ports to (jest/vitest/bun, JUnit, Maven Failsafe `*IT`,
|
|
159
|
-
* xUnit/NUnit, pytest, Kotlin) and are a CONVENIENCE, not an authority — a list of
|
|
160
|
-
* guesses about someone else's repository will always be incomplete, and when it is,
|
|
161
|
-
* a requirement naming a real test reads as a broken claim. Anything declared here is
|
|
162
|
-
* added to the built-ins.
|
|
150
|
+
* MetaObjects-shipped library packages this project loads alongside its own metadata —
|
|
151
|
+
* `["ai"]` makes `extends: "metaobjects::ai::LlmCallBase"` resolve.
|
|
163
152
|
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
153
|
+
* Sits beside `providers` because it answers the same shape of question: what does this
|
|
154
|
+
* project's model need in scope beyond the files it declares. Opt-in, because a library
|
|
155
|
+
* registers real top-level nodes and a project that never references one should not find
|
|
156
|
+
* them in its model, its generated output or its docs.
|
|
166
157
|
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
158
|
+
* Threaded to `loadMemory` by every CLI command that loads metadata. Before it existed,
|
|
159
|
+
* `librarySources` was reachable only from `MetaDataLoader.fromDirectory` — which the
|
|
160
|
+
* CLI does not use — so a generator that consumes a library was registered FOR the CLI
|
|
161
|
+
* while its input was unreachable THROUGH it (#333).
|
|
170
162
|
*/
|
|
171
|
-
|
|
163
|
+
libraries?: readonly string[];
|
|
172
164
|
}
|
|
173
165
|
/** MetaobjectsGenConfig after applying defaults. All fields required.
|
|
174
166
|
* `targets` is Omitted from the base so it can narrow from the user-facing
|
|
@@ -189,7 +181,7 @@ export interface NormalizedMetaobjectsGenConfig extends Omit<MetaobjectsGenConfi
|
|
|
189
181
|
outputLayout: OutputLayout;
|
|
190
182
|
targets: Record<string, ResolvedTarget>;
|
|
191
183
|
}
|
|
192
|
-
export type DocsSurface = "model" | "api";
|
|
184
|
+
export type DocsSurface = "model" | "api" | "requirements";
|
|
193
185
|
export interface ApiSurface {
|
|
194
186
|
lang: string;
|
|
195
187
|
subDir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metaobjects-config.d.ts","sourceRoot":"","sources":["../src/metaobjects-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChI,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGrE;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC;AAE/C,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;AAC5C,gFAAgF;AAChF,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC3F,YAAY,EAAE,QAAQ,EAAE,CAAC;AACzB,YAAY,EAAE,YAAY,EAAE,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,4FAA4F;AAC5F,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,4CAA4C;AAC5C,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,4EAA4E;AAC5E,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO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gB,YAAY,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CAE/E;AAED;;kEAEkE;AAClE,wBAAgB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAwB3F;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,EAAE,CAqB9E;AAED,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,MAAM,EAAE,oBAAoB,GAAG,8BAA8B,CAmB5F"}
|
|
@@ -15,7 +15,11 @@ export function resolveDocsConfig(block, cli, fallbackLayout) {
|
|
|
15
15
|
outDir: cli.outDir ?? block?.outDir ?? "./docs",
|
|
16
16
|
layout: cli.layout ?? block?.layout ?? fallbackLayout,
|
|
17
17
|
baseUrl: cli.baseUrl ?? block?.baseUrl ?? "",
|
|
18
|
-
|
|
18
|
+
// `requirements` defaults ON. Safe ONLY because requirementsFile() emits ZERO
|
|
19
|
+
// files for a project declaring no `requirement.*` node — not an empty page. A
|
|
20
|
+
// project without a ledger sees byte-identical output to before the surface
|
|
21
|
+
// existed; see requirements-file.ts.
|
|
22
|
+
surfaces: cli.surfaces ?? block?.surfaces ?? ["model", "api", "requirements"],
|
|
19
23
|
apiSurfaces: cli.apiSurfaces ?? block?.apiSurfaces ?? [{ lang: "ts", subDir: "api" }],
|
|
20
24
|
};
|
|
21
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metaobjects-config.js","sourceRoot":"","sources":["../src/metaobjects-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAwD,MAAM,0BAA0B,CAAC;AAIhI,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAqB5D,4FAA4F;AAC5F,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AA0C7C;;wFAEwF;AACxF,MAAM,CAAC,MAAM,eAAe,GA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AAE,cAAc,CAAC,MAAM,CAAC;KAChC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type OrphanPolicy } from "./reconcile-orphans.js";
|
|
2
|
+
/** One opt-in generator's stake in the sweep. */
|
|
3
|
+
export interface OrphanJob {
|
|
4
|
+
/** For diagnostics — which generator's namespace this is. */
|
|
5
|
+
readonly generatorName: string;
|
|
6
|
+
/** Absolute directory this generator wrote to, i.e. the base its policy's
|
|
7
|
+
* relative paths are measured from. */
|
|
8
|
+
readonly writeOutDir: string;
|
|
9
|
+
readonly policy: OrphanPolicy;
|
|
10
|
+
}
|
|
11
|
+
export interface SweepOrphansArgs {
|
|
12
|
+
readonly genStateDir: string;
|
|
13
|
+
/** Absolute project root — the base gen-state keys are relative to. */
|
|
14
|
+
readonly projectRoot: string;
|
|
15
|
+
/** Project-relative paths written on THIS run, by ANY generator. A path some
|
|
16
|
+
* other generator now produces is not an orphan, so the whole run's output is
|
|
17
|
+
* the right exclusion set, not just the opting-in generator's. */
|
|
18
|
+
readonly emittedRelPaths: readonly string[];
|
|
19
|
+
readonly jobs: readonly OrphanJob[];
|
|
20
|
+
/** Decide and report, touch nothing. */
|
|
21
|
+
readonly dryRun: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface SweepOrphansResult {
|
|
24
|
+
/** Untouched orphans deleted (or, under dryRun, that would be). */
|
|
25
|
+
readonly removed: string[];
|
|
26
|
+
/** Hand-edited orphans left alone and reported. */
|
|
27
|
+
readonly refused: string[];
|
|
28
|
+
/** Which generator's namespace each refusal came from, so the caller can name it
|
|
29
|
+
* instead of assuming one. `orphanPolicy` is a generic `Generator` field and an app
|
|
30
|
+
* is encouraged to compose its own generator, so a message hardcoding one
|
|
31
|
+
* generator's name would be wrong for exactly the users the seam exists for. */
|
|
32
|
+
readonly refusedBy: ReadonlyMap<string, string>;
|
|
33
|
+
/** Hand-edited orphans deleted because their policy set `force`. Separate from
|
|
34
|
+
* `removed` so the caller can say the louder thing about them. */
|
|
35
|
+
readonly forced: string[];
|
|
36
|
+
}
|
|
37
|
+
export declare function sweepOrphans(args: SweepOrphansArgs): SweepOrphansResult;
|
|
38
|
+
//# sourceMappingURL=orphan-sweep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orphan-sweep.d.ts","sourceRoot":"","sources":["../src/orphan-sweep.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE7E,iDAAiD;AACjD,MAAM,WAAW,SAAS;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;4CACwC;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;uEAEmE;IACnE,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,CAAC;IACpC,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAC3B;;;qFAGiF;IACjF,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD;uEACmE;IACnE,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;CAC3B;AASD,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,kBAAkB,CAqGvE"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// FR-038 §8 — bind the orphan decision to the filesystem.
|
|
2
|
+
//
|
|
3
|
+
// reconcile-orphans.ts is deliberately pure: it answers "remove, refuse, or
|
|
4
|
+
// already gone?" from readers the caller supplies. This module supplies those
|
|
5
|
+
// readers, applies the answer, and keeps `.gen-state` honest afterwards. Keeping
|
|
6
|
+
// the two apart is what lets the RULE be tested without a filesystem and the
|
|
7
|
+
// PLUMBING be tested against real files, rather than only through a full runGen.
|
|
8
|
+
//
|
|
9
|
+
// Three properties this file is responsible for, none of which the pure decision
|
|
10
|
+
// can enforce on its own:
|
|
11
|
+
//
|
|
12
|
+
// 1. NAMESPACE SCOPE. A generator's `owns` predicate speaks in paths relative
|
|
13
|
+
// to its own output directory; gen-state speaks in project-relative paths.
|
|
14
|
+
// Translating between them is where a boundary is won or lost, so a path
|
|
15
|
+
// that resolves outside the generator's directory is never even offered to
|
|
16
|
+
// the predicate.
|
|
17
|
+
// 2. RECORD HYGIENE. A removed or already-gone path must be forgotten, or the
|
|
18
|
+
// next run re-decides a settled orphan forever. A REFUSED path must be
|
|
19
|
+
// kept, or a refusal degrades into permanent silence on the run after.
|
|
20
|
+
// 3. DRY-RUN HONESTY. `--dry-run` must report a pending deletion and perform
|
|
21
|
+
// none, because a preview that hides a deletion is worse than no preview.
|
|
22
|
+
import { existsSync, readFileSync, rmSync } from "node:fs";
|
|
23
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
24
|
+
import { listGeneratedPaths, isPristineGenerated, forgetGeneratedPaths, } from "./overwrite-policy.js";
|
|
25
|
+
import { reconcileOrphans } from "./reconcile-orphans.js";
|
|
26
|
+
/** gen-state keys carry the platform separator; an `owns` predicate is written
|
|
27
|
+
* against generated output, which is always `/`-separated. Normalize once so a
|
|
28
|
+
* predicate authored the obvious way is not silently wrong off Linux. */
|
|
29
|
+
function toPosix(p) {
|
|
30
|
+
return sep === "/" ? p : p.split(sep).join("/");
|
|
31
|
+
}
|
|
32
|
+
export function sweepOrphans(args) {
|
|
33
|
+
if (args.jobs.length === 0) {
|
|
34
|
+
return { removed: [], refused: [], forced: [], refusedBy: new Map() };
|
|
35
|
+
}
|
|
36
|
+
const previouslyGenerated = listGeneratedPaths(args.genStateDir);
|
|
37
|
+
if (previouslyGenerated.length === 0) {
|
|
38
|
+
return { removed: [], refused: [], forced: [], refusedBy: new Map() };
|
|
39
|
+
}
|
|
40
|
+
// NOT normalized: both sides of this comparison are produced by
|
|
41
|
+
// `relative(projectRoot, …)` — gen-state's keys and the runner's emitted paths
|
|
42
|
+
// alike — so they already share whatever separator the platform uses.
|
|
43
|
+
// Normalizing one side is what would break them apart. `toPosix` is used only
|
|
44
|
+
// where a HUMAN-authored string is involved (the `owns` predicate below).
|
|
45
|
+
const emitted = args.emittedRelPaths;
|
|
46
|
+
// A path can fall inside two jobs' namespaces (an app may register several
|
|
47
|
+
// requirementTests() instances). Sets keep the second visit from re-reporting
|
|
48
|
+
// a file the first already dealt with.
|
|
49
|
+
const removed = new Set();
|
|
50
|
+
const refused = new Set();
|
|
51
|
+
const forced = new Set();
|
|
52
|
+
const forget = new Set();
|
|
53
|
+
const refusedBy = new Map();
|
|
54
|
+
for (const job of args.jobs) {
|
|
55
|
+
const decision = reconcileOrphans({
|
|
56
|
+
previouslyGenerated,
|
|
57
|
+
emitted,
|
|
58
|
+
owns: (relPath) => {
|
|
59
|
+
const inTarget = relative(job.writeOutDir, resolve(args.projectRoot, relPath));
|
|
60
|
+
// "" is the directory itself; a `..` prefix or an absolute result means
|
|
61
|
+
// the path is outside this generator's output entirely. Neither is
|
|
62
|
+
// something the predicate should get a say in.
|
|
63
|
+
if (inTarget === "" || inTarget.startsWith("..") || isAbsolute(inTarget)) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
return job.policy.owns(toPosix(inTarget));
|
|
67
|
+
},
|
|
68
|
+
exists: (relPath) => existsSync(resolve(args.projectRoot, relPath)),
|
|
69
|
+
// The committed hash manifest, NOT the snapshot body — the bodies are
|
|
70
|
+
// gitignored, so on a fresh clone a body-based check could never prove a
|
|
71
|
+
// file untouched and orphan cleanup would refuse everything forever.
|
|
72
|
+
isUntouched: (relPath) => {
|
|
73
|
+
const full = resolve(args.projectRoot, relPath);
|
|
74
|
+
if (!existsSync(full))
|
|
75
|
+
return false;
|
|
76
|
+
return isPristineGenerated(args.genStateDir, relPath, readFileSync(full, "utf-8"));
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
for (const relPath of decision.remove) {
|
|
80
|
+
if (refused.has(relPath) || forced.has(relPath))
|
|
81
|
+
continue;
|
|
82
|
+
removed.add(relPath);
|
|
83
|
+
forget.add(relPath);
|
|
84
|
+
}
|
|
85
|
+
for (const relPath of decision.refused) {
|
|
86
|
+
// `refused` belongs in this guard too. Without it, a path already refused by a
|
|
87
|
+
// non-forcing job could be picked up by a later FORCING job whose namespace
|
|
88
|
+
// overlaps (the file anticipates several requirementTests() instances), landing
|
|
89
|
+
// in `refused` and `forced` at once — deleted from disk, while
|
|
90
|
+
// `refusedOrphanMessage` tells the user it "was NOT deleted".
|
|
91
|
+
//
|
|
92
|
+
// First decision wins: a refusal is the conservative answer, and letting a
|
|
93
|
+
// later job escalate it to a deletion would make the outcome depend on job
|
|
94
|
+
// ORDER, which is exactly the ambiguity the runner's duplicate-path guard
|
|
95
|
+
// exists to reject elsewhere.
|
|
96
|
+
if (removed.has(relPath) || forced.has(relPath) || refused.has(relPath))
|
|
97
|
+
continue;
|
|
98
|
+
if (job.policy.force === true) {
|
|
99
|
+
forced.add(relPath);
|
|
100
|
+
forget.add(relPath);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
// Deliberately NOT forgotten: the record is what makes the refusal
|
|
104
|
+
// repeat until someone resolves it.
|
|
105
|
+
refused.add(relPath);
|
|
106
|
+
refusedBy.set(relPath, job.generatorName);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Nothing on disk to report — the file is already gone. Clear the stale
|
|
110
|
+
// record so this stops being reconsidered on every future run.
|
|
111
|
+
for (const relPath of decision.vanished)
|
|
112
|
+
forget.add(relPath);
|
|
113
|
+
}
|
|
114
|
+
if (!args.dryRun) {
|
|
115
|
+
for (const relPath of [...removed, ...forced]) {
|
|
116
|
+
rmSync(resolve(args.projectRoot, relPath), { force: true });
|
|
117
|
+
}
|
|
118
|
+
// Batched: the per-path form rewrites the whole manifest each call, so clearing
|
|
119
|
+
// k orphans rewrote it k times for an identical result.
|
|
120
|
+
forgetGeneratedPaths(args.genStateDir, forget);
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
removed: [...removed].sort(),
|
|
124
|
+
refused: [...refused].sort(),
|
|
125
|
+
forced: [...forced].sort(),
|
|
126
|
+
refusedBy,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=orphan-sweep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orphan-sweep.js","sourceRoot":"","sources":["../src/orphan-sweep.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,iFAAiF;AACjF,6EAA6E;AAC7E,iFAAiF;AACjF,EAAE;AACF,iFAAiF;AACjF,0BAA0B;AAC1B,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,sBAAsB;AACtB,gFAAgF;AAChF,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAE/E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB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IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE;QAC5B,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE;QAC5B,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE;QAC1B,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export type WriteStatus = "new" | "unchanged" | "overwrite" | "merged" | "conflict" | "refused" | "skipped"
|
|
1
|
+
export type WriteStatus = "new" | "unchanged" | "overwrite" | "merged" | "conflict" | "refused" | "skipped"
|
|
2
|
+
/** FR-038 §8 — deleted because it was generated by a previous run, is no longer
|
|
3
|
+
* generated, and was never edited by hand. Reported as a file outcome rather
|
|
4
|
+
* than a warning because a deletion is exactly as consequential as a write,
|
|
5
|
+
* and a run summary that lists writes but hides deletions is how a silent
|
|
6
|
+
* deletion happens. */
|
|
7
|
+
| "removed";
|
|
2
8
|
/**
|
|
3
9
|
* "overwrite" — default; three-way merge if .gen-state exists, else write-if-
|
|
4
10
|
* different / first-time-existing flow.
|
|
@@ -27,10 +33,74 @@ export interface DecideAndWriteOpts {
|
|
|
27
33
|
export interface WriteResult {
|
|
28
34
|
path: string;
|
|
29
35
|
status: WriteStatus;
|
|
30
|
-
/** Present when status is "conflict" — human-readable
|
|
31
|
-
*
|
|
36
|
+
/** Present when status is "conflict" or "refused" — human-readable reason,
|
|
37
|
+
* naming what the user must do. A refusal nobody can act on gets the file
|
|
38
|
+
* deleted by hand, which is the outcome refusing exists to prevent. */
|
|
32
39
|
conflictHint?: string;
|
|
33
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Every snapshot key recorded under `genStateDir` — in a runner-driven project,
|
|
43
|
+
* the project-relative path of every file some previous `meta gen` wrote.
|
|
44
|
+
*
|
|
45
|
+
* Empty for a gen-state directory that does not exist yet, which is what makes a
|
|
46
|
+
* first run, an ephemeral test run and `verify --codegen`'s throwaway root all
|
|
47
|
+
* reconcile nothing.
|
|
48
|
+
*/
|
|
49
|
+
export declare function listGeneratedPaths(genStateDir: string): string[];
|
|
50
|
+
/**
|
|
51
|
+
* sha-256 of `content`, hex — the same function that produces `.hashes.json`.
|
|
52
|
+
*
|
|
53
|
+
* Exported so a caller can ask the one question the manifest exists to answer
|
|
54
|
+
* ("is this file byte-for-byte what we recorded writing?") without needing the
|
|
55
|
+
* snapshot body, which is what makes the answer available on a fresh clone.
|
|
56
|
+
*/
|
|
57
|
+
export declare function contentHash(content: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* The hash we recorded when we last wrote `relPath`, or undefined if we have no
|
|
60
|
+
* record of ever writing it.
|
|
61
|
+
*
|
|
62
|
+
* This is the COMMITTED half of `.gen-state`. The snapshot bodies stay ignored —
|
|
63
|
+
* they are a second full copy of all generated output — but a hash per path is
|
|
64
|
+
* small enough to commit and review, and it is sufficient to distinguish "nobody
|
|
65
|
+
* touched this" from "somebody edited this", which is the only distinction the
|
|
66
|
+
* overwrite and delete decisions actually need.
|
|
67
|
+
*/
|
|
68
|
+
export declare function readGeneratedHash(genStateDir: string, relPath: string): string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* True when the file at `relPath` is byte-for-byte what we recorded writing.
|
|
71
|
+
*
|
|
72
|
+
* FAILS CLOSED: with no recorded hash we cannot prove anything, so the answer is
|
|
73
|
+
* false. Both the write path and the orphan-delete path ask this one question of
|
|
74
|
+
* this one piece of evidence — before this existed they answered the same
|
|
75
|
+
* uncertainty in opposite directions inside a single feature, refusing to DELETE
|
|
76
|
+
* a hand-edited file while silently OVERWRITING one.
|
|
77
|
+
*/
|
|
78
|
+
export declare function isPristineGenerated(genStateDir: string, relPath: string, current: string): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* The snapshot of what we last wrote to `relPath`, or undefined when there is no
|
|
81
|
+
* trustworthy one.
|
|
82
|
+
*
|
|
83
|
+
* HASH-CHECKED on purpose. A caller comparing this against the file on disk is
|
|
84
|
+
* asking "is the output still exactly what I wrote?" — and a snapshot that fails
|
|
85
|
+
* its own hash cannot answer that. Returning the stale text would let a
|
|
86
|
+
* reconciling caller conclude "untouched" and delete a file it cannot vouch for,
|
|
87
|
+
* so a tampered snapshot reads as absent and the caller fails closed.
|
|
88
|
+
*/
|
|
89
|
+
export declare function readGeneratedSnapshot(genStateDir: string, relPath: string): string | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Drop both halves of the record for paths this run no longer generates — each
|
|
92
|
+
* snapshot file and its `.hashes.json` entry.
|
|
93
|
+
*
|
|
94
|
+
* BOTH halves, or the next run sees the path again in `listGeneratedPaths` and
|
|
95
|
+
* re-decides an orphan that has already been dealt with. A no-op for a path that was
|
|
96
|
+
* never generated.
|
|
97
|
+
*
|
|
98
|
+
* Batched deliberately: one manifest read and one write for the whole set. A per-path
|
|
99
|
+
* variant re-reads, re-sorts and rewrites the entire manifest every call, so clearing k
|
|
100
|
+
* orphans rewrote it k times — on a project with hundreds of generated files that makes
|
|
101
|
+
* bookkeeping the dominant cost of `meta gen`, for an identical result.
|
|
102
|
+
*/
|
|
103
|
+
export declare function forgetGeneratedPaths(genStateDir: string, relPaths: Iterable<string>): void;
|
|
34
104
|
/**
|
|
35
105
|
* The codegen engine version that last wrote this `.gen-state`, or undefined if it
|
|
36
106
|
* was never stamped (a pre-#232 snapshot, or a fresh project). Informational only —
|
|
@@ -45,6 +115,30 @@ export declare function saveEngineVersion(genStateDir: string, version: string):
|
|
|
45
115
|
export declare class GitMissingError extends Error {
|
|
46
116
|
constructor();
|
|
47
117
|
}
|
|
118
|
+
/** True when this project has a hash manifest at all — as opposed to a manifest
|
|
119
|
+
* that simply has no entry for some path.
|
|
120
|
+
*
|
|
121
|
+
* The distinction drives the upgrade message: a project with NO manifest predates
|
|
122
|
+
* the manifest being committed, so its refusals are one fixable configuration
|
|
123
|
+
* problem rather than N independent hand edits, and it deserves one instruction
|
|
124
|
+
* instead of a wall of per-file warnings. */
|
|
125
|
+
export declare function hasHashManifest(genStateDir: string): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* What `decideAndWrite` WOULD do, touching nothing. Backs `meta gen --dry-run`.
|
|
128
|
+
*
|
|
129
|
+
* Exact for every outcome the hash manifest decides, because those are pure
|
|
130
|
+
* comparisons — `classifyWrite` above is the single source for which one applies.
|
|
131
|
+
* Deliberately COARSE in one place: with a snapshot body present the result depends
|
|
132
|
+
* on whether `git merge-file` comes back clean or conflicted, which cannot be known
|
|
133
|
+
* without performing the merge — so that case reports `overwrite`, meaning "this
|
|
134
|
+
* file will be rewritten", which is true either way.
|
|
135
|
+
*
|
|
136
|
+
* The reason this exists as its own function rather than a flag on
|
|
137
|
+
* `decideAndWrite`: a preview must be incapable of writing, and the cheapest way to
|
|
138
|
+
* guarantee that is to give it no write in its body at all — mapping a `WriteCase`
|
|
139
|
+
* to a status touches no file and no manifest.
|
|
140
|
+
*/
|
|
141
|
+
export declare function previewWriteStatus(path: string, content: string, optsOrStrategy?: DecideAndWriteOpts | MergeStrategy): WriteStatus;
|
|
48
142
|
/**
|
|
49
143
|
* The main entry point. Backward-compatible with the rc.11 signature: passing
|
|
50
144
|
* a `MergeStrategy` string as the third argument continues to work; passing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overwrite-policy.d.ts","sourceRoot":"","sources":["../src/overwrite-policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"overwrite-policy.d.ts","sourceRoot":"","sources":["../src/overwrite-policy.ts"],"names":[],"mappings":"AA+CA,MAAM,MAAM,WAAW,GACnB,KAAK,GACL,WAAW,GACX,WAAW,GACX,QAAQ,GACR,UAAU,GACV,SAAS,GACT,SAAS;AACX;;;;wBAIwB;GACtB,SAAS,CAAC;AAEd;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,eAAe,CAAC;AAE1D;;;iDAGiD;AACjD,M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