StockSense self-audit
StockSense got a D+ on tests, CI and deploy.
StockSense is the inventory core of MindServe. It runs on one deployment with demo data and has no customers. On October 24, 2026, I had agents audit it, read-only, and grade every area. The code is private, so this page is my dated account of it. Nothing has been re-graded since.
What held up
- Tenant isolation is enforced in the database itself, and it fails closed.
- Cost layers are written by locked database functions that check the totals.
- Receiving freezes its plan with a fingerprint, and an interrupted commit resumes.
- The AI never writes to the database directly. Every change starts as a proposal that can be undone, and money decisions wait for a manager on screen by default.
What I fixed
- Where the D+ came from
The deploy did not wait for the tests that run against a real database, and schema changes reached the live database without a migration. Now schema goes out only as checked-in migrations that CI matches against the schema, the deploy waits for those tests, and it logs a recovery point before it migrates.
- Two cups, taken out as two pounds
A recipe called for 2 cups of flour, and flour was stocked by the pound. The conversion failed, and the system took 2 pounds from stock anyway, so stock and cost of goods drifted silently. Now a failed conversion takes nothing and puts the line in front of the manager.
- A badge that measured nothing
The dashboard showed a green “100% Compliant” badge. Nothing was being measured; the number was written into the code. Now it says “Not tracked yet,” and a test fails if a made-up score comes back.
The one critical item was fixed the same day. From then through October 27, nearly three in four merged pull requests traced back to the audit.
How it was done
- Ten auditors, one area of the code each.
- A skeptic tried to disprove each finding from the code. Of 58 rated high or critical, 33 stayed high.
- The highest-stakes findings got a second, independent check.
- A last reviewer looked for what the ten missed.
- 61 agents in all, read-only. 135 findings in the final report.
Scorecard
| Area | Grade | Why |
|---|---|---|
| Security | C | Database-enforced tenant isolation and the AI gateway graded A; other findings in the area pulled it to C. |
| MCP AI Manager | C+ | Safety design sound; the shared decision record and tool count needed work. |
| Bones for other verticals | C | Generic core; no layer yet for per-vertical rules and templates. |
| Money and data integrity | C- | FIFO and approvals strong; several totals and cost paths could drift silently. |
| Tech debt and architecture | C+ | Strict typing and good guardrails; foundations not ready for a customer. |
| Tests, CI and deploy | D+ | Tests graded B; deploys didn’t wait for the real-database suites, and schema reached the database without a migration. |
| Feature gaps | C+ | Deep receiving and costing core; sales import, food-cost reports, and vendor ordering were unfinished. |
| Frontend and UX | C+ | Careful in places; still shaped around a single demo setup. |
| Performance and scale | C | Fine at demo scale; per-query overhead and serial loops would bite at volume. |
| Domain rules | C | Rules explain themselves and wait for approval; the usage data behind them had gaps. |
Still open
- A re-grade. Every grade above is from audit day.
- A rehearsed restore. The recovery steps are written down, not yet practiced.
- An accounting export, register returns and transfers between sites, and the rules another kind of business would need.