llm-mock-server 1.0.6 → 1.0.7
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/cli/cli.d.ts +3 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +103 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/validators.d.ts +7 -0
- package/dist/cli/validators.d.ts.map +1 -0
- package/dist/cli/validators.js +53 -0
- package/dist/cli/validators.js.map +1 -0
- package/dist/formats/anthropic/index.d.ts +1 -1
- package/dist/formats/anthropic/index.d.ts.map +1 -1
- package/dist/formats/anthropic/index.js +1 -1
- package/dist/formats/anthropic/index.js.map +1 -1
- package/dist/formats/anthropic/parse.d.ts +2 -2
- package/dist/formats/anthropic/parse.d.ts.map +1 -1
- package/dist/formats/anthropic/parse.js +4 -2
- package/dist/formats/anthropic/parse.js.map +1 -1
- package/dist/formats/anthropic/schema.d.ts +1 -1
- package/dist/formats/anthropic/schema.d.ts.map +1 -1
- package/dist/formats/anthropic/schema.js +9 -4
- package/dist/formats/anthropic/schema.js.map +1 -1
- package/dist/formats/anthropic/serialize.d.ts +2 -2
- package/dist/formats/anthropic/serialize.d.ts.map +1 -1
- package/dist/formats/anthropic/serialize.js +76 -19
- package/dist/formats/anthropic/serialize.js.map +1 -1
- package/dist/formats/openai/chat-completions/index.d.ts +3 -0
- package/dist/formats/openai/chat-completions/index.d.ts.map +1 -0
- package/dist/formats/openai/chat-completions/index.js +13 -0
- package/dist/formats/openai/chat-completions/index.js.map +1 -0
- package/dist/formats/openai/chat-completions/parse.d.ts +4 -0
- package/dist/formats/openai/chat-completions/parse.d.ts.map +1 -0
- package/dist/formats/openai/chat-completions/parse.js +33 -0
- package/dist/formats/openai/chat-completions/parse.js.map +1 -0
- package/dist/formats/openai/chat-completions/schema.d.ts +93 -0
- package/dist/formats/openai/chat-completions/schema.d.ts.map +1 -0
- package/dist/formats/openai/chat-completions/schema.js +74 -0
- package/dist/formats/openai/chat-completions/schema.js.map +1 -0
- package/dist/formats/openai/chat-completions/serialize.d.ts +10 -0
- package/dist/formats/openai/chat-completions/serialize.d.ts.map +1 -0
- package/dist/formats/openai/chat-completions/serialize.js +99 -0
- package/dist/formats/openai/chat-completions/serialize.js.map +1 -0
- package/dist/formats/openai/responses/index.d.ts +3 -0
- package/dist/formats/openai/responses/index.d.ts.map +1 -0
- package/dist/formats/openai/responses/index.js +13 -0
- package/dist/formats/openai/responses/index.js.map +1 -0
- package/dist/formats/openai/responses/parse.d.ts +4 -0
- package/dist/formats/openai/responses/parse.d.ts.map +1 -0
- package/dist/formats/openai/responses/parse.js +51 -0
- package/dist/formats/openai/responses/parse.js.map +1 -0
- package/dist/formats/openai/responses/schema.d.ts +103 -0
- package/dist/formats/openai/responses/schema.d.ts.map +1 -0
- package/dist/formats/openai/responses/schema.js +71 -0
- package/dist/formats/openai/responses/schema.js.map +1 -0
- package/dist/formats/openai/responses/serialize.d.ts +10 -0
- package/dist/formats/openai/responses/serialize.d.ts.map +1 -0
- package/dist/formats/openai/responses/serialize.js +273 -0
- package/dist/formats/openai/responses/serialize.js.map +1 -0
- package/dist/formats/request-helpers.d.ts +1 -1
- package/dist/formats/request-helpers.d.ts.map +1 -1
- package/dist/formats/request-helpers.js.map +1 -1
- package/dist/formats/serialize-helpers.d.ts +1 -1
- package/dist/formats/serialize-helpers.d.ts.map +1 -1
- package/dist/formats/serialize-helpers.js +6 -3
- package/dist/formats/serialize-helpers.js.map +1 -1
- package/dist/formats/types.d.ts +2 -1
- package/dist/formats/types.d.ts.map +1 -1
- package/dist/history.d.ts +6 -2
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +2 -0
- package/dist/history.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +26 -9
- package/dist/loader.js.map +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +12 -4
- package/dist/logger.js.map +1 -1
- package/dist/mock-server.d.ts +44 -48
- package/dist/mock-server.d.ts.map +1 -1
- package/dist/mock-server.js +37 -85
- package/dist/mock-server.js.map +1 -1
- package/dist/route-handler.d.ts +1 -1
- package/dist/route-handler.d.ts.map +1 -1
- package/dist/route-handler.js +19 -7
- package/dist/route-handler.js.map +1 -1
- package/dist/rule-builder.d.ts +21 -0
- package/dist/rule-builder.d.ts.map +1 -0
- package/dist/rule-builder.js +58 -0
- package/dist/rule-builder.js.map +1 -0
- package/dist/rule-engine.d.ts +3 -1
- package/dist/rule-engine.d.ts.map +1 -1
- package/dist/rule-engine.js +7 -2
- package/dist/rule-engine.js.map +1 -1
- package/dist/sse-writer.d.ts +1 -1
- package/dist/sse-writer.d.ts.map +1 -1
- package/dist/types/reply.d.ts +51 -8
- package/dist/types/reply.d.ts.map +1 -1
- package/dist/types/request.d.ts +21 -6
- package/dist/types/request.d.ts.map +1 -1
- package/dist/types/rule.d.ts +65 -7
- package/dist/types/rule.d.ts.map +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -9
- package/.claude/skills/desloppify/SKILL.md +0 -308
- package/.desloppify/external_review_sessions/ext_20260315_000339_a6cdc3e6/canonical_import_20260315_000801.json +0 -242
- package/.desloppify/external_review_sessions/ext_20260315_000339_a6cdc3e6/canonical_import_20260315_000905.json +0 -248
- package/.desloppify/external_review_sessions/ext_20260315_000339_a6cdc3e6/canonical_import_20260315_000917.json +0 -248
- package/.desloppify/external_review_sessions/ext_20260315_000339_a6cdc3e6/canonical_import_20260315_000950.json +0 -311
- package/.desloppify/external_review_sessions/ext_20260315_000339_a6cdc3e6/claude_launch_prompt.md +0 -17
- package/.desloppify/external_review_sessions/ext_20260315_000339_a6cdc3e6/review_result.json +0 -255
- package/.desloppify/external_review_sessions/ext_20260315_000339_a6cdc3e6/review_result.template.json +0 -22
- package/.desloppify/external_review_sessions/ext_20260315_000339_a6cdc3e6/reviewer_instructions.md +0 -20
- package/.desloppify/external_review_sessions/ext_20260315_000339_a6cdc3e6/session.json +0 -20
- package/.desloppify/external_review_sessions/ext_20260315_045546_0587ea3b/canonical_import_20260315_050000.json +0 -286
- package/.desloppify/external_review_sessions/ext_20260315_045546_0587ea3b/canonical_import_20260315_050028.json +0 -303
- package/.desloppify/external_review_sessions/ext_20260315_045546_0587ea3b/claude_launch_prompt.md +0 -17
- package/.desloppify/external_review_sessions/ext_20260315_045546_0587ea3b/review_result.json +0 -297
- package/.desloppify/external_review_sessions/ext_20260315_045546_0587ea3b/review_result.template.json +0 -22
- package/.desloppify/external_review_sessions/ext_20260315_045546_0587ea3b/reviewer_instructions.md +0 -20
- package/.desloppify/external_review_sessions/ext_20260315_045546_0587ea3b/session.json +0 -20
- package/.desloppify/query.json +0 -1312
- package/.desloppify/review_packet_blind.json +0 -1249
- package/.desloppify/review_packets/holistic_packet_20260315_000339.json +0 -1471
- package/.desloppify/review_packets/holistic_packet_20260315_045546.json +0 -1480
- package/.desloppify/review_packets/holistic_packet_20260315_185401.json +0 -1407
- package/.desloppify/review_packets/holistic_packet_20260315_185613.json +0 -1407
- package/.desloppify/state-typescript.json +0 -8438
- package/.desloppify/state-typescript.json.bak +0 -8432
- package/.desloppify/subagents/runs/20260315_185401/logs/batch-1.log +0 -384
- package/.desloppify/subagents/runs/20260315_185401/logs/batch-10.log +0 -484
- package/.desloppify/subagents/runs/20260315_185401/logs/batch-2.log +0 -408
- package/.desloppify/subagents/runs/20260315_185401/logs/batch-3.log +0 -416
- package/.desloppify/subagents/runs/20260315_185401/logs/batch-4.log +0 -360
- package/.desloppify/subagents/runs/20260315_185401/logs/batch-5.log +0 -360
- package/.desloppify/subagents/runs/20260315_185401/logs/batch-6.log +0 -364
- package/.desloppify/subagents/runs/20260315_185401/logs/batch-7.log +0 -428
- package/.desloppify/subagents/runs/20260315_185401/logs/batch-8.log +0 -388
- package/.desloppify/subagents/runs/20260315_185401/logs/batch-9.log +0 -500
- package/.desloppify/subagents/runs/20260315_185401/prompts/batch-1.md +0 -83
- package/.desloppify/subagents/runs/20260315_185401/prompts/batch-10.md +0 -108
- package/.desloppify/subagents/runs/20260315_185401/prompts/batch-2.md +0 -89
- package/.desloppify/subagents/runs/20260315_185401/prompts/batch-3.md +0 -91
- package/.desloppify/subagents/runs/20260315_185401/prompts/batch-4.md +0 -77
- package/.desloppify/subagents/runs/20260315_185401/prompts/batch-5.md +0 -77
- package/.desloppify/subagents/runs/20260315_185401/prompts/batch-6.md +0 -78
- package/.desloppify/subagents/runs/20260315_185401/prompts/batch-7.md +0 -94
- package/.desloppify/subagents/runs/20260315_185401/prompts/batch-8.md +0 -84
- package/.desloppify/subagents/runs/20260315_185401/prompts/batch-9.md +0 -112
- package/.desloppify/subagents/runs/20260315_185401/results/batch-1.raw.txt +0 -0
- package/.desloppify/subagents/runs/20260315_185401/results/batch-10.raw.txt +0 -0
- package/.desloppify/subagents/runs/20260315_185401/results/batch-2.raw.txt +0 -0
- package/.desloppify/subagents/runs/20260315_185401/results/batch-3.raw.txt +0 -0
- package/.desloppify/subagents/runs/20260315_185401/results/batch-4.raw.txt +0 -0
- package/.desloppify/subagents/runs/20260315_185401/results/batch-5.raw.txt +0 -0
- package/.desloppify/subagents/runs/20260315_185401/results/batch-6.raw.txt +0 -0
- package/.desloppify/subagents/runs/20260315_185401/results/batch-7.raw.txt +0 -0
- package/.desloppify/subagents/runs/20260315_185401/results/batch-8.raw.txt +0 -0
- package/.desloppify/subagents/runs/20260315_185401/results/batch-9.raw.txt +0 -0
- package/.desloppify/subagents/runs/20260315_185401/run.log +0 -36
- package/.desloppify/subagents/runs/20260315_185401/run_summary.json +0 -156
- package/.desloppify/subagents/runs/20260315_185613/holistic_findings_merged.json +0 -741
- package/.desloppify/subagents/runs/20260315_185613/logs/batch-1.log +0 -579
- package/.desloppify/subagents/runs/20260315_185613/logs/batch-10.log +0 -1537
- package/.desloppify/subagents/runs/20260315_185613/logs/batch-2.log +0 -829
- package/.desloppify/subagents/runs/20260315_185613/logs/batch-3.log +0 -927
- package/.desloppify/subagents/runs/20260315_185613/logs/batch-4.log +0 -429
- package/.desloppify/subagents/runs/20260315_185613/logs/batch-5.log +0 -276
- package/.desloppify/subagents/runs/20260315_185613/logs/batch-6.log +0 -450
- package/.desloppify/subagents/runs/20260315_185613/logs/batch-7.log +0 -730
- package/.desloppify/subagents/runs/20260315_185613/logs/batch-8.log +0 -698
- package/.desloppify/subagents/runs/20260315_185613/logs/batch-9.log +0 -938
- package/.desloppify/subagents/runs/20260315_185613/prompts/batch-1.md +0 -83
- package/.desloppify/subagents/runs/20260315_185613/prompts/batch-10.md +0 -108
- package/.desloppify/subagents/runs/20260315_185613/prompts/batch-2.md +0 -89
- package/.desloppify/subagents/runs/20260315_185613/prompts/batch-3.md +0 -91
- package/.desloppify/subagents/runs/20260315_185613/prompts/batch-4.md +0 -77
- package/.desloppify/subagents/runs/20260315_185613/prompts/batch-5.md +0 -77
- package/.desloppify/subagents/runs/20260315_185613/prompts/batch-6.md +0 -78
- package/.desloppify/subagents/runs/20260315_185613/prompts/batch-7.md +0 -94
- package/.desloppify/subagents/runs/20260315_185613/prompts/batch-8.md +0 -84
- package/.desloppify/subagents/runs/20260315_185613/prompts/batch-9.md +0 -112
- package/.desloppify/subagents/runs/20260315_185613/results/batch-1.raw.txt +0 -78
- package/.desloppify/subagents/runs/20260315_185613/results/batch-10.raw.txt +0 -242
- package/.desloppify/subagents/runs/20260315_185613/results/batch-2.raw.txt +0 -102
- package/.desloppify/subagents/runs/20260315_185613/results/batch-3.raw.txt +0 -94
- package/.desloppify/subagents/runs/20260315_185613/results/batch-4.raw.txt +0 -86
- package/.desloppify/subagents/runs/20260315_185613/results/batch-5.raw.txt +0 -1
- package/.desloppify/subagents/runs/20260315_185613/results/batch-6.raw.txt +0 -87
- package/.desloppify/subagents/runs/20260315_185613/results/batch-7.raw.txt +0 -1
- package/.desloppify/subagents/runs/20260315_185613/results/batch-8.raw.txt +0 -107
- package/.desloppify/subagents/runs/20260315_185613/results/batch-9.raw.txt +0 -67
- package/.desloppify/subagents/runs/20260315_185613/run.log +0 -96
- package/.desloppify/subagents/runs/20260315_185613/run_summary.json +0 -156
- package/.editorconfig +0 -12
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/docs.yml +0 -46
- package/.github/workflows/test.yml +0 -40
- package/.markdownlint.jsonc +0 -11
- package/.node-version +0 -1
- package/.oxfmtrc.json +0 -9
- package/.oxlintrc.json +0 -35
- package/docs/ARCHITECTURE.md +0 -125
- package/scorecard.png +0 -0
- package/src/cli/cli.ts +0 -141
- package/src/cli/validators.ts +0 -68
- package/src/formats/anthropic/index.ts +0 -14
- package/src/formats/anthropic/parse.ts +0 -70
- package/src/formats/anthropic/schema.ts +0 -74
- package/src/formats/anthropic/serialize.ts +0 -179
- package/src/formats/openai/chat-completions/index.ts +0 -14
- package/src/formats/openai/chat-completions/parse.ts +0 -47
- package/src/formats/openai/chat-completions/schema.ts +0 -92
- package/src/formats/openai/chat-completions/serialize.ts +0 -146
- package/src/formats/openai/responses/index.ts +0 -14
- package/src/formats/openai/responses/parse.ts +0 -73
- package/src/formats/openai/responses/schema.ts +0 -86
- package/src/formats/openai/responses/serialize.ts +0 -328
- package/src/formats/request-helpers.ts +0 -56
- package/src/formats/serialize-helpers.ts +0 -43
- package/src/formats/types.ts +0 -26
- package/src/history.ts +0 -70
- package/src/index.ts +0 -46
- package/src/loader.ts +0 -246
- package/src/logger.ts +0 -70
- package/src/mock-server.ts +0 -203
- package/src/route-handler.ts +0 -144
- package/src/rule-builder.ts +0 -73
- package/src/rule-engine.ts +0 -165
- package/src/sse-writer.ts +0 -35
- package/src/types/reply.ts +0 -92
- package/src/types/request.ts +0 -56
- package/src/types/rule.ts +0 -125
- package/src/types.ts +0 -24
- package/test/cli-validators.test.ts +0 -151
- package/test/formats/anthropic.test.ts +0 -336
- package/test/formats/openai.test.ts +0 -316
- package/test/formats/parse-helpers.test.ts +0 -315
- package/test/formats/responses.test.ts +0 -380
- package/test/helpers/make-req.ts +0 -18
- package/test/history.test.ts +0 -361
- package/test/loader.test.ts +0 -333
- package/test/logger.test.ts +0 -344
- package/test/mock-server.test.ts +0 -619
- package/test/rule-engine.test.ts +0 -229
- package/tsconfig.json +0 -24
- package/tsconfig.test.json +0 -11
- package/typedoc.json +0 -9
- package/vitest.config.ts +0 -18
|
@@ -1,698 +0,0 @@
|
|
|
1
|
-
ATTEMPT 1/3
|
|
2
|
-
$ codex exec --ephemeral -C /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server -s workspace-write -c approval_policy="never" -c model_reasoning_effort="low" -o /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server/.desloppify/subagents/runs/20260315_185613/results/batch-8.raw.txt You are a focused subagent reviewer for a single holistic investigation batch.
|
|
3
|
-
|
|
4
|
-
Repository root: /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server
|
|
5
|
-
Blind packet: /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server/.desloppify/review_packet_blind.json
|
|
6
|
-
Batch index: 8
|
|
7
|
-
Batch name: Governance & Contracts
|
|
8
|
-
Batch dimensions: cross_module_architecture, high_level_elegance, package_organization
|
|
9
|
-
Batch rationale: architecture contracts, compatibility policy, docs-vs-runtime scope, and quality-gate coverage
|
|
10
|
-
|
|
11
|
-
Files assigned:
|
|
12
|
-
- README.md
|
|
13
|
-
- src/types.ts
|
|
14
|
-
- src/formats/types.ts
|
|
15
|
-
- src/formats/request-helpers.ts
|
|
16
|
-
- src/logger.ts
|
|
17
|
-
- src/rule-engine.ts
|
|
18
|
-
|
|
19
|
-
Task requirements:
|
|
20
|
-
1. Read the blind packet and follow `system_prompt` constraints exactly.
|
|
21
|
-
1a. If previously flagged issues are listed above, use them as context for your review.
|
|
22
|
-
Verify whether each still applies to the current code. Do not re-report fixed or
|
|
23
|
-
wontfix issues. Use them as starting points to look deeper — inspect adjacent code
|
|
24
|
-
and related modules for defects the prior review may have missed.
|
|
25
|
-
1c. Think structurally: when you spot multiple individual issues that share a common
|
|
26
|
-
root cause (missing abstraction, duplicated pattern, inconsistent convention),
|
|
27
|
-
explain the deeper structural issue in the finding, not just the surface symptom.
|
|
28
|
-
If the pattern is significant enough, report the structural issue as its own finding
|
|
29
|
-
with appropriate fix_scope ('multi_file_refactor' or 'architectural_change') and
|
|
30
|
-
use `root_cause_cluster` to connect related symptom findings together.
|
|
31
|
-
2. Evaluate ONLY listed files and ONLY listed dimensions for this batch.
|
|
32
|
-
3. Return 0-10 high-quality findings for this batch (empty array allowed).
|
|
33
|
-
3a. Do not suppress real defects to keep scores high; report every material issue you can support with evidence.
|
|
34
|
-
3b. Do not default to 100. Reserve 100 for genuinely exemplary evidence in this batch.
|
|
35
|
-
4. Score/finding consistency is required: broader or more severe findings MUST lower dimension scores.
|
|
36
|
-
4a. Any dimension scored below 85.0 MUST include explicit feedback: add at least one finding with the same `dimension` and a non-empty actionable `suggestion`.
|
|
37
|
-
5. Every finding must include `related_files` with at least 2 files when possible.
|
|
38
|
-
6. Every finding must include `dimension`, `identifier`, `summary`, `evidence`, `suggestion`, and `confidence`.
|
|
39
|
-
7. Every finding must include `impact_scope` and `fix_scope`.
|
|
40
|
-
8. Every scored dimension MUST include dimension_notes with concrete evidence.
|
|
41
|
-
9. If a dimension score is >85.0, include `issues_preventing_higher_score` in dimension_notes.
|
|
42
|
-
10. Use exactly one decimal place for every assessment and abstraction sub-axis score.
|
|
43
|
-
9a. For package_organization, ground scoring in objective structure signals from `holistic_context.structure` (root_files fan_in/fan_out roles, directory_profiles, coupling_matrix). Prefer thresholded evidence (for example: fan_in < 5 for root stragglers, import-affinity > 60%, directories > 10 files with mixed concerns).
|
|
44
|
-
9b. Suggestions must include a staged reorg plan (target folders, move order, and import-update/validation commands).
|
|
45
|
-
11. Ignore prior chat context and any target-threshold assumptions.
|
|
46
|
-
12. Do not edit repository files.
|
|
47
|
-
13. Return ONLY valid JSON, no markdown fences.
|
|
48
|
-
|
|
49
|
-
Scope enums:
|
|
50
|
-
- impact_scope: "local" | "module" | "subsystem" | "codebase"
|
|
51
|
-
- fix_scope: "single_edit" | "multi_file_refactor" | "architectural_change"
|
|
52
|
-
|
|
53
|
-
Output schema:
|
|
54
|
-
{
|
|
55
|
-
"batch": "Governance & Contracts",
|
|
56
|
-
"batch_index": 8,
|
|
57
|
-
"assessments": {"<dimension>": <0-100 with one decimal place>},
|
|
58
|
-
"dimension_notes": {
|
|
59
|
-
"<dimension>": {
|
|
60
|
-
"evidence": ["specific code observations"],
|
|
61
|
-
"impact_scope": "local|module|subsystem|codebase",
|
|
62
|
-
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
|
63
|
-
"confidence": "high|medium|low",
|
|
64
|
-
"issues_preventing_higher_score": "required when score >85.0",
|
|
65
|
-
"sub_axes": {"abstraction_leverage": 0-100 with one decimal place, "indirection_cost": 0-100 with one decimal place, "interface_honesty": 0-100 with one decimal place} // required for abstraction_fitness when evidence supports it
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
"findings": [{
|
|
69
|
-
"dimension": "<dimension>",
|
|
70
|
-
"identifier": "short_id",
|
|
71
|
-
"summary": "one-line defect summary",
|
|
72
|
-
"related_files": ["relative/path.py"],
|
|
73
|
-
"evidence": ["specific code observation"],
|
|
74
|
-
"suggestion": "concrete fix recommendation",
|
|
75
|
-
"confidence": "high|medium|low",
|
|
76
|
-
"impact_scope": "local|module|subsystem|codebase",
|
|
77
|
-
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
|
78
|
-
"root_cause_cluster": "optional_cluster_name_when_supported_by_history"
|
|
79
|
-
}],
|
|
80
|
-
"retrospective": {
|
|
81
|
-
"root_causes": ["optional: concise root-cause hypotheses"],
|
|
82
|
-
"likely_symptoms": ["optional: identifiers that look symptom-level"],
|
|
83
|
-
"possible_false_positives": ["optional: prior concept keys likely mis-scoped"]
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
STDOUT:
|
|
89
|
-
{
|
|
90
|
-
"batch": "Governance & Contracts",
|
|
91
|
-
"batch_index": 8,
|
|
92
|
-
"assessments": {
|
|
93
|
-
"cross_module_architecture": 88.0,
|
|
94
|
-
"high_level_elegance": 87.0,
|
|
95
|
-
"package_organization": 82.0
|
|
96
|
-
},
|
|
97
|
-
"dimension_notes": {
|
|
98
|
-
"cross_module_architecture": {
|
|
99
|
-
"evidence": [
|
|
100
|
-
"src/types.ts is a root barrel that re-exports three distinct type domains (request/reply/rule) and is a top imported module in the codebase (fan_in 19 per holistic_context.god_modules).",
|
|
101
|
-
"src/formats/types.ts and src/formats/request-helpers.ts both import from ../types.js, pulling format-specific code through the root barrel."
|
|
102
|
-
],
|
|
103
|
-
"impact_scope": "subsystem",
|
|
104
|
-
"fix_scope": "multi_file_refactor",
|
|
105
|
-
"confidence": "medium",
|
|
106
|
-
"issues_preventing_higher_score": "The root-level types barrel concentrates multiple domain contracts and becomes a coupling hub; narrowing entry points would reduce cross-module blast radius."
|
|
107
|
-
},
|
|
108
|
-
"high_level_elegance": {
|
|
109
|
-
"evidence": [
|
|
110
|
-
"src/formats/request-helpers.ts constructs the core MockRequest (including headers/path defaults and message-derived fields), tying core request shape to the format layer rather than a core request module.",
|
|
111
|
-
"src/formats/types.ts defines the Format interface yet relies on root-level types via ../types.js, reinforcing format-layer ownership of core request lifecycle."
|
|
112
|
-
],
|
|
113
|
-
"impact_scope": "subsystem",
|
|
114
|
-
"fix_scope": "multi_file_refactor",
|
|
115
|
-
"confidence": "medium",
|
|
116
|
-
"issues_preventing_higher_score": "Request lifecycle ownership is blurred between core and format layers, making high-level responsibilities less crisp."
|
|
117
|
-
},
|
|
118
|
-
"package_organization": {
|
|
119
|
-
"evidence": [
|
|
120
|
-
"holistic_context.structure shows src/ has 11 production files (avg_fan_in 3.8) spanning CLI, server, logging, rules, and types, indicating a flat, mixed-concern directory.",
|
|
121
|
-
"Within src/, core building blocks like src/logger.ts, src/rule-engine.ts, and src/types.ts sit alongside unrelated entrypoints (cli.ts, mock-server.ts), which obscures ownership boundaries."
|
|
122
|
-
],
|
|
123
|
-
"impact_scope": "codebase",
|
|
124
|
-
"fix_scope": "multi_file_refactor",
|
|
125
|
-
"confidence": "high"
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
"findings": [
|
|
129
|
-
{
|
|
130
|
-
"dimension": "cross_module_architecture",
|
|
131
|
-
"identifier": "types_barrel_coupling_hub",
|
|
132
|
-
"summary": "Root types barrel concentrates multiple domains and amplifies cross-module coupling.",
|
|
133
|
-
"related_files": [
|
|
134
|
-
"src/types.ts",
|
|
135
|
-
"src/formats/types.ts",
|
|
136
|
-
"src/formats/request-helpers.ts"
|
|
137
|
-
],
|
|
138
|
-
"evidence": [
|
|
139
|
-
"src/types.ts re-exports request/reply/rule types into one root barrel, and format modules import from ../types.js rather than their specific domain files.",
|
|
140
|
-
"This pattern makes any change to request/reply/rule type boundaries ripple through a single high-fan-in module."
|
|
141
|
-
],
|
|
142
|
-
"suggestion": "Split the barrel into domain entry points (for example: `src/types/request.ts`, `src/types/reply.ts`, `src/types/rule.ts`) and update format imports to target the specific domain paths; keep `src/types.ts` only for external package exports if needed, and avoid internal imports from it.",
|
|
143
|
-
"confidence": "medium",
|
|
144
|
-
"impact_scope": "subsystem",
|
|
145
|
-
"fix_scope": "multi_file_refactor"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"dimension": "high_level_elegance",
|
|
149
|
-
"identifier": "format_layer_owns_request_construction",
|
|
150
|
-
"summary": "Format layer builds the core MockRequest, blurring ownership of request lifecycle.",
|
|
151
|
-
"related_files": [
|
|
152
|
-
"src/formats/request-helpers.ts",
|
|
153
|
-
"src/formats/types.ts",
|
|
154
|
-
"src/types.ts"
|
|
155
|
-
],
|
|
156
|
-
"evidence": [
|
|
157
|
-
"buildMockRequest in src/formats/request-helpers.ts derives lastMessage/systemMessage/toolNames and sets headers/path defaults, which are core request concerns.",
|
|
158
|
-
"Format interface in src/formats/types.ts consumes this helper indirectly, keeping request shape tied to the formats package."
|
|
159
|
-
],
|
|
160
|
-
"suggestion": "Move MockRequest construction into a core module (for example `src/request/build-mock-request.ts` or `src/core/mock-request.ts`) and have format parsers return a minimal parsed shape; use the core builder to add shared defaults and derived fields.",
|
|
161
|
-
"confidence": "medium",
|
|
162
|
-
"impact_scope": "subsystem",
|
|
163
|
-
"fix_scope": "multi_file_refactor"
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"dimension": "package_organization",
|
|
167
|
-
"identifier": "flat_src_mixed_concerns",
|
|
168
|
-
"summary": "The root src/ directory is a mixed-concern flat folder that hides ownership boundaries.",
|
|
169
|
-
"related_files": [
|
|
170
|
-
"src/logger.ts",
|
|
171
|
-
"src/rule-engine.ts",
|
|
172
|
-
"src/types.ts"
|
|
173
|
-
],
|
|
174
|
-
"evidence": [
|
|
175
|
-
"holistic_context.structure shows src/ contains 11 production files spanning CLI/server/logging/rules/types, indicating mixed responsibilities in a single directory.",
|
|
176
|
-
"Core building blocks (logger, rule engine, types) live beside entrypoints, making navigation and change ownership less predictable."
|
|
177
|
-
],
|
|
178
|
-
"suggestion": "Staged reorg plan: 1) Create target folders `src/core/`, `src/logging/`, and `src/entrypoints/`. 2) Move core building blocks: `git mv src/rule-engine.ts src/core/rule-engine.ts`, `git mv src/types.ts src/core/types.ts`. 3) Move logging: `git mv src/logger.ts src/logging/logger.ts`. 4) Update imports by searching: `rg -n \"from \\\"\\.\\/rule-engine\\\"|from \\\"\\.\\/types\\\"|from \\\"\\.\\/logger\\\"\" src test` and adjust to new paths. 5) Validate with `npm test` and `npm run build`.",
|
|
179
|
-
"confidence": "high",
|
|
180
|
-
"impact_scope": "codebase",
|
|
181
|
-
"fix_scope": "multi_file_refactor"
|
|
182
|
-
}
|
|
183
|
-
],
|
|
184
|
-
"retrospective": {
|
|
185
|
-
"root_causes": [
|
|
186
|
-
"Core domain types and request lifecycle are centralized at the root level, encouraging broad coupling and diffusing ownership boundaries.",
|
|
187
|
-
"The src/ directory has grown organically without sub-package delineation, leading to mixed concerns."
|
|
188
|
-
],
|
|
189
|
-
"likely_symptoms": [
|
|
190
|
-
"types_barrel_coupling_hub",
|
|
191
|
-
"format_layer_owns_request_construction"
|
|
192
|
-
],
|
|
193
|
-
"possible_false_positives": []
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
STDERR:
|
|
199
|
-
OpenAI Codex v0.114.0 (research preview)
|
|
200
|
-
--------
|
|
201
|
-
workdir: /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server
|
|
202
|
-
model: gpt-5.2-codex
|
|
203
|
-
provider: openai
|
|
204
|
-
approval: never
|
|
205
|
-
sandbox: workspace-write [workdir, /tmp, $TMPDIR, /Users/suyash.x.srijan/.codex/memories]
|
|
206
|
-
reasoning effort: low
|
|
207
|
-
reasoning summaries: none
|
|
208
|
-
session id: 019cf2e3-36ce-7be3-ba42-e3a6d7baea40
|
|
209
|
-
--------
|
|
210
|
-
user
|
|
211
|
-
You are a focused subagent reviewer for a single holistic investigation batch.
|
|
212
|
-
|
|
213
|
-
Repository root: /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server
|
|
214
|
-
Blind packet: /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server/.desloppify/review_packet_blind.json
|
|
215
|
-
Batch index: 8
|
|
216
|
-
Batch name: Governance & Contracts
|
|
217
|
-
Batch dimensions: cross_module_architecture, high_level_elegance, package_organization
|
|
218
|
-
Batch rationale: architecture contracts, compatibility policy, docs-vs-runtime scope, and quality-gate coverage
|
|
219
|
-
|
|
220
|
-
Files assigned:
|
|
221
|
-
- README.md
|
|
222
|
-
- src/types.ts
|
|
223
|
-
- src/formats/types.ts
|
|
224
|
-
- src/formats/request-helpers.ts
|
|
225
|
-
- src/logger.ts
|
|
226
|
-
- src/rule-engine.ts
|
|
227
|
-
|
|
228
|
-
Task requirements:
|
|
229
|
-
1. Read the blind packet and follow `system_prompt` constraints exactly.
|
|
230
|
-
1a. If previously flagged issues are listed above, use them as context for your review.
|
|
231
|
-
Verify whether each still applies to the current code. Do not re-report fixed or
|
|
232
|
-
wontfix issues. Use them as starting points to look deeper — inspect adjacent code
|
|
233
|
-
and related modules for defects the prior review may have missed.
|
|
234
|
-
1c. Think structurally: when you spot multiple individual issues that share a common
|
|
235
|
-
root cause (missing abstraction, duplicated pattern, inconsistent convention),
|
|
236
|
-
explain the deeper structural issue in the finding, not just the surface symptom.
|
|
237
|
-
If the pattern is significant enough, report the structural issue as its own finding
|
|
238
|
-
with appropriate fix_scope ('multi_file_refactor' or 'architectural_change') and
|
|
239
|
-
use `root_cause_cluster` to connect related symptom findings together.
|
|
240
|
-
2. Evaluate ONLY listed files and ONLY listed dimensions for this batch.
|
|
241
|
-
3. Return 0-10 high-quality findings for this batch (empty array allowed).
|
|
242
|
-
3a. Do not suppress real defects to keep scores high; report every material issue you can support with evidence.
|
|
243
|
-
3b. Do not default to 100. Reserve 100 for genuinely exemplary evidence in this batch.
|
|
244
|
-
4. Score/finding consistency is required: broader or more severe findings MUST lower dimension scores.
|
|
245
|
-
4a. Any dimension scored below 85.0 MUST include explicit feedback: add at least one finding with the same `dimension` and a non-empty actionable `suggestion`.
|
|
246
|
-
5. Every finding must include `related_files` with at least 2 files when possible.
|
|
247
|
-
6. Every finding must include `dimension`, `identifier`, `summary`, `evidence`, `suggestion`, and `confidence`.
|
|
248
|
-
7. Every finding must include `impact_scope` and `fix_scope`.
|
|
249
|
-
8. Every scored dimension MUST include dimension_notes with concrete evidence.
|
|
250
|
-
9. If a dimension score is >85.0, include `issues_preventing_higher_score` in dimension_notes.
|
|
251
|
-
10. Use exactly one decimal place for every assessment and abstraction sub-axis score.
|
|
252
|
-
9a. For package_organization, ground scoring in objective structure signals from `holistic_context.structure` (root_files fan_in/fan_out roles, directory_profiles, coupling_matrix). Prefer thresholded evidence (for example: fan_in < 5 for root stragglers, import-affinity > 60%, directories > 10 files with mixed concerns).
|
|
253
|
-
9b. Suggestions must include a staged reorg plan (target folders, move order, and import-update/validation commands).
|
|
254
|
-
11. Ignore prior chat context and any target-threshold assumptions.
|
|
255
|
-
12. Do not edit repository files.
|
|
256
|
-
13. Return ONLY valid JSON, no markdown fences.
|
|
257
|
-
|
|
258
|
-
Scope enums:
|
|
259
|
-
- impact_scope: "local" | "module" | "subsystem" | "codebase"
|
|
260
|
-
- fix_scope: "single_edit" | "multi_file_refactor" | "architectural_change"
|
|
261
|
-
|
|
262
|
-
Output schema:
|
|
263
|
-
{
|
|
264
|
-
"batch": "Governance & Contracts",
|
|
265
|
-
"batch_index": 8,
|
|
266
|
-
"assessments": {"<dimension>": <0-100 with one decimal place>},
|
|
267
|
-
"dimension_notes": {
|
|
268
|
-
"<dimension>": {
|
|
269
|
-
"evidence": ["specific code observations"],
|
|
270
|
-
"impact_scope": "local|module|subsystem|codebase",
|
|
271
|
-
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
|
272
|
-
"confidence": "high|medium|low",
|
|
273
|
-
"issues_preventing_higher_score": "required when score >85.0",
|
|
274
|
-
"sub_axes": {"abstraction_leverage": 0-100 with one decimal place, "indirection_cost": 0-100 with one decimal place, "interface_honesty": 0-100 with one decimal place} // required for abstraction_fitness when evidence supports it
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
"findings": [{
|
|
278
|
-
"dimension": "<dimension>",
|
|
279
|
-
"identifier": "short_id",
|
|
280
|
-
"summary": "one-line defect summary",
|
|
281
|
-
"related_files": ["relative/path.py"],
|
|
282
|
-
"evidence": ["specific code observation"],
|
|
283
|
-
"suggestion": "concrete fix recommendation",
|
|
284
|
-
"confidence": "high|medium|low",
|
|
285
|
-
"impact_scope": "local|module|subsystem|codebase",
|
|
286
|
-
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
|
287
|
-
"root_cause_cluster": "optional_cluster_name_when_supported_by_history"
|
|
288
|
-
}],
|
|
289
|
-
"retrospective": {
|
|
290
|
-
"root_causes": ["optional: concise root-cause hypotheses"],
|
|
291
|
-
"likely_symptoms": ["optional: identifiers that look symptom-level"],
|
|
292
|
-
"possible_false_positives": ["optional: prior concept keys likely mis-scoped"]
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
mcp startup: no servers
|
|
297
|
-
|
|
298
|
-
thinking
|
|
299
|
-
**Interpreting command note**
|
|
300
|
-
|
|
301
|
-
The note suggests using exec to read a blind packet by executing a command equivalent to 'cat' on it, indicating a direct data read approach without parsing skills involved.
|
|
302
|
-
exec
|
|
303
|
-
/bin/zsh -lc ls in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
304
|
-
LICENCE
|
|
305
|
-
README.md
|
|
306
|
-
coverage
|
|
307
|
-
dist
|
|
308
|
-
docs
|
|
309
|
-
node_modules
|
|
310
|
-
package-lock.json
|
|
311
|
-
package.json
|
|
312
|
-
scorecard.png
|
|
313
|
-
src
|
|
314
|
-
test
|
|
315
|
-
tsconfig.json
|
|
316
|
-
tsconfig.test.json
|
|
317
|
-
vitest.config.ts
|
|
318
|
-
exec
|
|
319
|
-
/bin/zsh -lc 'cat .desloppify/review_packet_blind.json' in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
320
|
-
{
|
|
321
|
-
"command": "review",
|
|
322
|
-
"mode": "holistic",
|
|
323
|
-
"language": "typescript",
|
|
324
|
-
"dimensions": [
|
|
325
|
-
"cross_module_architecture",
|
|
326
|
-
"convention_outlier",
|
|
327
|
-
"error_consistency",
|
|
328
|
-
"abstraction_fitness",
|
|
329
|
-
"api_surface_coherence",
|
|
330
|
-
"authorization_consistency",
|
|
331
|
-
"ai_generated_debt",
|
|
332
|
-
"incomplete_migration",
|
|
333
|
-
"package_organization",
|
|
334
|
-
"high_level_elegance",
|
|
335
|
-
"mid_level_elegance",
|
|
336
|
-
"low_level_elegance",
|
|
337
|
-
"design_coherence"
|
|
338
|
-
],
|
|
339
|
-
"dimension_prompts": {
|
|
340
|
-
|
|
341
|
-
thinking
|
|
342
|
-
**Preparing to read assigned files**
|
|
343
|
-
exec
|
|
344
|
-
/bin/zsh -lc "sed -n '1,200p' README.md" in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
345
|
-
# llm-mock-server
|
|
346
|
-
|
|
347
|
-
A mock LLM server for testing. It handles OpenAI `/chat/completions`, Anthropic `/messages`, and OpenAI `/responses` API formats, with both streaming (SSE) and non-streaming responses. Point any client at it and get instant, deterministic replies.
|
|
348
|
-
|
|
349
|
-
## Table of contents
|
|
350
|
-
|
|
351
|
-
- [Quick start](#quick-start)
|
|
352
|
-
- [API endpoints](#api-endpoints)
|
|
353
|
-
- [Basic usage](#basic-usage)
|
|
354
|
-
- [Matching rules](#matching-rules)
|
|
355
|
-
- [Replies](#replies)
|
|
356
|
-
- [Fallback](#fallback)
|
|
357
|
-
- [Request history](#request-history)
|
|
358
|
-
- [Advanced usage](#advanced-usage)
|
|
359
|
-
- [Tool matching](#tool-matching)
|
|
360
|
-
- [Error injection](#error-injection)
|
|
361
|
-
- [Rule lifecycle](#rule-lifecycle)
|
|
362
|
-
- [Rule inspection](#rule-inspection)
|
|
363
|
-
- [Streaming options](#streaming-options)
|
|
364
|
-
- [Advanced patterns](#advanced-patterns)
|
|
365
|
-
exec
|
|
366
|
-
/bin/zsh -lc "sed -n '200,400p' README.md" in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
367
|
-
server.when("hello").reply("Hello, world!", { latency: 50, chunkSize: 5 });
|
|
368
|
-
|
|
369
|
-
const server = new MockServer({ defaultLatency: 30, defaultChunkSize: 10 });
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
### Advanced patterns
|
|
373
|
-
|
|
374
|
-
These show how to combine the building blocks for more complex scenarios.
|
|
375
|
-
|
|
376
|
-
#### Reply sequences
|
|
377
|
-
|
|
378
|
-
Instead of registering multiple rules for multi-turn conversations, pass an array. Each match advances through the sequence. Once exhausted, the rule stops matching and falls through to the next rule or fallback.
|
|
379
|
-
|
|
380
|
-
```typescript
|
|
381
|
-
server.when("next step").replySequence([
|
|
382
|
-
"Starting the engine.",
|
|
383
|
-
"Engine is running.",
|
|
384
|
-
{ reply: { text: "All done." }, options: { latency: 100 } },
|
|
385
|
-
]);
|
|
386
|
-
```
|
|
387
|
-
exec
|
|
388
|
-
/bin/zsh -lc "sed -n '400,800p' README.md" in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
389
|
-
```bash
|
|
390
|
-
llm-mock-server -p 8080 -r ./rules --log-level debug
|
|
391
|
-
|
|
392
|
-
# Auto-reload rules when files change
|
|
393
|
-
llm-mock-server -r ./rules --watch
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
## Security
|
|
397
|
-
|
|
398
|
-
This is a testing tool, not a production service. It's designed to run locally or in CI, loading rule files that you wrote. A few things to be aware of.
|
|
399
|
-
|
|
400
|
-
### Handler files execute code
|
|
401
|
-
|
|
402
|
-
When you call `server.load()` or pass `--handler` on the CLI, `.ts`/`.js` files are loaded via dynamic `import()`. They run with the same permissions as the rest of your Node.js process. Only load files you trust.
|
|
403
|
-
|
|
404
|
-
### JSON5 rule files are data only
|
|
405
|
-
|
|
406
|
-
They go through Zod validation at load time and never execute code. Regex patterns in rule files are compiled with `new RegExp()`, which is safe but could hang on pathological patterns if you write something like `/^(a+)+$/`. Keep patterns simple.
|
|
407
|
-
|
|
408
|
-
### Network binding
|
|
409
|
-
exec
|
|
410
|
-
/bin/zsh -lc "sed -n '1,220p' src/types.ts" in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
411
|
-
export type {
|
|
412
|
-
FormatName,
|
|
413
|
-
MockRequest,
|
|
414
|
-
Message,
|
|
415
|
-
ToolDef,
|
|
416
|
-
} from "./types/request.js";
|
|
417
|
-
export type {
|
|
418
|
-
Reply,
|
|
419
|
-
ReplyObject,
|
|
420
|
-
ErrorReply,
|
|
421
|
-
ToolCall,
|
|
422
|
-
Resolver,
|
|
423
|
-
ReplyOptions,
|
|
424
|
-
SequenceEntry,
|
|
425
|
-
} from "./types/reply.js";
|
|
426
|
-
export type {
|
|
427
|
-
Match,
|
|
428
|
-
MatchObject,
|
|
429
|
-
PendingRule,
|
|
430
|
-
RuleHandle,
|
|
431
|
-
exec
|
|
432
|
-
/bin/zsh -lc "sed -n '1,220p' src/formats/types.ts" in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
433
|
-
import type {
|
|
434
|
-
FormatName,
|
|
435
|
-
MockRequest,
|
|
436
|
-
ReplyObject,
|
|
437
|
-
ReplyOptions,
|
|
438
|
-
} from "../types.js";
|
|
439
|
-
import type { RequestMeta } from "./request-helpers.js";
|
|
440
|
-
|
|
441
|
-
export interface SSEChunk {
|
|
442
|
-
readonly event?: string | undefined;
|
|
443
|
-
readonly data: string;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
export interface Format {
|
|
447
|
-
readonly name: FormatName;
|
|
448
|
-
readonly route: string;
|
|
449
|
-
parseRequest(body: unknown, meta?: RequestMeta): MockRequest;
|
|
450
|
-
isStreaming(body: unknown): boolean;
|
|
451
|
-
serialize(
|
|
452
|
-
reply: ReplyObject,
|
|
453
|
-
exec
|
|
454
|
-
/bin/zsh -lc "sed -n '1,260p' src/formats/request-helpers.ts" in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
455
|
-
import type { FormatName, Message, MockRequest, ToolDef } from "../types.js";
|
|
456
|
-
|
|
457
|
-
function asRecord(body: unknown): Record<string, unknown> {
|
|
458
|
-
if (typeof body === "object" && body !== null)
|
|
459
|
-
return body as Record<string, unknown>;
|
|
460
|
-
return {};
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
export function isStreaming(body: unknown): boolean {
|
|
464
|
-
return asRecord(body)["stream"] !== false;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
export interface RequestMeta {
|
|
468
|
-
readonly headers: Readonly<Record<string, string | undefined>>;
|
|
469
|
-
readonly path: string;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
const EMPTY_META: RequestMeta = { headers: {}, path: "" };
|
|
473
|
-
|
|
474
|
-
interface ParsedBody {
|
|
475
|
-
exec
|
|
476
|
-
/bin/zsh -lc "sed -n '1,240p' src/logger.ts" in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
477
|
-
import pc from "picocolors";
|
|
478
|
-
|
|
479
|
-
export const LEVEL_PRIORITY = {
|
|
480
|
-
none: 0,
|
|
481
|
-
error: 1,
|
|
482
|
-
warning: 2,
|
|
483
|
-
info: 3,
|
|
484
|
-
debug: 4,
|
|
485
|
-
all: 5,
|
|
486
|
-
} as const satisfies Record<string, number>;
|
|
487
|
-
|
|
488
|
-
/** Log verbosity, from `"none"` (silent) through to `"all"` (everything). */
|
|
489
|
-
export type LogLevel = keyof typeof LEVEL_PRIORITY;
|
|
490
|
-
|
|
491
|
-
const LEVEL_STYLE = {
|
|
492
|
-
error: { label: pc.red(pc.bold("ERROR")), symbol: pc.red("✗") },
|
|
493
|
-
warn: { label: pc.yellow(pc.bold("WARN")), symbol: pc.yellow("!") },
|
|
494
|
-
info: { label: pc.cyan("INFO"), symbol: pc.cyan("●") },
|
|
495
|
-
debug: { label: pc.dim("DEBUG"), symbol: pc.dim("·") },
|
|
496
|
-
} as const;
|
|
497
|
-
exec
|
|
498
|
-
/bin/zsh -lc "sed -n '1,260p' src/rule-engine.ts" in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
499
|
-
import type {
|
|
500
|
-
Match,
|
|
501
|
-
MatchObject,
|
|
502
|
-
MockRequest,
|
|
503
|
-
Resolver,
|
|
504
|
-
Reply,
|
|
505
|
-
ReplyOptions,
|
|
506
|
-
Rule,
|
|
507
|
-
RuleSummary,
|
|
508
|
-
} from "./types.js";
|
|
509
|
-
|
|
510
|
-
function safeRegex(re: RegExp): RegExp {
|
|
511
|
-
return re.global || re.sticky
|
|
512
|
-
? new RegExp(re.source, re.flags.replace(/[gy]/g, ""))
|
|
513
|
-
: re;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
function compilePattern(pattern: string | RegExp): (value: string) => boolean {
|
|
517
|
-
if (typeof pattern === "string") {
|
|
518
|
-
const lower = pattern.toLowerCase();
|
|
519
|
-
|
|
520
|
-
thinking
|
|
521
|
-
**Planning structure extraction approach**
|
|
522
|
-
|
|
523
|
-
I'm preparing to extract package organization and architecture details from a JSON structure file, considering use of JSON querying tools and searching within the package for key terms like "structure" to locate relevant data for metrics like fan-in/out and coupling.
|
|
524
|
-
exec
|
|
525
|
-
/bin/zsh -lc 'rg -n "structure" .desloppify/review_packet_blind.json | head' in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 113ms:
|
|
526
|
-
46: "Inconsistent plugin organization: sibling plugins structured differently",
|
|
527
|
-
47: "Large __init__.py re-export surfaces that obscure internal module structure"
|
|
528
|
-
150: "Use holistic_context.structure as objective evidence: root_files (fan_in/fan_out + role), directory_profiles (file_count/avg fan-in/out), and coupling_matrix (cross-directory edges)",
|
|
529
|
-
159: "Small projects (<20 files) where flat structure is appropriate",
|
|
530
|
-
161: "Test directories mirroring production structure",
|
|
531
|
-
166: "description": "Clear decomposition, coherent ownership, domain-aligned structure",
|
|
532
|
-
171: "Project contracts and reference docs match runtime reality (README/structure/philosophy are trustworthy)",
|
|
533
|
-
573: "structure": {
|
|
534
|
-
exec
|
|
535
|
-
/bin/zsh -lc "sed -n '560,760p' .desloppify/review_packet_blind.json" in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
536
|
-
"config_bag_mentions": 11
|
|
537
|
-
}
|
|
538
|
-
]
|
|
539
|
-
},
|
|
540
|
-
"dependencies": {},
|
|
541
|
-
"testing": {
|
|
542
|
-
"total_files": 41
|
|
543
|
-
},
|
|
544
|
-
"api_surface": {
|
|
545
|
-
"sync_async_mix": [
|
|
546
|
-
"src/cli-validators.ts"
|
|
547
|
-
]
|
|
548
|
-
},
|
|
549
|
-
"structure": {
|
|
550
|
-
"directory_profiles": {
|
|
551
|
-
"src/": {
|
|
552
|
-
"file_count": 11,
|
|
553
|
-
"files": [
|
|
554
|
-
"cli-validators.ts",
|
|
555
|
-
"cli.ts",
|
|
556
|
-
exec
|
|
557
|
-
/bin/zsh -lc "sed -n '760,980p' .desloppify/review_packet_blind.json" in /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server succeeded in 0ms:
|
|
558
|
-
"src/formats/openai/": 2,
|
|
559
|
-
"src/formats/": 2,
|
|
560
|
-
"src/formats/responses/": 2,
|
|
561
|
-
"src/": 1
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
},
|
|
565
|
-
"root_files": [
|
|
566
|
-
{
|
|
567
|
-
"file": "vitest.config.ts",
|
|
568
|
-
"loc": 18,
|
|
569
|
-
"fan_in": 0,
|
|
570
|
-
"fan_out": 0,
|
|
571
|
-
"role": "peripheral"
|
|
572
|
-
}
|
|
573
|
-
],
|
|
574
|
-
"coupling_matrix": {
|
|
575
|
-
"test/ \u2192 src/": 8,
|
|
576
|
-
"src/formats/anthropic/ \u2192 src/formats/": 5,
|
|
577
|
-
"src/formats/openai/ \u2192 src/formats/": 5,
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
thinking
|
|
581
|
-
**Analyzing potential architecture issues**
|
|
582
|
-
|
|
583
|
-
Found a root barrel file for types causing high fan-in and a dependency chain from formats through the root barrel to subdirectories, which might risk circular or tight coupling; need to verify if this design violates architectural boundaries or is acceptable.
|
|
584
|
-
thinking
|
|
585
|
-
**Assessing architectural and organizational findings**
|
|
586
|
-
|
|
587
|
-
Identified three findings: package organization suffers from a flat src/ mixing diverse concerns, suggesting a staged folder reorganization with concrete commands; cross-module architecture shows a god-module types barrel inflating coupling and blurring domain boundaries; high-level elegance is impacted by the format layer owning core request construction, coupling format parsing tightly to core request lifecycle. All findings include evidence and scored below 90.
|
|
588
|
-
codex
|
|
589
|
-
{
|
|
590
|
-
"batch": "Governance & Contracts",
|
|
591
|
-
"batch_index": 8,
|
|
592
|
-
"assessments": {
|
|
593
|
-
"cross_module_architecture": 88.0,
|
|
594
|
-
"high_level_elegance": 87.0,
|
|
595
|
-
"package_organization": 82.0
|
|
596
|
-
},
|
|
597
|
-
"dimension_notes": {
|
|
598
|
-
"cross_module_architecture": {
|
|
599
|
-
"evidence": [
|
|
600
|
-
"src/types.ts is a root barrel that re-exports three distinct type domains (request/reply/rule) and is a top imported module in the codebase (fan_in 19 per holistic_context.god_modules).",
|
|
601
|
-
"src/formats/types.ts and src/formats/request-helpers.ts both import from ../types.js, pulling format-specific code through the root barrel."
|
|
602
|
-
],
|
|
603
|
-
"impact_scope": "subsystem",
|
|
604
|
-
"fix_scope": "multi_file_refactor",
|
|
605
|
-
"confidence": "medium",
|
|
606
|
-
"issues_preventing_higher_score": "The root-level types barrel concentrates multiple domain contracts and becomes a coupling hub; narrowing entry points would reduce cross-module blast radius."
|
|
607
|
-
},
|
|
608
|
-
"high_level_elegance": {
|
|
609
|
-
"evidence": [
|
|
610
|
-
"src/formats/request-helpers.ts constructs the core MockRequest (including headers/path defaults and message-derived fields), tying core request shape to the format layer rather than a core request module.",
|
|
611
|
-
"src/formats/types.ts defines the Format interface yet relies on root-level types via ../types.js, reinforcing format-layer ownership of core request lifecycle."
|
|
612
|
-
],
|
|
613
|
-
"impact_scope": "subsystem",
|
|
614
|
-
"fix_scope": "multi_file_refactor",
|
|
615
|
-
"confidence": "medium",
|
|
616
|
-
"issues_preventing_higher_score": "Request lifecycle ownership is blurred between core and format layers, making high-level responsibilities less crisp."
|
|
617
|
-
},
|
|
618
|
-
"package_organization": {
|
|
619
|
-
"evidence": [
|
|
620
|
-
"holistic_context.structure shows src/ has 11 production files (avg_fan_in 3.8) spanning CLI, server, logging, rules, and types, indicating a flat, mixed-concern directory.",
|
|
621
|
-
"Within src/, core building blocks like src/logger.ts, src/rule-engine.ts, and src/types.ts sit alongside unrelated entrypoints (cli.ts, mock-server.ts), which obscures ownership boundaries."
|
|
622
|
-
],
|
|
623
|
-
"impact_scope": "codebase",
|
|
624
|
-
"fix_scope": "multi_file_refactor",
|
|
625
|
-
"confidence": "high"
|
|
626
|
-
}
|
|
627
|
-
},
|
|
628
|
-
"findings": [
|
|
629
|
-
{
|
|
630
|
-
"dimension": "cross_module_architecture",
|
|
631
|
-
"identifier": "types_barrel_coupling_hub",
|
|
632
|
-
"summary": "Root types barrel concentrates multiple domains and amplifies cross-module coupling.",
|
|
633
|
-
"related_files": [
|
|
634
|
-
"src/types.ts",
|
|
635
|
-
"src/formats/types.ts",
|
|
636
|
-
"src/formats/request-helpers.ts"
|
|
637
|
-
],
|
|
638
|
-
"evidence": [
|
|
639
|
-
"src/types.ts re-exports request/reply/rule types into one root barrel, and format modules import from ../types.js rather than their specific domain files.",
|
|
640
|
-
"This pattern makes any change to request/reply/rule type boundaries ripple through a single high-fan-in module."
|
|
641
|
-
],
|
|
642
|
-
"suggestion": "Split the barrel into domain entry points (for example: `src/types/request.ts`, `src/types/reply.ts`, `src/types/rule.ts`) and update format imports to target the specific domain paths; keep `src/types.ts` only for external package exports if needed, and avoid internal imports from it.",
|
|
643
|
-
"confidence": "medium",
|
|
644
|
-
"impact_scope": "subsystem",
|
|
645
|
-
"fix_scope": "multi_file_refactor"
|
|
646
|
-
},
|
|
647
|
-
{
|
|
648
|
-
"dimension": "high_level_elegance",
|
|
649
|
-
"identifier": "format_layer_owns_request_construction",
|
|
650
|
-
"summary": "Format layer builds the core MockRequest, blurring ownership of request lifecycle.",
|
|
651
|
-
"related_files": [
|
|
652
|
-
"src/formats/request-helpers.ts",
|
|
653
|
-
"src/formats/types.ts",
|
|
654
|
-
"src/types.ts"
|
|
655
|
-
],
|
|
656
|
-
"evidence": [
|
|
657
|
-
"buildMockRequest in src/formats/request-helpers.ts derives lastMessage/systemMessage/toolNames and sets headers/path defaults, which are core request concerns.",
|
|
658
|
-
"Format interface in src/formats/types.ts consumes this helper indirectly, keeping request shape tied to the formats package."
|
|
659
|
-
],
|
|
660
|
-
"suggestion": "Move MockRequest construction into a core module (for example `src/request/build-mock-request.ts` or `src/core/mock-request.ts`) and have format parsers return a minimal parsed shape; use the core builder to add shared defaults and derived fields.",
|
|
661
|
-
"confidence": "medium",
|
|
662
|
-
"impact_scope": "subsystem",
|
|
663
|
-
"fix_scope": "multi_file_refactor"
|
|
664
|
-
},
|
|
665
|
-
{
|
|
666
|
-
"dimension": "package_organization",
|
|
667
|
-
"identifier": "flat_src_mixed_concerns",
|
|
668
|
-
"summary": "The root src/ directory is a mixed-concern flat folder that hides ownership boundaries.",
|
|
669
|
-
"related_files": [
|
|
670
|
-
"src/logger.ts",
|
|
671
|
-
"src/rule-engine.ts",
|
|
672
|
-
"src/types.ts"
|
|
673
|
-
],
|
|
674
|
-
"evidence": [
|
|
675
|
-
"holistic_context.structure shows src/ contains 11 production files spanning CLI/server/logging/rules/types, indicating mixed responsibilities in a single directory.",
|
|
676
|
-
"Core building blocks (logger, rule engine, types) live beside entrypoints, making navigation and change ownership less predictable."
|
|
677
|
-
],
|
|
678
|
-
"suggestion": "Staged reorg plan: 1) Create target folders `src/core/`, `src/logging/`, and `src/entrypoints/`. 2) Move core building blocks: `git mv src/rule-engine.ts src/core/rule-engine.ts`, `git mv src/types.ts src/core/types.ts`. 3) Move logging: `git mv src/logger.ts src/logging/logger.ts`. 4) Update imports by searching: `rg -n \"from \\\"\\.\\/rule-engine\\\"|from \\\"\\.\\/types\\\"|from \\\"\\.\\/logger\\\"\" src test` and adjust to new paths. 5) Validate with `npm test` and `npm run build`.",
|
|
679
|
-
"confidence": "high",
|
|
680
|
-
"impact_scope": "codebase",
|
|
681
|
-
"fix_scope": "multi_file_refactor"
|
|
682
|
-
}
|
|
683
|
-
],
|
|
684
|
-
"retrospective": {
|
|
685
|
-
"root_causes": [
|
|
686
|
-
"Core domain types and request lifecycle are centralized at the root level, encouraging broad coupling and diffusing ownership boundaries.",
|
|
687
|
-
"The src/ directory has grown organically without sub-package delineation, leading to mixed concerns."
|
|
688
|
-
],
|
|
689
|
-
"likely_symptoms": [
|
|
690
|
-
"types_barrel_coupling_hub",
|
|
691
|
-
"format_layer_owns_request_construction"
|
|
692
|
-
],
|
|
693
|
-
"possible_false_positives": []
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
tokens used
|
|
697
|
-
36,748
|
|
698
|
-
|