@sumrco/cli 0.3.9 → 0.4.3
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/ARTIFACT-MANIFEST.json +18 -0
- package/README.md +12 -0
- package/THIRD_PARTY_NOTICES.md +1119 -0
- package/ai/modules/kontract/resources/api-generation-standards.rf.md +18 -5
- package/ai/modules/kontract/resources/authoring/configuration.rf.md +568 -12
- package/ai/modules/kontract/resources/authoring/schema-reuse.rf.md +25 -4
- package/ai/modules/kontract/resources/authoring/scope-and-splitting.rf.md +8 -6
- package/ai/modules/kontract/resources/authoring/spec-layout.rf.md +4 -0
- package/ai/modules/kontract/resources/generated-output.rf.md +712 -44
- package/ai/modules/kontract/resources/nestjs-eslint.rf.md +153 -0
- package/ai/modules/kontract/resources/openapi-sdk-generator-research.rf.md +177 -0
- package/ai/modules/kontract/resources/overview.md +70 -8
- package/ai/modules/kontract/resources/performance.rf.md +11 -2
- package/ai/modules/kontract/sumr.module.yaml +15 -14
- package/ai/modules/mission/resources/flow-config.rf.md +2 -2
- package/ai/modules/mission/resources/overview.md +42 -35
- package/ai/modules/mission/resources/stage-closeout.rf.md +5 -5
- package/ai/modules/mission/resources/stage-delivery.rf.md +5 -5
- package/ai/modules/mission/resources/stage-intake.rf.md +2 -2
- package/ai/modules/mission/resources/stage-planning.rf.md +43 -4
- package/ai/modules/mission/resources/stage-pull-request.rf.md +2 -2
- package/ai/modules/mission/resources/stage-quality.rf.md +8 -8
- package/ai/modules/mission/resources/team-members/planner.tm.md +17 -5
- package/ai/modules/mission/resources/workflows/daily-triage.cmd.md +5 -1
- package/ai/modules/mission/resources/workflows/mission-cycle.cmd.md +7 -5
- package/ai/modules/mission/resources/workflows/planning-only.cmd.md +8 -3
- package/ai/modules/mission/sumr.module.yaml +20 -16
- package/ai/modules/playbook/resources/authoring/extraction.rf.md +28 -1
- package/ai/modules/playbook/resources/authoring/frontmatter.rf.md +7 -0
- package/ai/modules/playbook/resources/authoring/overview.md +33 -2
- package/ai/modules/playbook/resources/authoring/patterns.rf.md +21 -0
- package/ai/modules/playbook/resources/team-members/technical-writer.tm.md +5 -1
- package/ai/modules/playbook/sumr.module.yaml +13 -12
- package/ai/registry.json +3 -3
- package/bin/sumr +18 -3
- package/eslint/index.mjs +2 -0
- package/eslint/kontract/index.mjs +22 -0
- package/eslint/kontract/rules/typescript-nestjs/operation-contract.mjs +656 -0
- package/index.js +3060 -462
- package/package.json +26 -23
- package/sbom.cdx.json +5111 -0
|
@@ -334,6 +334,10 @@ Set rules:
|
|
|
334
334
|
- Local keys override set keys.
|
|
335
335
|
- Multiple sets that define the same key must use identical values.
|
|
336
336
|
- Kontract rebases copied `$ref` values when a set comes from another file.
|
|
337
|
+
- Kontract follows the complete local `$ref` graph and expands `$sets` in every
|
|
338
|
+
reached document before validation, bundling, or generator-specific
|
|
339
|
+
operation extraction. Reference-only selection roots therefore retain sets
|
|
340
|
+
declared by canonical sibling path-item files.
|
|
337
341
|
- Normalized files passed to validators and generators do not contain
|
|
338
342
|
`kontract` or `$sets`.
|
|
339
343
|
|
|
@@ -401,10 +405,27 @@ semantic drift. It may still emit concrete generated DTO/model properties per
|
|
|
401
405
|
response until the generator grows preserved composition or shared-output
|
|
402
406
|
emission.
|
|
403
407
|
|
|
404
|
-
|
|
408
|
+
OpenAPI 3.0 authors may also use a single-part `allOf` wrapper to add
|
|
409
|
+
`nullable: true` or annotations to a scalar/enum `$ref`:
|
|
405
410
|
|
|
406
|
-
|
|
407
|
-
|
|
411
|
+
```yaml
|
|
412
|
+
scheduleType:
|
|
413
|
+
allOf:
|
|
414
|
+
- $ref: '#/components/schemas/ScheduleType'
|
|
415
|
+
nullable: true
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
Kontract keeps the referenced scalar/enum identity and applies the outer
|
|
419
|
+
nullability. Required and nullable remain independent: the example property is
|
|
420
|
+
required only when its owning object's `required` array includes
|
|
421
|
+
`scheduleType`. Prefer a plain `$ref` when no wrapper annotation is needed.
|
|
422
|
+
|
|
423
|
+
## Repeated nested objects
|
|
424
|
+
|
|
425
|
+
If several capabilities define the same nested value object — a time range, an
|
|
426
|
+
address, a money amount, a contact block — share one definition instead of
|
|
427
|
+
duplicating the shape per capability. The example below uses a time range; apply
|
|
428
|
+
the same rule to whatever value objects your own domain repeats.
|
|
408
429
|
|
|
409
430
|
```yaml
|
|
410
431
|
# schema/shared/scheduling.yml
|
|
@@ -449,7 +470,7 @@ the spec before running generation. Actively look for these smells:
|
|
|
449
470
|
- inline UUID, date, date-time, URL, slug, or enum-like scalar constraints that
|
|
450
471
|
already exist in a shared component;
|
|
451
472
|
- identical regex patterns copied into multiple schemas;
|
|
452
|
-
- repeated
|
|
473
|
+
- repeated nested value-object structures duplicated per capability;
|
|
453
474
|
- error response schemas or problem-details bodies copied instead of referencing
|
|
454
475
|
shared responses;
|
|
455
476
|
- event envelopes or async schema reply wrappers copied with the same product
|
|
@@ -63,7 +63,7 @@ Split or optimize before adding more content when a file shows any of these:
|
|
|
63
63
|
- multiple product capabilities or API surfaces in one spec;
|
|
64
64
|
- more than roughly 7-10 operations with different lifecycle owners;
|
|
65
65
|
- request/response schemas for unrelated use cases in one component block;
|
|
66
|
-
- repeated envelope, pagination, error, scalar,
|
|
66
|
+
- repeated envelope, pagination, error, scalar, nested value-object, or config shapes;
|
|
67
67
|
- repeated operation patterns that should become shared parameters/responses;
|
|
68
68
|
- a TypeScript file with orchestration, parsing, emitting, IO, and formatting
|
|
69
69
|
responsibilities mixed together;
|
|
@@ -221,11 +221,13 @@ Guidelines:
|
|
|
221
221
|
|
|
222
222
|
1. Name the current responsibilities in the file.
|
|
223
223
|
2. Extract pure helpers first, then emitters/readers, then orchestration.
|
|
224
|
-
3. Move
|
|
225
|
-
|
|
226
|
-
4. Move reusable
|
|
227
|
-
|
|
228
|
-
5.
|
|
224
|
+
3. Move reusable definition-only modules under `src/types/<owner>/` and name each file after its
|
|
225
|
+
domain concept, such as `contracts.ts`, never `*.types.ts`.
|
|
226
|
+
4. Move reusable runtime values under `src/constants/<owner>/` and use concept names such as
|
|
227
|
+
`limits.ts`, never `*.constants.ts`.
|
|
228
|
+
5. Replace generic `utils.ts` modules with the specific responsibility they own, such as
|
|
229
|
+
`schema.ts`, `format.ts`, or `paths.ts`.
|
|
230
|
+
6. Add or adjust focused tests around the extracted seam before broad rewrites.
|
|
229
231
|
|
|
230
232
|
Prefer small safe extractions over a big rewrite. The goal is a clearer module
|
|
231
233
|
boundary, not a larger abstraction layer.
|
|
@@ -70,6 +70,10 @@ schema/
|
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
Both files generate under `contracts/recipes/`.
|
|
73
|
+
- In a grouped capability folder, `main.api.yml` owns the generated service
|
|
74
|
+
`info`; title it after the capability, not one surface. Without a
|
|
75
|
+
`main.api.yml`, the first file alphabetically wins and generation warns when
|
|
76
|
+
the grouped files disagree on `info.title` or `info.description`.
|
|
73
77
|
- Use `folder/folder.api.yml` for a simple product capability root that
|
|
74
78
|
should generate under the folder namespace, for example
|
|
75
79
|
`schema/bookstore/bookstore.api.yml` generates under `contracts/bookstore/`.
|