llm-mock-server 1.0.6 → 1.0.8
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 +1 -1
- 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,94 +0,0 @@
|
|
|
1
|
-
You are a focused subagent reviewer for a single holistic investigation batch.
|
|
2
|
-
|
|
3
|
-
Repository root: /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server
|
|
4
|
-
Blind packet: /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server/.desloppify/review_packet_blind.json
|
|
5
|
-
Batch index: 7
|
|
6
|
-
Batch name: Package Organization
|
|
7
|
-
Batch dimensions: package_organization, high_level_elegance
|
|
8
|
-
Batch rationale: file placement, directory boundaries, architectural layering
|
|
9
|
-
|
|
10
|
-
Files assigned:
|
|
11
|
-
- vitest.config.ts
|
|
12
|
-
- src/cli-validators.ts
|
|
13
|
-
- src/cli.ts
|
|
14
|
-
- src/history.ts
|
|
15
|
-
- test/cli-validators.test.ts
|
|
16
|
-
- test/history.test.ts
|
|
17
|
-
- test/loader.test.ts
|
|
18
|
-
- src/formats/anthropic/index.ts
|
|
19
|
-
- src/formats/anthropic/parse.ts
|
|
20
|
-
- src/formats/anthropic/schema.ts
|
|
21
|
-
- src/formats/request-helpers.ts
|
|
22
|
-
- src/formats/serialize-helpers.ts
|
|
23
|
-
- src/formats/openai/index.ts
|
|
24
|
-
- src/formats/openai/parse.ts
|
|
25
|
-
- src/formats/responses/index.ts
|
|
26
|
-
- src/formats/responses/parse.ts
|
|
27
|
-
|
|
28
|
-
Task requirements:
|
|
29
|
-
1. Read the blind packet and follow `system_prompt` constraints exactly.
|
|
30
|
-
1a. If previously flagged issues are listed above, use them as context for your review.
|
|
31
|
-
Verify whether each still applies to the current code. Do not re-report fixed or
|
|
32
|
-
wontfix issues. Use them as starting points to look deeper — inspect adjacent code
|
|
33
|
-
and related modules for defects the prior review may have missed.
|
|
34
|
-
1c. Think structurally: when you spot multiple individual issues that share a common
|
|
35
|
-
root cause (missing abstraction, duplicated pattern, inconsistent convention),
|
|
36
|
-
explain the deeper structural issue in the finding, not just the surface symptom.
|
|
37
|
-
If the pattern is significant enough, report the structural issue as its own finding
|
|
38
|
-
with appropriate fix_scope ('multi_file_refactor' or 'architectural_change') and
|
|
39
|
-
use `root_cause_cluster` to connect related symptom findings together.
|
|
40
|
-
2. Evaluate ONLY listed files and ONLY listed dimensions for this batch.
|
|
41
|
-
3. Return 0-10 high-quality findings for this batch (empty array allowed).
|
|
42
|
-
3a. Do not suppress real defects to keep scores high; report every material issue you can support with evidence.
|
|
43
|
-
3b. Do not default to 100. Reserve 100 for genuinely exemplary evidence in this batch.
|
|
44
|
-
4. Score/finding consistency is required: broader or more severe findings MUST lower dimension scores.
|
|
45
|
-
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`.
|
|
46
|
-
5. Every finding must include `related_files` with at least 2 files when possible.
|
|
47
|
-
6. Every finding must include `dimension`, `identifier`, `summary`, `evidence`, `suggestion`, and `confidence`.
|
|
48
|
-
7. Every finding must include `impact_scope` and `fix_scope`.
|
|
49
|
-
8. Every scored dimension MUST include dimension_notes with concrete evidence.
|
|
50
|
-
9. If a dimension score is >85.0, include `issues_preventing_higher_score` in dimension_notes.
|
|
51
|
-
10. Use exactly one decimal place for every assessment and abstraction sub-axis score.
|
|
52
|
-
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).
|
|
53
|
-
9b. Suggestions must include a staged reorg plan (target folders, move order, and import-update/validation commands).
|
|
54
|
-
11. Ignore prior chat context and any target-threshold assumptions.
|
|
55
|
-
12. Do not edit repository files.
|
|
56
|
-
13. Return ONLY valid JSON, no markdown fences.
|
|
57
|
-
|
|
58
|
-
Scope enums:
|
|
59
|
-
- impact_scope: "local" | "module" | "subsystem" | "codebase"
|
|
60
|
-
- fix_scope: "single_edit" | "multi_file_refactor" | "architectural_change"
|
|
61
|
-
|
|
62
|
-
Output schema:
|
|
63
|
-
{
|
|
64
|
-
"batch": "Package Organization",
|
|
65
|
-
"batch_index": 7,
|
|
66
|
-
"assessments": {"<dimension>": <0-100 with one decimal place>},
|
|
67
|
-
"dimension_notes": {
|
|
68
|
-
"<dimension>": {
|
|
69
|
-
"evidence": ["specific code observations"],
|
|
70
|
-
"impact_scope": "local|module|subsystem|codebase",
|
|
71
|
-
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
|
72
|
-
"confidence": "high|medium|low",
|
|
73
|
-
"issues_preventing_higher_score": "required when score >85.0",
|
|
74
|
-
"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
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"findings": [{
|
|
78
|
-
"dimension": "<dimension>",
|
|
79
|
-
"identifier": "short_id",
|
|
80
|
-
"summary": "one-line defect summary",
|
|
81
|
-
"related_files": ["relative/path.py"],
|
|
82
|
-
"evidence": ["specific code observation"],
|
|
83
|
-
"suggestion": "concrete fix recommendation",
|
|
84
|
-
"confidence": "high|medium|low",
|
|
85
|
-
"impact_scope": "local|module|subsystem|codebase",
|
|
86
|
-
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
|
87
|
-
"root_cause_cluster": "optional_cluster_name_when_supported_by_history"
|
|
88
|
-
}],
|
|
89
|
-
"retrospective": {
|
|
90
|
-
"root_causes": ["optional: concise root-cause hypotheses"],
|
|
91
|
-
"likely_symptoms": ["optional: identifiers that look symptom-level"],
|
|
92
|
-
"possible_false_positives": ["optional: prior concept keys likely mis-scoped"]
|
|
93
|
-
}
|
|
94
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
You are a focused subagent reviewer for a single holistic investigation batch.
|
|
2
|
-
|
|
3
|
-
Repository root: /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server
|
|
4
|
-
Blind packet: /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server/.desloppify/review_packet_blind.json
|
|
5
|
-
Batch index: 8
|
|
6
|
-
Batch name: Governance & Contracts
|
|
7
|
-
Batch dimensions: cross_module_architecture, high_level_elegance, package_organization
|
|
8
|
-
Batch rationale: architecture contracts, compatibility policy, docs-vs-runtime scope, and quality-gate coverage
|
|
9
|
-
|
|
10
|
-
Files assigned:
|
|
11
|
-
- README.md
|
|
12
|
-
- src/types.ts
|
|
13
|
-
- src/formats/types.ts
|
|
14
|
-
- src/formats/request-helpers.ts
|
|
15
|
-
- src/logger.ts
|
|
16
|
-
- src/rule-engine.ts
|
|
17
|
-
|
|
18
|
-
Task requirements:
|
|
19
|
-
1. Read the blind packet and follow `system_prompt` constraints exactly.
|
|
20
|
-
1a. If previously flagged issues are listed above, use them as context for your review.
|
|
21
|
-
Verify whether each still applies to the current code. Do not re-report fixed or
|
|
22
|
-
wontfix issues. Use them as starting points to look deeper — inspect adjacent code
|
|
23
|
-
and related modules for defects the prior review may have missed.
|
|
24
|
-
1c. Think structurally: when you spot multiple individual issues that share a common
|
|
25
|
-
root cause (missing abstraction, duplicated pattern, inconsistent convention),
|
|
26
|
-
explain the deeper structural issue in the finding, not just the surface symptom.
|
|
27
|
-
If the pattern is significant enough, report the structural issue as its own finding
|
|
28
|
-
with appropriate fix_scope ('multi_file_refactor' or 'architectural_change') and
|
|
29
|
-
use `root_cause_cluster` to connect related symptom findings together.
|
|
30
|
-
2. Evaluate ONLY listed files and ONLY listed dimensions for this batch.
|
|
31
|
-
3. Return 0-10 high-quality findings for this batch (empty array allowed).
|
|
32
|
-
3a. Do not suppress real defects to keep scores high; report every material issue you can support with evidence.
|
|
33
|
-
3b. Do not default to 100. Reserve 100 for genuinely exemplary evidence in this batch.
|
|
34
|
-
4. Score/finding consistency is required: broader or more severe findings MUST lower dimension scores.
|
|
35
|
-
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`.
|
|
36
|
-
5. Every finding must include `related_files` with at least 2 files when possible.
|
|
37
|
-
6. Every finding must include `dimension`, `identifier`, `summary`, `evidence`, `suggestion`, and `confidence`.
|
|
38
|
-
7. Every finding must include `impact_scope` and `fix_scope`.
|
|
39
|
-
8. Every scored dimension MUST include dimension_notes with concrete evidence.
|
|
40
|
-
9. If a dimension score is >85.0, include `issues_preventing_higher_score` in dimension_notes.
|
|
41
|
-
10. Use exactly one decimal place for every assessment and abstraction sub-axis score.
|
|
42
|
-
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).
|
|
43
|
-
9b. Suggestions must include a staged reorg plan (target folders, move order, and import-update/validation commands).
|
|
44
|
-
11. Ignore prior chat context and any target-threshold assumptions.
|
|
45
|
-
12. Do not edit repository files.
|
|
46
|
-
13. Return ONLY valid JSON, no markdown fences.
|
|
47
|
-
|
|
48
|
-
Scope enums:
|
|
49
|
-
- impact_scope: "local" | "module" | "subsystem" | "codebase"
|
|
50
|
-
- fix_scope: "single_edit" | "multi_file_refactor" | "architectural_change"
|
|
51
|
-
|
|
52
|
-
Output schema:
|
|
53
|
-
{
|
|
54
|
-
"batch": "Governance & Contracts",
|
|
55
|
-
"batch_index": 8,
|
|
56
|
-
"assessments": {"<dimension>": <0-100 with one decimal place>},
|
|
57
|
-
"dimension_notes": {
|
|
58
|
-
"<dimension>": {
|
|
59
|
-
"evidence": ["specific code observations"],
|
|
60
|
-
"impact_scope": "local|module|subsystem|codebase",
|
|
61
|
-
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
|
62
|
-
"confidence": "high|medium|low",
|
|
63
|
-
"issues_preventing_higher_score": "required when score >85.0",
|
|
64
|
-
"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
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"findings": [{
|
|
68
|
-
"dimension": "<dimension>",
|
|
69
|
-
"identifier": "short_id",
|
|
70
|
-
"summary": "one-line defect summary",
|
|
71
|
-
"related_files": ["relative/path.py"],
|
|
72
|
-
"evidence": ["specific code observation"],
|
|
73
|
-
"suggestion": "concrete fix recommendation",
|
|
74
|
-
"confidence": "high|medium|low",
|
|
75
|
-
"impact_scope": "local|module|subsystem|codebase",
|
|
76
|
-
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
|
77
|
-
"root_cause_cluster": "optional_cluster_name_when_supported_by_history"
|
|
78
|
-
}],
|
|
79
|
-
"retrospective": {
|
|
80
|
-
"root_causes": ["optional: concise root-cause hypotheses"],
|
|
81
|
-
"likely_symptoms": ["optional: identifiers that look symptom-level"],
|
|
82
|
-
"possible_false_positives": ["optional: prior concept keys likely mis-scoped"]
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
You are a focused subagent reviewer for a single holistic investigation batch.
|
|
2
|
-
|
|
3
|
-
Repository root: /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server
|
|
4
|
-
Blind packet: /Users/suyash.x.srijan/Documents/Personal_Projects/llm-mock-server/.desloppify/review_packet_blind.json
|
|
5
|
-
Batch index: 9
|
|
6
|
-
Batch name: Cross-cutting Sweep
|
|
7
|
-
Batch dimensions: design_coherence
|
|
8
|
-
Batch rationale: selected dimensions had no direct batch mapping; review representative cross-cutting files
|
|
9
|
-
|
|
10
|
-
Files assigned:
|
|
11
|
-
- src/types.ts
|
|
12
|
-
- src/formats/types.ts
|
|
13
|
-
- src/formats/request-helpers.ts
|
|
14
|
-
- src/logger.ts
|
|
15
|
-
- src/rule-engine.ts
|
|
16
|
-
- src/history.ts
|
|
17
|
-
- test/history.test.ts
|
|
18
|
-
- src/cli.ts
|
|
19
|
-
- src/formats/anthropic/schema.ts
|
|
20
|
-
- src/formats/openai/schema.ts
|
|
21
|
-
- src/formats/responses/schema.ts
|
|
22
|
-
- src/types/request.ts
|
|
23
|
-
- test/helpers/make-req.ts
|
|
24
|
-
- test/cli-validators.test.ts
|
|
25
|
-
- test/mock-server.test.ts
|
|
26
|
-
- test/rule-engine.test.ts
|
|
27
|
-
- src/cli-validators.ts
|
|
28
|
-
- src/mock-server.ts
|
|
29
|
-
- test/formats/anthropic.test.ts
|
|
30
|
-
- src/formats/responses/serialize.ts
|
|
31
|
-
- test/formats/responses.test.ts
|
|
32
|
-
- src/loader.ts
|
|
33
|
-
- test/formats/openai.test.ts
|
|
34
|
-
- test/loader.test.ts
|
|
35
|
-
- test/logger.test.ts
|
|
36
|
-
- src/formats/openai/serialize.ts
|
|
37
|
-
- src/types/rule.ts
|
|
38
|
-
- vitest.config.ts
|
|
39
|
-
- src/formats/anthropic/index.ts
|
|
40
|
-
- src/formats/anthropic/parse.ts
|
|
41
|
-
- src/formats/serialize-helpers.ts
|
|
42
|
-
- src/formats/openai/index.ts
|
|
43
|
-
- src/formats/openai/parse.ts
|
|
44
|
-
- src/formats/responses/index.ts
|
|
45
|
-
- src/formats/responses/parse.ts
|
|
46
|
-
- README.md
|
|
47
|
-
|
|
48
|
-
Task requirements:
|
|
49
|
-
1. Read the blind packet and follow `system_prompt` constraints exactly.
|
|
50
|
-
1a. If previously flagged issues are listed above, use them as context for your review.
|
|
51
|
-
Verify whether each still applies to the current code. Do not re-report fixed or
|
|
52
|
-
wontfix issues. Use them as starting points to look deeper — inspect adjacent code
|
|
53
|
-
and related modules for defects the prior review may have missed.
|
|
54
|
-
1c. Think structurally: when you spot multiple individual issues that share a common
|
|
55
|
-
root cause (missing abstraction, duplicated pattern, inconsistent convention),
|
|
56
|
-
explain the deeper structural issue in the finding, not just the surface symptom.
|
|
57
|
-
If the pattern is significant enough, report the structural issue as its own finding
|
|
58
|
-
with appropriate fix_scope ('multi_file_refactor' or 'architectural_change') and
|
|
59
|
-
use `root_cause_cluster` to connect related symptom findings together.
|
|
60
|
-
2. Evaluate ONLY listed files and ONLY listed dimensions for this batch.
|
|
61
|
-
3. Return 0-10 high-quality findings for this batch (empty array allowed).
|
|
62
|
-
3a. Do not suppress real defects to keep scores high; report every material issue you can support with evidence.
|
|
63
|
-
3b. Do not default to 100. Reserve 100 for genuinely exemplary evidence in this batch.
|
|
64
|
-
4. Score/finding consistency is required: broader or more severe findings MUST lower dimension scores.
|
|
65
|
-
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`.
|
|
66
|
-
5. Every finding must include `related_files` with at least 2 files when possible.
|
|
67
|
-
6. Every finding must include `dimension`, `identifier`, `summary`, `evidence`, `suggestion`, and `confidence`.
|
|
68
|
-
7. Every finding must include `impact_scope` and `fix_scope`.
|
|
69
|
-
8. Every scored dimension MUST include dimension_notes with concrete evidence.
|
|
70
|
-
9. If a dimension score is >85.0, include `issues_preventing_higher_score` in dimension_notes.
|
|
71
|
-
10. Use exactly one decimal place for every assessment and abstraction sub-axis score.
|
|
72
|
-
11. Ignore prior chat context and any target-threshold assumptions.
|
|
73
|
-
12. Do not edit repository files.
|
|
74
|
-
13. Return ONLY valid JSON, no markdown fences.
|
|
75
|
-
|
|
76
|
-
Scope enums:
|
|
77
|
-
- impact_scope: "local" | "module" | "subsystem" | "codebase"
|
|
78
|
-
- fix_scope: "single_edit" | "multi_file_refactor" | "architectural_change"
|
|
79
|
-
|
|
80
|
-
Output schema:
|
|
81
|
-
{
|
|
82
|
-
"batch": "Cross-cutting Sweep",
|
|
83
|
-
"batch_index": 9,
|
|
84
|
-
"assessments": {"<dimension>": <0-100 with one decimal place>},
|
|
85
|
-
"dimension_notes": {
|
|
86
|
-
"<dimension>": {
|
|
87
|
-
"evidence": ["specific code observations"],
|
|
88
|
-
"impact_scope": "local|module|subsystem|codebase",
|
|
89
|
-
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
|
90
|
-
"confidence": "high|medium|low",
|
|
91
|
-
"issues_preventing_higher_score": "required when score >85.0",
|
|
92
|
-
"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
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
"findings": [{
|
|
96
|
-
"dimension": "<dimension>",
|
|
97
|
-
"identifier": "short_id",
|
|
98
|
-
"summary": "one-line defect summary",
|
|
99
|
-
"related_files": ["relative/path.py"],
|
|
100
|
-
"evidence": ["specific code observation"],
|
|
101
|
-
"suggestion": "concrete fix recommendation",
|
|
102
|
-
"confidence": "high|medium|low",
|
|
103
|
-
"impact_scope": "local|module|subsystem|codebase",
|
|
104
|
-
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
|
105
|
-
"root_cause_cluster": "optional_cluster_name_when_supported_by_history"
|
|
106
|
-
}],
|
|
107
|
-
"retrospective": {
|
|
108
|
-
"root_causes": ["optional: concise root-cause hypotheses"],
|
|
109
|
-
"likely_symptoms": ["optional: identifiers that look symptom-level"],
|
|
110
|
-
"possible_false_positives": ["optional: prior concept keys likely mis-scoped"]
|
|
111
|
-
}
|
|
112
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"batch": "Architecture & Coupling",
|
|
3
|
-
"batch_index": 1,
|
|
4
|
-
"assessments": {
|
|
5
|
-
"cross_module_architecture": 82.0,
|
|
6
|
-
"high_level_elegance": 84.0
|
|
7
|
-
},
|
|
8
|
-
"dimension_notes": {
|
|
9
|
-
"cross_module_architecture": {
|
|
10
|
-
"evidence": [
|
|
11
|
-
"src/types.ts is a barrel that re-exports request/reply/rule types, and internal modules like src/rule-engine.ts and src/formats/request-helpers.ts import from \"./types.js\"/\"../types.js\" instead of their domain-specific type files.",
|
|
12
|
-
"The root types barrel becomes a dependency hub for unrelated modules, increasing blast radius for type changes across domains."
|
|
13
|
-
],
|
|
14
|
-
"impact_scope": "subsystem",
|
|
15
|
-
"fix_scope": "multi_file_refactor",
|
|
16
|
-
"confidence": "high"
|
|
17
|
-
},
|
|
18
|
-
"high_level_elegance": {
|
|
19
|
-
"evidence": [
|
|
20
|
-
"src/formats/types.ts (format contracts) imports RequestMeta from src/formats/request-helpers.ts, coupling a contract type to a helper/logic module.",
|
|
21
|
-
"src/formats/request-helpers.ts mixes RequestMeta with buildMockRequest and parsing helpers, blurring ownership of the format boundary types."
|
|
22
|
-
],
|
|
23
|
-
"impact_scope": "module",
|
|
24
|
-
"fix_scope": "multi_file_refactor",
|
|
25
|
-
"confidence": "high"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"findings": [
|
|
29
|
-
{
|
|
30
|
-
"dimension": "cross_module_architecture",
|
|
31
|
-
"identifier": "types_barrel_hub",
|
|
32
|
-
"summary": "Root types barrel creates a dependency hub and obscures domain boundaries.",
|
|
33
|
-
"related_files": [
|
|
34
|
-
"src/types.ts",
|
|
35
|
-
"src/rule-engine.ts",
|
|
36
|
-
"src/formats/request-helpers.ts"
|
|
37
|
-
],
|
|
38
|
-
"evidence": [
|
|
39
|
-
"src/types.ts only re-exports from ./types/request.js, ./types/reply.js, ./types/rule.js.",
|
|
40
|
-
"src/rule-engine.ts and src/formats/request-helpers.ts import shared types from \"./types.js\"/\"../types.js\" rather than domain-specific type files."
|
|
41
|
-
],
|
|
42
|
-
"suggestion": "Prefer direct imports from domain type files (e.g., src/types/request.ts) for internal modules, or split into domain-specific entry points and reserve src/types.ts for external/public API use.",
|
|
43
|
-
"confidence": "high",
|
|
44
|
-
"impact_scope": "subsystem",
|
|
45
|
-
"fix_scope": "multi_file_refactor",
|
|
46
|
-
"root_cause_cluster": "type_barrel_hub"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"dimension": "high_level_elegance",
|
|
50
|
-
"identifier": "request_meta_in_helper",
|
|
51
|
-
"summary": "Format contract depends on helper module, blurring ownership of request boundary types.",
|
|
52
|
-
"related_files": [
|
|
53
|
-
"src/formats/types.ts",
|
|
54
|
-
"src/formats/request-helpers.ts"
|
|
55
|
-
],
|
|
56
|
-
"evidence": [
|
|
57
|
-
"src/formats/types.ts imports RequestMeta from ./request-helpers.js.",
|
|
58
|
-
"src/formats/request-helpers.ts combines RequestMeta with buildMockRequest and isStreaming logic."
|
|
59
|
-
],
|
|
60
|
-
"suggestion": "Move RequestMeta into a dedicated types module (e.g., src/formats/request-types.ts) or into src/formats/types.ts, and have request-helpers import it instead of defining it.",
|
|
61
|
-
"confidence": "high",
|
|
62
|
-
"impact_scope": "module",
|
|
63
|
-
"fix_scope": "multi_file_refactor",
|
|
64
|
-
"root_cause_cluster": "types_helpers_boundary_blur"
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
"retrospective": {
|
|
68
|
-
"root_causes": [
|
|
69
|
-
"Centralized barrel exports used for internal imports create hidden coupling between domains.",
|
|
70
|
-
"Type definitions colocated with helper logic blur boundary ownership."
|
|
71
|
-
],
|
|
72
|
-
"likely_symptoms": [
|
|
73
|
-
"types_barrel_hub",
|
|
74
|
-
"request_meta_in_helper"
|
|
75
|
-
],
|
|
76
|
-
"possible_false_positives": []
|
|
77
|
-
}
|
|
78
|
-
}
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"batch": "Full Codebase Sweep",
|
|
3
|
-
"batch_index": 10,
|
|
4
|
-
"assessments": {
|
|
5
|
-
"cross_module_architecture": 90.0,
|
|
6
|
-
"convention_outlier": 92.0,
|
|
7
|
-
"error_consistency": 82.0,
|
|
8
|
-
"abstraction_fitness": 88.0,
|
|
9
|
-
"api_surface_coherence": 89.0,
|
|
10
|
-
"authorization_consistency": 95.0,
|
|
11
|
-
"ai_generated_debt": 93.0,
|
|
12
|
-
"incomplete_migration": 97.0,
|
|
13
|
-
"package_organization": 82.0,
|
|
14
|
-
"high_level_elegance": 88.0,
|
|
15
|
-
"mid_level_elegance": 86.0,
|
|
16
|
-
"low_level_elegance": 84.0,
|
|
17
|
-
"design_coherence": 87.0
|
|
18
|
-
},
|
|
19
|
-
"dimension_notes": {
|
|
20
|
-
"cross_module_architecture": {
|
|
21
|
-
"evidence": [
|
|
22
|
-
"Core types are centralized via `src/types.ts` and imported widely; this creates a hub module with broad blast radius for changes.",
|
|
23
|
-
"Formats depend on shared helpers in `src/formats/request-helpers.ts` and `src/formats/serialize-helpers.ts`, keeping boundary direction mostly consistent."
|
|
24
|
-
],
|
|
25
|
-
"impact_scope": "subsystem",
|
|
26
|
-
"fix_scope": "multi_file_refactor",
|
|
27
|
-
"confidence": "medium",
|
|
28
|
-
"issues_preventing_higher_score": "The type hub in `src/types.ts` concentrates change impact and could be split by concern if the surface grows further."
|
|
29
|
-
},
|
|
30
|
-
"convention_outlier": {
|
|
31
|
-
"evidence": [
|
|
32
|
-
"Format packages follow a consistent `index/parse/schema/serialize` pattern across `src/formats/*`.",
|
|
33
|
-
"Top-level `src/` mixes executable entry points, server runtime, and utilities in one directory, which is consistent but raises organization concerns rather than convention drift."
|
|
34
|
-
],
|
|
35
|
-
"impact_scope": "module",
|
|
36
|
-
"fix_scope": "single_edit",
|
|
37
|
-
"confidence": "low",
|
|
38
|
-
"issues_preventing_higher_score": "The repository largely follows consistent naming and export patterns; remaining issues are about placement rather than conventions."
|
|
39
|
-
},
|
|
40
|
-
"error_consistency": {
|
|
41
|
-
"evidence": [
|
|
42
|
-
"Resolver exceptions in `src/route-handler.ts` are caught and converted into a normal fallback reply, returning HTTP 200 without an error payload.",
|
|
43
|
-
"In `src/formats/responses/parse.ts`, malformed tool entries are silently dropped via `safeParse`, while `src/formats/openai/parse.ts` and `src/formats/anthropic/parse.ts` hard-fail on schema validation."
|
|
44
|
-
],
|
|
45
|
-
"impact_scope": "subsystem",
|
|
46
|
-
"fix_scope": "multi_file_refactor",
|
|
47
|
-
"confidence": "high"
|
|
48
|
-
},
|
|
49
|
-
"abstraction_fitness": {
|
|
50
|
-
"evidence": [
|
|
51
|
-
"The `Format` interface in `src/formats/types.ts` is implemented three times with small per-format differences, so the abstraction is useful but only minimally polymorphic.",
|
|
52
|
-
"`createRouteHandler` in `src/route-handler.ts` bundles parsing, matching, logging, and streaming in one function, suggesting boundary abstractions are only partially leveraged."
|
|
53
|
-
],
|
|
54
|
-
"impact_scope": "module",
|
|
55
|
-
"fix_scope": "multi_file_refactor",
|
|
56
|
-
"confidence": "medium",
|
|
57
|
-
"issues_preventing_higher_score": "Some abstractions are thin wrappers with limited leverage outside the current three formats.",
|
|
58
|
-
"sub_axes": {
|
|
59
|
-
"abstraction_leverage": 86.0,
|
|
60
|
-
"indirection_cost": 88.0,
|
|
61
|
-
"interface_honesty": 90.0
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"api_surface_coherence": {
|
|
65
|
-
"evidence": [
|
|
66
|
-
"`src/cli-validators.ts` exposes both sync and async parsers (`parseHost` is async, others are sync), which makes the module’s API shape uneven.",
|
|
67
|
-
"The server surface is small and consistent (single `MockServer` entry point plus `createMock`)."
|
|
68
|
-
],
|
|
69
|
-
"impact_scope": "local",
|
|
70
|
-
"fix_scope": "single_edit",
|
|
71
|
-
"confidence": "medium",
|
|
72
|
-
"issues_preventing_higher_score": "Mixed async/sync validators in a single module create minor API irregularity for consumers."
|
|
73
|
-
},
|
|
74
|
-
"authorization_consistency": {
|
|
75
|
-
"evidence": [
|
|
76
|
-
"The only route handler is created in `src/mock-server.ts` and has no auth checks, indicating a fully public mock server."
|
|
77
|
-
],
|
|
78
|
-
"impact_scope": "module",
|
|
79
|
-
"fix_scope": "single_edit",
|
|
80
|
-
"confidence": "low",
|
|
81
|
-
"issues_preventing_higher_score": "Auth posture is implicit rather than explicit; there is no in-code signal that the endpoints are intentionally unauthenticated."
|
|
82
|
-
},
|
|
83
|
-
"ai_generated_debt": {
|
|
84
|
-
"evidence": [
|
|
85
|
-
"Comment ratio is high in `src/types/request.ts` and `src/types/rule.ts` compared with the codebase average, suggesting some doc-comment bulk.",
|
|
86
|
-
"Comments mostly describe semantics and appear purposeful rather than restating code."
|
|
87
|
-
],
|
|
88
|
-
"impact_scope": "local",
|
|
89
|
-
"fix_scope": "single_edit",
|
|
90
|
-
"confidence": "low",
|
|
91
|
-
"issues_preventing_higher_score": "Comment density in the types layer is higher than typical and could become noise if it grows further."
|
|
92
|
-
},
|
|
93
|
-
"incomplete_migration": {
|
|
94
|
-
"evidence": [
|
|
95
|
-
"No deprecated markers or migration TODOs appear in the reviewed production files.",
|
|
96
|
-
"No mixed JS/TS implementations exist for the same module in the reviewed set."
|
|
97
|
-
],
|
|
98
|
-
"impact_scope": "local",
|
|
99
|
-
"fix_scope": "single_edit",
|
|
100
|
-
"confidence": "high",
|
|
101
|
-
"issues_preventing_higher_score": "No explicit migration scaffolding is visible; score held below 100 only due to limited evidence scope."
|
|
102
|
-
},
|
|
103
|
-
"package_organization": {
|
|
104
|
-
"evidence": [
|
|
105
|
-
"`src/` contains 11 mixed-concern files (cli, server runtime, loader, logger, rule engine), exceeding the >10 file flat-directory threshold.",
|
|
106
|
-
"`src/` avg fan-in is 3.8 and coupling shows bidirectional edges between `src/` and `src/formats/`, suggesting responsibilities are not strongly separated."
|
|
107
|
-
],
|
|
108
|
-
"impact_scope": "codebase",
|
|
109
|
-
"fix_scope": "architectural_change",
|
|
110
|
-
"confidence": "high"
|
|
111
|
-
},
|
|
112
|
-
"high_level_elegance": {
|
|
113
|
-
"evidence": [
|
|
114
|
-
"Primary domain concepts (formats, server, rules) are clear, but are all housed in a flat `src/` root alongside CLI utilities.",
|
|
115
|
-
"The public API surface in `src/index.ts` is concise but coupled to internal layout."
|
|
116
|
-
],
|
|
117
|
-
"impact_scope": "subsystem",
|
|
118
|
-
"fix_scope": "multi_file_refactor",
|
|
119
|
-
"confidence": "medium",
|
|
120
|
-
"issues_preventing_higher_score": "Top-level decomposition would read cleaner if CLI/runtime utilities were separated from core server and rule-engine concerns."
|
|
121
|
-
},
|
|
122
|
-
"mid_level_elegance": {
|
|
123
|
-
"evidence": [
|
|
124
|
-
"`createRouteHandler` orchestrates parsing, matching, error handling, logging, and streaming directly, making handoffs between layers less explicit.",
|
|
125
|
-
"Format-specific parsing and serialization are cleanly separated, reducing translation friction."
|
|
126
|
-
],
|
|
127
|
-
"impact_scope": "module",
|
|
128
|
-
"fix_scope": "multi_file_refactor",
|
|
129
|
-
"confidence": "medium",
|
|
130
|
-
"issues_preventing_higher_score": "Integration seams are mostly predictable but could be clearer with narrower handler responsibilities."
|
|
131
|
-
},
|
|
132
|
-
"low_level_elegance": {
|
|
133
|
-
"evidence": [
|
|
134
|
-
"ID generation in `src/formats/serialize-helpers.ts` uses `Date.now()` without collision avoidance, which can produce duplicate IDs under same-millisecond calls."
|
|
135
|
-
],
|
|
136
|
-
"impact_scope": "subsystem",
|
|
137
|
-
"fix_scope": "single_edit",
|
|
138
|
-
"confidence": "high"
|
|
139
|
-
},
|
|
140
|
-
"design_coherence": {
|
|
141
|
-
"evidence": [
|
|
142
|
-
"`createRouteHandler` bundles multiple responsibilities (parsing, matching, metrics/logging, response mode selection), which could be separated for clearer intent.",
|
|
143
|
-
"Helper modules under `src/formats/` are focused and coherent."
|
|
144
|
-
],
|
|
145
|
-
"impact_scope": "module",
|
|
146
|
-
"fix_scope": "multi_file_refactor",
|
|
147
|
-
"confidence": "medium",
|
|
148
|
-
"issues_preventing_higher_score": "Some core control flow aggregates multiple responsibilities in one function, reducing separation of concerns."
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
"findings": [
|
|
152
|
-
{
|
|
153
|
-
"dimension": "error_consistency",
|
|
154
|
-
"identifier": "resolver_errors_swallowed",
|
|
155
|
-
"summary": "Resolver exceptions are swallowed and returned as normal fallback replies",
|
|
156
|
-
"related_files": [
|
|
157
|
-
"src/route-handler.ts",
|
|
158
|
-
"src/types/reply.ts",
|
|
159
|
-
"src/mock-server.ts"
|
|
160
|
-
],
|
|
161
|
-
"evidence": [
|
|
162
|
-
"`resolveReply` catches resolver errors and returns `normalizeReply(fallback)` with no error signal.",
|
|
163
|
-
"Downstream in the handler, the fallback reply is serialized as a normal 200 response if it doesn’t set `error`."
|
|
164
|
-
],
|
|
165
|
-
"suggestion": "Surface resolver failures explicitly: either rethrow and let Fastify return 500, or translate to `ReplyObject.error` with a 5xx status. Update `resolveReply` and `createRouteHandler` to propagate an error reply, and document the error contract in `src/types/reply.ts`.",
|
|
166
|
-
"confidence": "high",
|
|
167
|
-
"impact_scope": "subsystem",
|
|
168
|
-
"fix_scope": "multi_file_refactor",
|
|
169
|
-
"root_cause_cluster": "error_handling_policy"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"dimension": "error_consistency",
|
|
173
|
-
"identifier": "responses_tools_silent_drop",
|
|
174
|
-
"summary": "Responses tool parsing silently drops invalid tools unlike other formats",
|
|
175
|
-
"related_files": [
|
|
176
|
-
"src/formats/responses/parse.ts",
|
|
177
|
-
"src/formats/openai/parse.ts",
|
|
178
|
-
"src/formats/anthropic/parse.ts"
|
|
179
|
-
],
|
|
180
|
-
"evidence": [
|
|
181
|
-
"`parseTools` in responses uses `FunctionToolSchema.safeParse` and filters out failed parses, so malformed tool entries are ignored.",
|
|
182
|
-
"OpenAI and Anthropic requests rely on schema parsing that fails the whole request on invalid structures."
|
|
183
|
-
],
|
|
184
|
-
"suggestion": "Align tool-validation behavior across formats: either treat invalid tools as a request error for responses, or document and apply a consistent “best-effort” policy across all formats. Prefer failing the request for invalid tools to keep error handling predictable.",
|
|
185
|
-
"confidence": "medium",
|
|
186
|
-
"impact_scope": "module",
|
|
187
|
-
"fix_scope": "multi_file_refactor",
|
|
188
|
-
"root_cause_cluster": "error_handling_policy"
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
"dimension": "low_level_elegance",
|
|
192
|
-
"identifier": "non_unique_ids",
|
|
193
|
-
"summary": "ID generation relies on Date.now(), risking collisions under concurrency",
|
|
194
|
-
"related_files": [
|
|
195
|
-
"src/formats/serialize-helpers.ts",
|
|
196
|
-
"src/formats/openai/serialize.ts",
|
|
197
|
-
"src/formats/responses/serialize.ts"
|
|
198
|
-
],
|
|
199
|
-
"evidence": [
|
|
200
|
-
"`genId` and `toolId` use `Date.now().toString(36)` which can repeat in the same millisecond.",
|
|
201
|
-
"Streaming serializers call these helpers multiple times per request, and concurrent requests can produce duplicate IDs."
|
|
202
|
-
],
|
|
203
|
-
"suggestion": "Switch to a collision-resistant ID source (e.g., `crypto.randomUUID()` or a process-wide monotonic counter with a random prefix). Update `genId`/`toolId` and regenerate IDs in the serializers to avoid duplicate response IDs.",
|
|
204
|
-
"confidence": "high",
|
|
205
|
-
"impact_scope": "subsystem",
|
|
206
|
-
"fix_scope": "single_edit"
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"dimension": "package_organization",
|
|
210
|
-
"identifier": "flat_src_mixed_concerns",
|
|
211
|
-
"summary": "Flat `src/` directory mixes CLI, server, and rule-engine concerns",
|
|
212
|
-
"related_files": [
|
|
213
|
-
"src/cli.ts",
|
|
214
|
-
"src/mock-server.ts",
|
|
215
|
-
"src/route-handler.ts",
|
|
216
|
-
"src/loader.ts"
|
|
217
|
-
],
|
|
218
|
-
"evidence": [
|
|
219
|
-
"`src/` contains 11 files across CLI, HTTP server, rule engine, logging, and utilities (directory profile shows `file_count: 11`).",
|
|
220
|
-
"Coupling shows bidirectional edges between `src/` and `src/formats/`, indicating blurred boundaries at the top level."
|
|
221
|
-
],
|
|
222
|
-
"suggestion": "Stage a reorg to clarify ownership: 1) create `src/server/` and move `mock-server.ts`, `route-handler.ts`, `sse-writer.ts`; 2) create `src/cli/` and move `cli.ts`, `cli-validators.ts`; 3) create `src/core/` (or `src/rules/`) and move `rule-engine.ts`, `loader.ts`, `history.ts`, `logger.ts`; 4) update imports and `src/index.ts` exports; 5) run `npm test` or `vitest` to validate and adjust any path-based tooling.",
|
|
223
|
-
"confidence": "high",
|
|
224
|
-
"impact_scope": "codebase",
|
|
225
|
-
"fix_scope": "architectural_change"
|
|
226
|
-
}
|
|
227
|
-
],
|
|
228
|
-
"retrospective": {
|
|
229
|
-
"root_causes": [
|
|
230
|
-
"Error handling policy is inconsistent across request parsing, resolver execution, and tool validation paths.",
|
|
231
|
-
"Top-level `src/` is serving as a catch-all for multiple concerns, suggesting missing package boundaries."
|
|
232
|
-
],
|
|
233
|
-
"likely_symptoms": [
|
|
234
|
-
"resolver_errors_swallowed",
|
|
235
|
-
"responses_tools_silent_drop",
|
|
236
|
-
"flat_src_mixed_concerns"
|
|
237
|
-
],
|
|
238
|
-
"possible_false_positives": [
|
|
239
|
-
"non_unique_ids"
|
|
240
|
-
]
|
|
241
|
-
}
|
|
242
|
-
}
|