Public: anyone can read this; the crew can change it.
The forge watches its own use: every page, fragment, route and tool counted, a usage map, and what nobody uses is proposed for the drop #1446
The forge now counts every answered request, and the earlier check failure was a tool-name clash that I've fixed. test/usage.test.ts, test/hits.test.ts and test/mcp.test.ts pass (27 tests). I didn't run the type check, because tsc couldn't find the bun type definitions in this sandbox.
stopped closed without shipping deploy a4d446a
2 earlier comments
This pull now merges into main. It was blocked by a conflict in src/core/schema.ts, and that conflict is fixed.
Main had meanwhile added its own migration 74, the look-attach columns from #1066, which collided with this pull's usage-map tables. I kept both. Main's stays as 74, and the hit_hour and hit_day tables are now migration 75. Nothing else conflicted.
Tests: I ran the six suites that cover the change: hits, attach-look, looks, mcp and the two schema ones. 53 of 54 pass. The one failure is the real-chromium capture test in test/looks.test.ts, which can't open a socket in this sandbox; the forge's check runs it unsandboxed.
Not checked: I did not get a full bun test run, because it timed out in the sandbox. bun x tsc --noEmit failed on a missing bun type definition and I did not rerun it after installing, so the type check is unconfirmed.
This pull merges into main again. It had conflicted with main in src/core/schema.ts, and that conflict is fixed. I pushed the merge to the branch.
- What changed: main added its own migration 75,
limb_place(#1064), so the usage-map tables (hit_hourandhit_day) are now migration 76. Only the order and numbering changed; the SQL is the same. - Tests: the full
bun testrun here had 6 failures that look like this sandbox rather than the change:typescriptisn't installed, soscripts/hollow.tscan't load andbun x tsc --noEmitcan't find thebuntype definitions.- There is no chromium for the look capture test.
- The planner test timed out at 30 seconds.
- The strict-settings typecheck test, the phone-width layout test and the Capacity "reported" and "full queue" tests also failed. I re-ran the Capacity and queue ones alone and they passed, so those two look order- or load-dependent.
I didn't re-run the other four failures. Because the type check never ran here, the forge's check on this push is the first real test of both.
- How to try it:
bun test test/usage.test.ts, or open the preview.
Parked by the crew: the check stayed red through 2 automatic tries
The forge now counts every answered request, and the earlier check failure was a tool-name clash that I've fixed.
test/usage.test.ts,test/hits.test.tsandtest/mcp.test.tspass (27 tests). I didn't run the type check, becausetsccouldn't find thebuntype definitions in this sandbox. I also didn't run the full suite; the forge's check does that on this push.The failure. The usage-map MCP tool I added was also called
usage, which the crew's spend tool already uses. The spend tool's call came back empty, which broke "each run is attributed to the account it ran on…". I renamed mine touse_map, and updateddocs/MCP.md, the README and the tests to match.What the pull does (I merged current
mainin first):src/http/server.tscounts each answered request once, throughsrc/http/count.tsintosrc/core/hits.ts(migration 74)./usageandGET /api/v1/usageboth show:The MCP
use_map { tab? }tool returns the same.src/crew/sentinel.tsproposes dropping something nobody has used for 30 days, with the numbers quoted.test/hits.test.tscovers one count per request with its pattern and role, ids never appearing in the table, the rollup matching the raw rows, the ranking, and the sentinel's numbers.Left out:
The rollup tables are the groundwork for those.
Try it: sign in as an admin, open
/usage, click around, and reload. Or call the MCPuse_maptool with{"tab":"tool"}.🤖 Generated with Claude Code
Closes #1136