@seanmars/tospec 0.24.0 → 0.26.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/CHANGELOG.md +243 -0
- package/README.md +10 -6
- package/assets/dashboard/lib/derive.js +11 -5
- package/assets/dashboard/lib/store.js +4 -2
- package/assets/dashboard/views/change.js +5 -3
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +42 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +213 -100
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/dashboard.d.ts +9 -0
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +77 -21
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/decision.d.ts +38 -1
- package/dist/commands/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +303 -27
- package/dist/commands/decision.js.map +1 -1
- package/dist/commands/metrics.d.ts +3 -4
- package/dist/commands/metrics.d.ts.map +1 -1
- package/dist/commands/metrics.js +3 -5
- package/dist/commands/metrics.js.map +1 -1
- package/dist/commands/shared-output.d.ts +24 -0
- package/dist/commands/shared-output.d.ts.map +1 -1
- package/dist/commands/shared-output.js +21 -2
- package/dist/commands/shared-output.js.map +1 -1
- package/dist/commands/show.d.ts.map +1 -1
- package/dist/commands/show.js +12 -9
- package/dist/commands/show.js.map +1 -1
- package/dist/commands/validate.d.ts +19 -0
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +243 -64
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/workflow/instructions.d.ts +7 -1
- package/dist/commands/workflow/instructions.d.ts.map +1 -1
- package/dist/commands/workflow/instructions.js +299 -81
- package/dist/commands/workflow/instructions.js.map +1 -1
- package/dist/commands/workflow/new-change.d.ts.map +1 -1
- package/dist/commands/workflow/new-change.js +26 -17
- package/dist/commands/workflow/new-change.js.map +1 -1
- package/dist/commands/workflow/prompt-escape.d.ts +25 -0
- package/dist/commands/workflow/prompt-escape.d.ts.map +1 -0
- package/dist/commands/workflow/prompt-escape.js +62 -0
- package/dist/commands/workflow/prompt-escape.js.map +1 -0
- package/dist/commands/workflow/schemas.d.ts.map +1 -1
- package/dist/commands/workflow/schemas.js +34 -16
- package/dist/commands/workflow/schemas.js.map +1 -1
- package/dist/commands/workflow/shared.d.ts +46 -10
- package/dist/commands/workflow/shared.d.ts.map +1 -1
- package/dist/commands/workflow/shared.js +66 -30
- package/dist/commands/workflow/shared.js.map +1 -1
- package/dist/commands/workflow/status.d.ts +5 -2
- package/dist/commands/workflow/status.d.ts.map +1 -1
- package/dist/commands/workflow/status.js +62 -28
- package/dist/commands/workflow/status.js.map +1 -1
- package/dist/core/archive.d.ts +38 -0
- package/dist/core/archive.d.ts.map +1 -1
- package/dist/core/archive.js +492 -75
- package/dist/core/archive.js.map +1 -1
- package/dist/core/artifact-graph/index.d.ts +2 -2
- package/dist/core/artifact-graph/index.d.ts.map +1 -1
- package/dist/core/artifact-graph/index.js +2 -2
- package/dist/core/artifact-graph/index.js.map +1 -1
- package/dist/core/artifact-graph/instruction-loader.d.ts +8 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -1
- package/dist/core/artifact-graph/instruction-loader.js +58 -36
- package/dist/core/artifact-graph/instruction-loader.js.map +1 -1
- package/dist/core/artifact-graph/resolver.d.ts +39 -12
- package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
- package/dist/core/artifact-graph/resolver.js +82 -36
- package/dist/core/artifact-graph/resolver.js.map +1 -1
- package/dist/core/artifact-graph/schema.d.ts +24 -0
- package/dist/core/artifact-graph/schema.d.ts.map +1 -1
- package/dist/core/artifact-graph/schema.js +32 -1
- package/dist/core/artifact-graph/schema.js.map +1 -1
- package/dist/core/artifact-graph/stub-detection.d.ts +10 -2
- package/dist/core/artifact-graph/stub-detection.d.ts.map +1 -1
- package/dist/core/artifact-graph/stub-detection.js +18 -11
- package/dist/core/artifact-graph/stub-detection.js.map +1 -1
- package/dist/core/artifact-graph/types.d.ts +2 -2
- package/dist/core/artifact-graph/types.d.ts.map +1 -1
- package/dist/core/artifact-graph/types.js +10 -1
- package/dist/core/artifact-graph/types.js.map +1 -1
- package/dist/core/change-metadata/schema.d.ts.map +1 -1
- package/dist/core/change-metadata/schema.js +18 -4
- package/dist/core/change-metadata/schema.js.map +1 -1
- package/dist/core/change-presenter.d.ts.map +1 -1
- package/dist/core/change-presenter.js +13 -8
- package/dist/core/change-presenter.js.map +1 -1
- package/dist/core/change-status-policy.d.ts.map +1 -1
- package/dist/core/change-status-policy.js +3 -1
- package/dist/core/change-status-policy.js.map +1 -1
- package/dist/core/codex-metrics.d.ts +1 -1
- package/dist/core/codex-metrics.js +1 -1
- package/dist/core/config-schema.d.ts +8 -0
- package/dist/core/config-schema.d.ts.map +1 -1
- package/dist/core/config-schema.js +10 -0
- package/dist/core/config-schema.js.map +1 -1
- package/dist/core/dashboard-activity.d.ts +4 -4
- package/dist/core/dashboard-activity.js +4 -4
- package/dist/core/dashboard-data.d.ts +11 -5
- package/dist/core/dashboard-data.d.ts.map +1 -1
- package/dist/core/dashboard-data.js +54 -28
- package/dist/core/dashboard-data.js.map +1 -1
- package/dist/core/dashboard-hub.d.ts +3 -3
- package/dist/core/dashboard-hub.d.ts.map +1 -1
- package/dist/core/dashboard-hub.js +16 -4
- package/dist/core/dashboard-hub.js.map +1 -1
- package/dist/core/dashboard-routes.d.ts +2 -1
- package/dist/core/dashboard-routes.d.ts.map +1 -1
- package/dist/core/dashboard-routes.js +102 -33
- package/dist/core/dashboard-routes.js.map +1 -1
- package/dist/core/global-config.d.ts +71 -2
- package/dist/core/global-config.d.ts.map +1 -1
- package/dist/core/global-config.js +149 -4
- package/dist/core/global-config.js.map +1 -1
- package/dist/core/id.d.ts +9 -0
- package/dist/core/id.d.ts.map +1 -1
- package/dist/core/id.js +37 -0
- package/dist/core/id.js.map +1 -1
- package/dist/core/init.d.ts +9 -2
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +116 -33
- package/dist/core/init.js.map +1 -1
- package/dist/core/list.d.ts.map +1 -1
- package/dist/core/list.js +69 -45
- package/dist/core/list.js.map +1 -1
- package/dist/core/local-server.d.ts +9 -2
- package/dist/core/local-server.d.ts.map +1 -1
- package/dist/core/local-server.js +24 -4
- package/dist/core/local-server.js.map +1 -1
- package/dist/core/markdown-render.d.ts.map +1 -1
- package/dist/core/markdown-render.js +7 -2
- package/dist/core/markdown-render.js.map +1 -1
- package/dist/core/migrate.d.ts +24 -2
- package/dist/core/migrate.d.ts.map +1 -1
- package/dist/core/migrate.js +335 -59
- package/dist/core/migrate.js.map +1 -1
- package/dist/core/parsers/change-parser.d.ts +20 -1
- package/dist/core/parsers/change-parser.d.ts.map +1 -1
- package/dist/core/parsers/change-parser.js +76 -73
- package/dist/core/parsers/change-parser.js.map +1 -1
- package/dist/core/parsers/markdown-parser.d.ts +24 -0
- package/dist/core/parsers/markdown-parser.d.ts.map +1 -1
- package/dist/core/parsers/markdown-parser.js +65 -10
- package/dist/core/parsers/markdown-parser.js.map +1 -1
- package/dist/core/parsers/requirement-blocks.d.ts +127 -6
- package/dist/core/parsers/requirement-blocks.d.ts.map +1 -1
- package/dist/core/parsers/requirement-blocks.js +349 -56
- package/dist/core/parsers/requirement-blocks.js.map +1 -1
- package/dist/core/parsers/requirement-text.d.ts +25 -1
- package/dist/core/parsers/requirement-text.d.ts.map +1 -1
- package/dist/core/parsers/requirement-text.js +62 -6
- package/dist/core/parsers/requirement-text.js.map +1 -1
- package/dist/core/parsers/spec-structure.d.ts.map +1 -1
- package/dist/core/parsers/spec-structure.js +36 -24
- package/dist/core/parsers/spec-structure.js.map +1 -1
- package/dist/core/project-config.d.ts +9 -2
- package/dist/core/project-config.d.ts.map +1 -1
- package/dist/core/project-config.js +30 -7
- package/dist/core/project-config.js.map +1 -1
- package/dist/core/project-layout.d.ts +26 -0
- package/dist/core/project-layout.d.ts.map +1 -1
- package/dist/core/project-layout.js +51 -1
- package/dist/core/project-layout.js.map +1 -1
- package/dist/core/schema-names.d.ts +17 -0
- package/dist/core/schema-names.d.ts.map +1 -1
- package/dist/core/schema-names.js +24 -0
- package/dist/core/schema-names.js.map +1 -1
- package/dist/core/shared/index.d.ts +1 -1
- package/dist/core/shared/index.d.ts.map +1 -1
- package/dist/core/shared/index.js +1 -1
- package/dist/core/shared/index.js.map +1 -1
- package/dist/core/shared/rules-generation.d.ts +12 -0
- package/dist/core/shared/rules-generation.d.ts.map +1 -1
- package/dist/core/shared/rules-generation.js +26 -2
- package/dist/core/shared/rules-generation.js.map +1 -1
- package/dist/core/shared/skill-generation.d.ts +7 -0
- package/dist/core/shared/skill-generation.d.ts.map +1 -1
- package/dist/core/shared/skill-generation.js +19 -0
- package/dist/core/shared/skill-generation.js.map +1 -1
- package/dist/core/shared/tool-detection.d.ts +10 -1
- package/dist/core/shared/tool-detection.d.ts.map +1 -1
- package/dist/core/shared/tool-detection.js +37 -6
- package/dist/core/shared/tool-detection.js.map +1 -1
- package/dist/core/spec-presenter.d.ts.map +1 -1
- package/dist/core/spec-presenter.js +23 -1
- package/dist/core/spec-presenter.js.map +1 -1
- package/dist/core/specs-apply.d.ts +98 -1
- package/dist/core/specs-apply.d.ts.map +1 -1
- package/dist/core/specs-apply.js +426 -63
- package/dist/core/specs-apply.js.map +1 -1
- package/dist/core/templates/fragments/change-diff.d.ts +37 -0
- package/dist/core/templates/fragments/change-diff.d.ts.map +1 -0
- package/dist/core/templates/fragments/change-diff.js +37 -0
- package/dist/core/templates/fragments/change-diff.js.map +1 -0
- package/dist/core/templates/fragments/sync-fail.d.ts +8 -0
- package/dist/core/templates/fragments/sync-fail.d.ts.map +1 -0
- package/dist/core/templates/fragments/sync-fail.js +8 -0
- package/dist/core/templates/fragments/sync-fail.js.map +1 -0
- package/dist/core/templates/fragments/validate.d.ts +14 -1
- package/dist/core/templates/fragments/validate.d.ts.map +1 -1
- package/dist/core/templates/fragments/validate.js +14 -1
- package/dist/core/templates/fragments/validate.js.map +1 -1
- package/dist/core/templates/fragments/verify.d.ts +2 -2
- package/dist/core/templates/fragments/verify.d.ts.map +1 -1
- package/dist/core/templates/fragments/verify.js +8 -5
- package/dist/core/templates/fragments/verify.js.map +1 -1
- package/dist/core/templates/workflows/apply.d.ts +1 -1
- package/dist/core/templates/workflows/apply.d.ts.map +1 -1
- package/dist/core/templates/workflows/apply.js +29 -10
- package/dist/core/templates/workflows/apply.js.map +1 -1
- package/dist/core/templates/workflows/archive.d.ts.map +1 -1
- package/dist/core/templates/workflows/archive.js +27 -9
- package/dist/core/templates/workflows/archive.js.map +1 -1
- package/dist/core/templates/workflows/decision.d.ts.map +1 -1
- package/dist/core/templates/workflows/decision.js +10 -4
- package/dist/core/templates/workflows/decision.js.map +1 -1
- package/dist/core/templates/workflows/explore.d.ts +2 -2
- package/dist/core/templates/workflows/explore.d.ts.map +1 -1
- package/dist/core/templates/workflows/explore.js +7 -3
- package/dist/core/templates/workflows/explore.js.map +1 -1
- package/dist/core/templates/workflows/grill.d.ts +2 -2
- package/dist/core/templates/workflows/grill.d.ts.map +1 -1
- package/dist/core/templates/workflows/grill.js +5 -4
- package/dist/core/templates/workflows/grill.js.map +1 -1
- package/dist/core/templates/workflows/issue.d.ts.map +1 -1
- package/dist/core/templates/workflows/issue.js +9 -3
- package/dist/core/templates/workflows/issue.js.map +1 -1
- package/dist/core/templates/workflows/propose.d.ts.map +1 -1
- package/dist/core/templates/workflows/propose.js +4 -1
- package/dist/core/templates/workflows/propose.js.map +1 -1
- package/dist/core/templates/workflows/sync.d.ts.map +1 -1
- package/dist/core/templates/workflows/sync.js +25 -11
- package/dist/core/templates/workflows/sync.js.map +1 -1
- package/dist/core/templates/workflows/update.d.ts.map +1 -1
- package/dist/core/templates/workflows/update.js +17 -10
- package/dist/core/templates/workflows/update.js.map +1 -1
- package/dist/core/update.d.ts +5 -0
- package/dist/core/update.d.ts.map +1 -1
- package/dist/core/update.js +66 -29
- package/dist/core/update.js.map +1 -1
- package/dist/core/validation/constants.d.ts +7 -1
- package/dist/core/validation/constants.d.ts.map +1 -1
- package/dist/core/validation/constants.js +16 -2
- package/dist/core/validation/constants.js.map +1 -1
- package/dist/core/validation/purpose-placeholder.d.ts.map +1 -1
- package/dist/core/validation/purpose-placeholder.js +35 -11
- package/dist/core/validation/purpose-placeholder.js.map +1 -1
- package/dist/core/validation/section-validator.d.ts +7 -0
- package/dist/core/validation/section-validator.d.ts.map +1 -1
- package/dist/core/validation/section-validator.js +22 -2
- package/dist/core/validation/section-validator.js.map +1 -1
- package/dist/core/validation/sister-changes.d.ts +93 -0
- package/dist/core/validation/sister-changes.d.ts.map +1 -0
- package/dist/core/validation/sister-changes.js +180 -0
- package/dist/core/validation/sister-changes.js.map +1 -0
- package/dist/core/validation/task-markers.d.ts +9 -0
- package/dist/core/validation/task-markers.d.ts.map +1 -0
- package/dist/core/validation/task-markers.js +71 -0
- package/dist/core/validation/task-markers.js.map +1 -0
- package/dist/core/validation/types.d.ts +58 -0
- package/dist/core/validation/types.d.ts.map +1 -1
- package/dist/core/validation/types.js +22 -0
- package/dist/core/validation/types.js.map +1 -1
- package/dist/core/validation/validator.d.ts +79 -2
- package/dist/core/validation/validator.d.ts.map +1 -1
- package/dist/core/validation/validator.js +565 -84
- package/dist/core/validation/validator.js.map +1 -1
- package/dist/utils/change-metadata.d.ts +62 -5
- package/dist/utils/change-metadata.d.ts.map +1 -1
- package/dist/utils/change-metadata.js +193 -31
- package/dist/utils/change-metadata.js.map +1 -1
- package/dist/utils/change-utils.d.ts +21 -0
- package/dist/utils/change-utils.d.ts.map +1 -1
- package/dist/utils/change-utils.js +168 -53
- package/dist/utils/change-utils.js.map +1 -1
- package/dist/utils/command-line.d.ts +11 -0
- package/dist/utils/command-line.d.ts.map +1 -0
- package/dist/utils/command-line.js +43 -0
- package/dist/utils/command-line.js.map +1 -0
- package/dist/utils/display-width.d.ts +10 -0
- package/dist/utils/display-width.d.ts.map +1 -0
- package/dist/utils/display-width.js +15 -0
- package/dist/utils/display-width.js.map +1 -0
- package/dist/utils/file-system.d.ts +16 -0
- package/dist/utils/file-system.d.ts.map +1 -1
- package/dist/utils/file-system.js +49 -2
- package/dist/utils/file-system.js.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +11 -5
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/interactive.d.ts.map +1 -1
- package/dist/utils/interactive.js +3 -1
- package/dist/utils/interactive.js.map +1 -1
- package/dist/utils/item-discovery.d.ts +3 -2
- package/dist/utils/item-discovery.d.ts.map +1 -1
- package/dist/utils/item-discovery.js +34 -16
- package/dist/utils/item-discovery.js.map +1 -1
- package/dist/utils/link.d.ts +0 -1
- package/dist/utils/link.d.ts.map +1 -1
- package/dist/utils/link.js +0 -1
- package/dist/utils/link.js.map +1 -1
- package/dist/utils/match.d.ts.map +1 -1
- package/dist/utils/match.js +10 -1
- package/dist/utils/match.js.map +1 -1
- package/dist/utils/option-flags.d.ts +9 -0
- package/dist/utils/option-flags.d.ts.map +1 -0
- package/dist/utils/option-flags.js +12 -0
- package/dist/utils/option-flags.js.map +1 -0
- package/dist/utils/sentence.d.ts +9 -0
- package/dist/utils/sentence.d.ts.map +1 -0
- package/dist/utils/sentence.js +12 -0
- package/dist/utils/sentence.js.map +1 -0
- package/dist/utils/spec-files.d.ts +84 -1
- package/dist/utils/spec-files.d.ts.map +1 -1
- package/dist/utils/spec-files.js +192 -3
- package/dist/utils/spec-files.js.map +1 -1
- package/dist/utils/task-progress.d.ts.map +1 -1
- package/dist/utils/task-progress.js +32 -9
- package/dist/utils/task-progress.js.map +1 -1
- package/dist/utils/timestamp.d.ts +27 -0
- package/dist/utils/timestamp.d.ts.map +1 -1
- package/dist/utils/timestamp.js +37 -0
- package/dist/utils/timestamp.js.map +1 -1
- package/package.json +4 -1
- package/schemas/decision/templates/decision.md +2 -2
- package/schemas/issue/schema.yaml +12 -6
- package/schemas/issue/templates/task.md +1 -1
- package/schemas/sdd/schema.yaml +21 -10
- package/schemas/sdd/templates/proposal.md +1 -1
|
@@ -25,12 +25,34 @@ export declare function normalizeRequirementName(name: string): string;
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function foldRequirementName(name: string): string;
|
|
27
27
|
/**
|
|
28
|
-
* The
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
28
|
+
* The first of `names` that folds onto `name`, else undefined. One helper so
|
|
29
|
+
* every duplicate and collision check applies the same rule: in-section checks
|
|
30
|
+
* that compared exactly let `Foo` + `foo` through while the cross-section ones
|
|
31
|
+
* refused them.
|
|
32
32
|
*/
|
|
33
|
-
export declare
|
|
33
|
+
export declare function findFoldedMatch(names: Iterable<string>, name: string): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The name a `### Requirement:` header carries, as authored, or null when the
|
|
36
|
+
* line is not one. The one spelling of a requirement header, shared with the
|
|
37
|
+
* main-spec structure guard and the merge. `\s*` on purpose: `###Requirement:`
|
|
38
|
+
* is accepted here (see the no-space regressions in requirement-blocks.test.ts),
|
|
39
|
+
* so a guard using a stricter `\s+` let a duplicate slip past and the merge's
|
|
40
|
+
* Map collapsed it.
|
|
41
|
+
*
|
|
42
|
+
* The rest of the line is captured whole and cut at a line terminator in code.
|
|
43
|
+
* As `(.+)\s*$`, `\s` took U+2028/U+2029 where `.` stops, so a header holding
|
|
44
|
+
* one re-split its blank run every way: 80k blanks inside the name took 5 s,
|
|
45
|
+
* and blanks before it grew cubically. The cut keeps what `(.+)` captured, and
|
|
46
|
+
* anything but blanks after the terminator is still no match.
|
|
47
|
+
*/
|
|
48
|
+
export declare function matchRequirementHeader(line: string): string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Whether a line ends the main spec's `## Requirements` section: a `#` or `##`
|
|
51
|
+
* heading, by `headingLevel`, the rule MarkdownParser ends that section by.
|
|
52
|
+
* Shared with the main-spec structure guard, so the requirements it checks are
|
|
53
|
+
* the ones the merge reads. Not fence-aware; the caller skips fenced lines.
|
|
54
|
+
*/
|
|
55
|
+
export declare function endsRequirementsSection(line: string): boolean;
|
|
34
56
|
export declare function extractRequirementsSection(content: string): RequirementsSectionParts;
|
|
35
57
|
export interface RemovedEntry {
|
|
36
58
|
name: string;
|
|
@@ -43,12 +65,31 @@ export interface RemovedEntry {
|
|
|
43
65
|
export interface RemovedScenarioEntry {
|
|
44
66
|
/** Requirement the scenario is being removed from, normalized. */
|
|
45
67
|
requirement: string;
|
|
46
|
-
/** Scenario name, as authored — it is matched against spec headers verbatim. */
|
|
68
|
+
/** Scenario name, as authored but for a closing `#` run — it is matched against spec headers verbatim. */
|
|
47
69
|
scenario: string;
|
|
48
70
|
/** 1-based line number of the entry's first line in the source document. */
|
|
49
71
|
startLine: number;
|
|
50
72
|
hasReason: boolean;
|
|
51
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Guidance for a REMOVED Scenarios entry that names a requirement this change
|
|
76
|
+
* renames away. The merge applies RENAMED first and keys declarations by the
|
|
77
|
+
* MODIFIED block's header, so only the post-rename name matches. Telling the
|
|
78
|
+
* author to "check both names against the spec" sent them to the one file that
|
|
79
|
+
* shows the old name, which is the name that fails. Undefined when the entry
|
|
80
|
+
* does not name a RENAMED source, so callers keep their generic guidance.
|
|
81
|
+
* Shared so validate and archive word the same mistake the same way.
|
|
82
|
+
*/
|
|
83
|
+
export declare function postRenameRemovalHint(entry: RemovedScenarioEntry, renamed: ReadonlyArray<{
|
|
84
|
+
from: string;
|
|
85
|
+
to: string;
|
|
86
|
+
}>): string | undefined;
|
|
87
|
+
export interface RenamedEntry {
|
|
88
|
+
from: string;
|
|
89
|
+
to: string;
|
|
90
|
+
/** 1-based line number of the FROM: line, the one that names the requirement the main spec holds. */
|
|
91
|
+
fromLine: number;
|
|
92
|
+
}
|
|
52
93
|
export interface RenamedIssue {
|
|
53
94
|
kind: 'from-without-to' | 'to-without-from';
|
|
54
95
|
name: string;
|
|
@@ -62,6 +103,33 @@ export interface DuplicateSection {
|
|
|
62
103
|
/** 1-based line numbers of every occurrence, in document order. */
|
|
63
104
|
lines: number[];
|
|
64
105
|
}
|
|
106
|
+
/** A `### Requirement:` header no delta section owns, so nothing reads it. */
|
|
107
|
+
export interface OrphanRequirement {
|
|
108
|
+
name: string;
|
|
109
|
+
/** 1-based line number of the header. */
|
|
110
|
+
line: number;
|
|
111
|
+
/** Title of the `##` section it sits under; null before the first `##`. */
|
|
112
|
+
section: string | null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Text archive will not merge: a non-delta `##` section with content, or a `#`
|
|
116
|
+
* heading with text under it inside an ADDED or MODIFIED section.
|
|
117
|
+
*/
|
|
118
|
+
export interface UnmergedSection {
|
|
119
|
+
/** The header as authored, e.g. '## Notes' or '# Note'. */
|
|
120
|
+
title: string;
|
|
121
|
+
/** 1-based line number of the header. */
|
|
122
|
+
line: number;
|
|
123
|
+
}
|
|
124
|
+
/** A non-delta `##` section whose title is a near miss of a delta section title. */
|
|
125
|
+
export interface MisspelledSection {
|
|
126
|
+
/** The header as authored, e.g. '## REMOVED Requirement'. */
|
|
127
|
+
title: string;
|
|
128
|
+
/** 1-based line number of the header. */
|
|
129
|
+
line: number;
|
|
130
|
+
/** The delta section header it is closest to, e.g. '## REMOVED Requirements'. */
|
|
131
|
+
suggestion: string;
|
|
132
|
+
}
|
|
65
133
|
export interface DeltaPlan {
|
|
66
134
|
added: RequirementBlock[];
|
|
67
135
|
modified: RequirementBlock[];
|
|
@@ -85,6 +153,11 @@ export interface DeltaPlan {
|
|
|
85
153
|
from: string;
|
|
86
154
|
to: string;
|
|
87
155
|
}>;
|
|
156
|
+
/**
|
|
157
|
+
* The pairs of `renamed` with the FROM: line, kept apart as `removedEntries`
|
|
158
|
+
* is from `removed`: a finding about a FROM name has to point at that line.
|
|
159
|
+
*/
|
|
160
|
+
renamedEntries: RenamedEntry[];
|
|
88
161
|
/** Scenario removals the author declared rather than performed silently. */
|
|
89
162
|
removedScenarios: RemovedScenarioEntry[];
|
|
90
163
|
/** Orphaned FROM:/TO: lines that would otherwise be silently dropped. */
|
|
@@ -94,6 +167,25 @@ export interface DeltaPlan {
|
|
|
94
167
|
* the validator rejects them rather than guess which the author meant.
|
|
95
168
|
*/
|
|
96
169
|
duplicateSections: DuplicateSection[];
|
|
170
|
+
/**
|
|
171
|
+
* Requirements written before the first `##`, or under a section that is not
|
|
172
|
+
* a delta section (a typo such as `## Add Requirements`). Every reader goes
|
|
173
|
+
* by section, so these were neither validated nor merged, and nothing said so.
|
|
174
|
+
*/
|
|
175
|
+
orphanRequirements: OrphanRequirement[];
|
|
176
|
+
/**
|
|
177
|
+
* Non-delta sections other than `## Purpose` that hold text, and `#` headings
|
|
178
|
+
* with text under them inside ADDED or MODIFIED. Purpose has its own
|
|
179
|
+
* carry-or-notice path in the merge.
|
|
180
|
+
*/
|
|
181
|
+
unmergedSections: UnmergedSection[];
|
|
182
|
+
/**
|
|
183
|
+
* Unmerged sections whose title is a near miss of a delta section title,
|
|
184
|
+
* such as `## REMOVED Requirement`. A REMOVED bullet or a RENAMED FROM:/TO:
|
|
185
|
+
* pair is not a `### Requirement:` header, so the orphan scan never sees it,
|
|
186
|
+
* and the removal or rename silently does not happen.
|
|
187
|
+
*/
|
|
188
|
+
misspelledSections: MisspelledSection[];
|
|
97
189
|
sectionPresence: {
|
|
98
190
|
added: boolean;
|
|
99
191
|
modified: boolean;
|
|
@@ -103,6 +195,35 @@ export interface DeltaPlan {
|
|
|
103
195
|
};
|
|
104
196
|
}
|
|
105
197
|
export declare function parseDeltaSpec(content: string): DeltaPlan;
|
|
198
|
+
/** Whether a document has any (unfenced) delta section header. */
|
|
199
|
+
export declare function hasDeltaSection(content: string): boolean;
|
|
200
|
+
/**
|
|
201
|
+
* The title of a `## ` section header as authored, or null when the line is
|
|
202
|
+
* not one. `sectionHeaderKey` builds on it, so `extractDeltaPurpose` and migrate
|
|
203
|
+
* find the sections this parser finds.
|
|
204
|
+
*
|
|
205
|
+
* The rest of the line is captured whole and refused in code when it holds a
|
|
206
|
+
* line terminator. As `\s+(.+)$`, `\s` took U+2028/U+2029 where `.` stops, so a
|
|
207
|
+
* header holding one re-split its blank run every way: 80k blanks took 2.7 s.
|
|
208
|
+
* A title of blanks alone still matches on its last blank, as `(.+)` did, so
|
|
209
|
+
* `## ` stays a section.
|
|
210
|
+
*/
|
|
211
|
+
export declare function matchSectionHeader(line: string): string | null;
|
|
212
|
+
/**
|
|
213
|
+
* The key this parser files a `## ` header under (the same header match,
|
|
214
|
+
* closing `#` peel and case fold `splitTopLevelSections` applies), or null when
|
|
215
|
+
* the line is not one. Exported so a caller scanning lines on its own shares
|
|
216
|
+
* that reading rather than keeping a regex copy, which drifts: migrate's took
|
|
217
|
+
* only `## Purpose`, so a spec headed `## purpose` lost its Purpose to a stub.
|
|
218
|
+
* Not fence-aware; the caller skips fenced lines.
|
|
219
|
+
*/
|
|
220
|
+
export declare function sectionHeaderKey(line: string): string | null;
|
|
221
|
+
/**
|
|
222
|
+
* Whether a line is a header this parser reads as a delta section, keyed as
|
|
223
|
+
* `sectionHeaderKey` keys it. Migrate's own regex took only the upper-case,
|
|
224
|
+
* single-space spelling. Not fence-aware either.
|
|
225
|
+
*/
|
|
226
|
+
export declare function isDeltaSectionHeader(line: string): boolean;
|
|
106
227
|
/**
|
|
107
228
|
* Every `### Requirement:` block in a document, whichever section it sits in (or
|
|
108
229
|
* none). For a caller rebuilding a whole file rather than applying a delta: a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requirement-blocks.d.ts","sourceRoot":"","sources":["../../../src/core/parsers/requirement-blocks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"requirement-blocks.d.ts","sourceRoot":"","sources":["../../../src/core/parsers/requirement-blocks.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,GA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