allocation-fixtures.json 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. {
  2. "$comment": [
  3. "Regression fixtures for GitHub issue #1500 / epic CG-1 — relevance-proportional",
  4. "explore budget allocation. Run them with `node scripts/agent-eval/probe-allocation.mjs`",
  5. "against a built dist/. BOTH FIXTURES FAIL TODAY: that is the point — they document",
  6. "the bug and become the pass gate for the allocation change (CG-10 + CG-12).",
  7. "",
  8. "`groups` partitions the files explore rendered into `answer` (what the query is",
  9. "actually about) and `incidental` (what wins the envelope today on name collisions).",
  10. "Assertions are on the DELIVERED envelope unless suffixed `Allocated`; delivered is",
  11. "what the agent got, allocated is what the render loop chose before the hard ceiling.",
  12. "Shares are fractions of the whole response, meta-text included, so they never sum to 1."
  13. ],
  14. "fixtures": [
  15. {
  16. "id": "payroll-go",
  17. "title": "#1500 — generated Go CRUD beside a hand-written payroll workflow",
  18. "kind": "fixture",
  19. "path": "__tests__/fixtures/payroll-go",
  20. "query": "how does payroll cycle create and calculate payslips?",
  21. "rationale": [
  22. "The reporter's repo shape: a Go service whose generated FKIT CRUD layer sits",
  23. "beside the hand-written use-case that does the real work. The query deliberately",
  24. "does NOT name runPayrollCycleAll / BuildPayslip / Upsert — an architecture",
  25. "question phrased the way a newcomer would phrase it. The generated layer",
  26. "name-collides on every query term (CreatePayslip, PayrollCycleCreateRequest,",
  27. "CalculatePayrollCycleTotals, a second BuildPayslip, a second Upsert), so a",
  28. "scorer that rewards incidental name matches surfaces the CRUD path.",
  29. "Half the generated files carry ORDINARY names and are only detectable by their",
  30. "`// Code generated ... DO NOT EDIT.` header (CG-5), which is what makes this",
  31. "the #1500 case rather than a .pb.go case."
  32. ],
  33. "groups": {
  34. "answer": [
  35. "internal/usecase/**",
  36. "internal/store/**",
  37. "internal/transport/**",
  38. "internal/domain/**",
  39. "cmd/**"
  40. ],
  41. "incidental": ["internal/gen/**"]
  42. },
  43. "assert": {
  44. "answerShareAtLeast": 0.55,
  45. "incidentalShareAtMost": 0.25,
  46. "topFileGroup": "answer",
  47. "mustDeliverBytes": [
  48. "internal/usecase/payroll/cycle.go",
  49. "internal/usecase/payroll/payslip_builder.go"
  50. ],
  51. "$mustContainComment": "Needles are chosen to match the HAND-WRITTEN chain only — a bare `BuildPayslip`/`Upsert` also matches the generated collisions, which is the whole point of the fixture.",
  52. "mustContain": [
  53. "runPayrollCycleAll",
  54. "func (s *Service) BuildPayslip",
  55. "s.store.Upsert(ctx, slip)"
  56. ]
  57. },
  58. "baseline": {
  59. "measuredOn": "2026-08-03",
  60. "note": "19 files → very-tiny tier (13,000 budget); 23,020 chars allocated against it, cut to 16,011 by the 19,500 hard ceiling.",
  61. "delivered": {
  62. "internal/gen/fkit/payroll/payslip.go": 0.307,
  63. "internal/gen/fkit/payroll/payroll_cycle.go": 0.266,
  64. "internal/domain/payroll/payslip.go": 0.256,
  65. "internal/usecase/payroll/cycle.go": 0.0
  66. },
  67. "verdict": "The workflow file is allocated the single largest slice (30.6%) and delivers ZERO — the hard ceiling drops its whole section. Generated CRUD takes 57.4% of what the agent actually receives; runPayrollCycleAll, BuildPayslip and the real Upsert never reach the response."
  68. }
  69. },
  70. {
  71. "id": "self-query",
  72. "title": "This repo — incidental `explore`/`BUDGET` matches in the agent-eval scripts",
  73. "kind": "self",
  74. "path": ".",
  75. "query": "how does explore allocate its output budget across files",
  76. "rationale": [
  77. "The same failure mode with no generated code in sight. `scripts/agent-eval/*.mjs`",
  78. "mention `explore` and `BUDGET` incidentally — they are eval harnesses, not the",
  79. "allocator — and they are small enough to ship WHOLE, while src/mcp/tools.ts (which",
  80. "carries getExploreOutputBudget and the render loop, and scores 4x higher on every",
  81. "signal) is large enough to be clipped at maxCharsPerFile. Allocation follows file",
  82. "size, not relevance.",
  83. "",
  84. "Unlike payroll-go this fixture reads THIS repo's live index, so its exact numbers",
  85. "move as the repo changes (indexed file count crossing 500 flips the budget tier).",
  86. "The assertions are therefore relative — answer-vs-incidental, not fixed percentages."
  87. ],
  88. "groups": {
  89. "answer": ["src/mcp/**"],
  90. "incidental": ["scripts/**"]
  91. },
  92. "assert": {
  93. "answerShareAtLeast": 0.5,
  94. "incidentalShareAtMost": 0.25,
  95. "topFileGroup": "answer",
  96. "mustDeliverBytes": ["src/mcp/tools.ts"]
  97. },
  98. "baseline": {
  99. "measuredOn": "2026-08-03",
  100. "note": "493 files → small tier (18,000 budget); 27,518 chars allocated against it, cut to 19,749 by the 25,000 hard ceiling.",
  101. "delivered": {
  102. "scripts/agent-eval/offload-eval-hook.mjs": 0.25,
  103. "scripts/agent-eval/offload-eval-metrics.mjs": 0.236,
  104. "scripts/agent-eval/parse-session.mjs": 0.232,
  105. "src/mcp/tools.ts": 0.185,
  106. "scripts/agent-eval/offload-eval-cost.mjs": 0.0
  107. },
  108. "verdict": "The script corpus takes 71.8% of the delivered envelope (79.4% of what was allocated) against tools.ts's 18.5%, despite tools.ts scoring 46 vs 10, carrying 2.3x the graph mass and 3x the distinct term hits."
  109. }
  110. }
  111. ]
  112. }