@pukujan/create-modular-monolith 2.0.0 → 2.2.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 +94 -23
- package/index.js +47 -0
- package/package.json +16 -19
- package/template/.cursor/commands/planning-study-log.md +25 -0
- package/template/.cursor/commands/pre-push-dev-log.md +52 -0
- package/template/.cursor/rules/api-documentation.mdc +21 -0
- package/template/.cursor/rules/file-exchange-inbox.mdc +29 -0
- package/template/.github/workflows/ci.yml +44 -0
- package/template/AGENTS.md +41 -0
- package/template/README.md +25 -55
- package/template/backend/.env.example +38 -0
- package/template/backend/package-lock.json +1118 -24
- package/template/backend/package.json +14 -4
- package/template/backend/scripts/check-module-boundaries.mjs +3 -0
- package/template/backend/src/modules/model-condenser/README.md +7 -0
- package/template/backend/src/modules/model-condenser/config/index.js +20 -0
- package/template/backend/src/modules/model-condenser/events/index.js +1 -0
- package/template/backend/src/modules/model-condenser/index.js +12 -0
- package/template/backend/src/modules/model-condenser/routes/health.routes.js +10 -0
- package/template/backend/src/modules/model-condenser/routes/index.js +10 -0
- package/template/backend/src/modules/model-condenser/routes/modelCondenser.routes.js +44 -0
- package/template/backend/src/modules/model-condenser/services/health.service.js +8 -0
- package/template/backend/src/modules/model-condenser/services/modelCondenser.facade.js +58 -0
- package/template/backend/src/modules/model-condenser/services/modelCondenser.service.js +513 -0
- package/template/backend/src/modules/model-condenser/tests/integration/modelCondenser.routes.test.js +40 -0
- package/template/backend/src/modules/model-condenser/tests/unit/modelCondenser.service.test.js +31 -0
- package/template/backend/src/modules/model-condenser/utils/index.js +1 -0
- package/template/backend/src/shared/contracts/consolidatedExports.contract.js +19 -0
- package/template/backend/src/shared/contracts/prePushDevLog.contract.js +28 -0
- package/template/backend/src/shared/domain/case-filing/core-models.js +117 -0
- package/template/backend/src/shared/http/errors.js +8 -0
- package/template/backend/src/shared/utils/consolidatedExport.js +30 -0
- package/template/backend/src/shared/utils/formatExchangeTimestamp.js +47 -0
- package/template/backend/src/shared/utils/formatExchangeTimestamp.test.js +30 -0
- package/template/backend/src/shared/utils/traceId.js +19 -0
- package/template/docs/API.md +42 -0
- package/template/docs/PUBLISHING.md +13 -1
- package/template/docs/README.md +7 -1
- package/template/docs/STARTER_PACK.md +4 -0
- package/template/docs/architecture/API_DOCUMENTATION_CONTRACT.md +112 -0
- package/template/docs/architecture/CONTRACTS_OVERVIEW.md +180 -0
- package/template/docs/architecture/EVAL_AND_CI.md +79 -0
- package/template/docs/architecture/MODULE_INTERNAL_CONTRACT.md +2 -0
- package/template/docs/architecture/PLATFORM_ARCHITECTURE.md +221 -0
- package/template/docs/architecture/REPO_ARTIFACT_LAYOUT.md +33 -0
- package/template/docs/architecture/contracts/apiDocumentationRegistry.contract.md +40 -0
- package/template/docs/architecture/contracts/changelog.jsonl +12 -0
- package/template/docs/architecture/contracts/consolidatedExports.contract.md +58 -0
- package/template/docs/architecture/contracts/fileExchange.contract.md +47 -0
- package/template/docs/architecture/contracts/manifest.json +39 -0
- package/template/docs/architecture/contracts/prePushDevLog.contract.md +69 -0
- package/template/docs/model-condenser/API.md +102 -0
- package/template/file-exchange/README.md +41 -0
- package/template/file-exchange/exports/.gitkeep +0 -0
- package/template/file-exchange/exports/consolidated-models.json +625 -0
- package/template/file-exchange/imports/.gitkeep +0 -0
- package/template/frontend/.env.example +2 -0
- package/template/frontend/package-lock.json +125 -122
- package/template/frontend/package.json +1 -1
- package/template/frontend/src/index.css +311 -0
- package/template/frontend/src/modules/_reference/services/health-api.js +1 -1
- package/template/frontend/src/shared/api/client.js +67 -5
- package/template/models/.gitkeep +0 -0
- package/template/package.json +13 -4
- package/template/scripts/check-api-docs.mjs +183 -0
- package/template/scripts/condense-file-structure.mjs +44 -0
- package/template/scripts/condense-models.mjs +70 -0
- package/template/scripts/condense-prompts.mjs +161 -0
- package/template/scripts/consolidated-output.mjs +49 -0
- package/template/scripts/export-consolidated-models.mjs +11 -0
- package/template/scripts/git-hooks/pre-push.sample +15 -0
- package/template/scripts/import-to-file-exchange.mjs +43 -0
- package/template/scripts/lib/api-inventory.mjs +182 -0
- package/template/scripts/lib/dev-log-human-format.mjs +360 -0
- package/template/scripts/lib/git-snapshot.mjs +46 -0
- package/template/scripts/lib/module-scaffold.mjs +37 -1
- package/template/scripts/lib/repo-tree.mjs +127 -0
- package/template/scripts/lib/run-tests.mjs +60 -0
- package/template/scripts/lint-contracts.mjs +57 -0
- package/template/scripts/lint-repo-artifacts.mjs +37 -0
- package/template/scripts/new-module.mjs +7 -0
- package/template/scripts/resolve-import-stamp.mjs +50 -0
- package/template/scripts/verify-dev-log.mjs +50 -0
- package/template/scripts/write-pre-push-dev-log.mjs +220 -0
- package/template/work-log/INDEX.md +3 -0
- package/template/work-log/README.md +40 -0
- package/template/work-log/dev-logs/README.md +97 -0
- package/template/work-log/dev-logs/schemas/dev-log-agent.v1.schema.json +119 -0
- package/template/work-log/dev-logs/templates/dev-log-human.template.md +10 -0
- package/template/work-log/handoffs/README.md +36 -0
- package/template/work-log/study-docs/README.md +13 -0
- package/bin/create-modular-monolith.js +0 -132
- package/template/backend/src/modules/_reference/evals/README.md +0 -6
- package/template/backend/src/modules/_reference/evals/datasets/example.cases.json +0 -12
- package/template/backend/src/modules/_reference/evals/runners/example.eval.mjs +0 -25
- package/template/scripts/sync-cli-template.mjs +0 -44
- /package/template/{frontend/src/modules → backend/db/migrations}/.gitkeep +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Model condenser — HTTP API
|
|
2
|
+
|
|
3
|
+
**Base path:** `/api/model-condenser`
|
|
4
|
+
|
|
5
|
+
Scans the repo and writes a **schema inventory** (`models/consolidated-models.json`). This is unrelated to case eval reports or `eval-bundles/`.
|
|
6
|
+
|
|
7
|
+
**Routes:** [`backend/src/modules/model-condenser/routes/modelCondenser.routes.js`](../../backend/src/modules/model-condenser/routes/modelCondenser.routes.js)
|
|
8
|
+
|
|
9
|
+
**Contract:** [API documentation contract](../architecture/API_DOCUMENTATION_CONTRACT.md)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Endpoint quick reference
|
|
14
|
+
|
|
15
|
+
| Method | Path | Description |
|
|
16
|
+
|--------|------|-------------|
|
|
17
|
+
| GET | `/health` | Module health |
|
|
18
|
+
| POST | `/condense` | Regenerate consolidated-models.json |
|
|
19
|
+
| GET | `/consolidated` | Read consolidated schema inventory |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Health
|
|
24
|
+
|
|
25
|
+
| Method | Path | Description |
|
|
26
|
+
|--------|------|-------------|
|
|
27
|
+
| GET | `/health` | Module health |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Condense
|
|
32
|
+
|
|
33
|
+
### `POST /condense`
|
|
34
|
+
|
|
35
|
+
Regenerate `models/consolidated-models.json` from repo sources.
|
|
36
|
+
|
|
37
|
+
**Body (JSON, optional):**
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{ "includePayload": false }
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
| Field | Default | Description |
|
|
44
|
+
|-------|---------|-------------|
|
|
45
|
+
| `includePayload` | `false` | If `true`, include full consolidated document in response |
|
|
46
|
+
|
|
47
|
+
**Response 201:**
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"status": "written",
|
|
52
|
+
"outputPath": "/abs/path/models/consolidated-models.json",
|
|
53
|
+
"outputRelativePath": "models/consolidated-models.json",
|
|
54
|
+
"modelCount": 42,
|
|
55
|
+
"exampleInstanceCount": 10,
|
|
56
|
+
"generatedAt": "2026-05-23T..."
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**CLI equivalent:** `npm run condense-models` (from `backend/`)
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Read consolidated file
|
|
65
|
+
|
|
66
|
+
### `GET /consolidated`
|
|
67
|
+
|
|
68
|
+
**Query:**
|
|
69
|
+
|
|
70
|
+
| Param | Description |
|
|
71
|
+
|-------|-------------|
|
|
72
|
+
| `includePayload=true` | Return full `consolidated` object in addition to summary |
|
|
73
|
+
|
|
74
|
+
**Response 200 (summary):**
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"status": "ready | missing",
|
|
79
|
+
"exists": true,
|
|
80
|
+
"outputPath": "...",
|
|
81
|
+
"outputRelativePath": "models/consolidated-models.json",
|
|
82
|
+
"generatedAt": "...",
|
|
83
|
+
"modelCount": 42
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**404** if file missing — run `POST /condense` first.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Environment variables
|
|
92
|
+
|
|
93
|
+
| Variable | Default | Purpose |
|
|
94
|
+
|----------|---------|---------|
|
|
95
|
+
| `MODEL_CONDENSER_OUTPUT_DIR` | `{repo}/models` | Output directory |
|
|
96
|
+
| `MODEL_CONDENSER_OUTPUT_FILE` | `consolidated-models.json` | Output filename |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Tests
|
|
101
|
+
|
|
102
|
+
`backend/src/modules/model-condenser/tests/integration/modelCondenser.routes.test.js`
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# File exchange
|
|
2
|
+
|
|
3
|
+
Dated folders for human ↔ agent file handoff. **No sensitive filing text in git** — use synthetic fixtures only.
|
|
4
|
+
|
|
5
|
+
## Layout
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
file-exchange/
|
|
9
|
+
imports/{2026-05-23_15-59-43Z}/ ← inbound bundles
|
|
10
|
+
exports/{2026-05-23_15-59-43Z_...}/ ← session deliverables (batch runs, curl logs)
|
|
11
|
+
exports/consolidated-models.json ← repo snapshots (regenerate with condense:all)
|
|
12
|
+
exports/consolidated-prompts.json
|
|
13
|
+
exports/consolidated-file-structure.json
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Stamp format:** `YYYY-MM-DD_HH-MM-SSZ` via `formatExchangeTimestamp()` in `backend/src/shared/utils/formatExchangeTimestamp.js`.
|
|
17
|
+
|
|
18
|
+
## Consolidated exports (in `exports/`)
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm run condense:all
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
| File in `exports/` | Mirror (API) |
|
|
25
|
+
|--------------------|--------------|
|
|
26
|
+
| `consolidated-models.json` | `models/consolidated-models.json` |
|
|
27
|
+
| `consolidated-prompts.json` | `models/consolidated-prompts.json` |
|
|
28
|
+
| `consolidated-file-structure.json` | `models/consolidated-file-structure.json` |
|
|
29
|
+
|
|
30
|
+
**Open `file-exchange/exports/`** — all three consolidated files sit next to dated batch export folders.
|
|
31
|
+
|
|
32
|
+
## Workflow
|
|
33
|
+
|
|
34
|
+
1. Triage loose files into `imports/{stamp}/` (`npm run import:file-exchange -- <path>`).
|
|
35
|
+
2. Process via your domain module APIs using files **under that stamp** only.
|
|
36
|
+
3. Copy batch bundles / reports to `exports/{stamp}/` when done.
|
|
37
|
+
4. Refresh consolidated snapshots: `npm run condense:all`.
|
|
38
|
+
|
|
39
|
+
**Cursor agents:** mandatory — see [AGENTS.md](../AGENTS.md) and `.cursor/rules/file-exchange-inbox.mdc`.
|
|
40
|
+
|
|
41
|
+
See [docs/architecture/REPO_ARTIFACT_LAYOUT.md](../docs/architecture/REPO_ARTIFACT_LAYOUT.md).
|
|
File without changes
|