Files
curriculum-project-hub/hub/src/capacity/dimensions.ts
T
hongjr03 3f9b60f692 chore: remove Lean spec; ADRs are the single source of truth
The spec/ Lean semantic master had no conformance gate, no codegen, and
no CI tie to implementations — alignment was carried entirely by human
review, the same mechanism that carries the ADRs. In practice the ADRs
plus greppable code comments were already the load-bearing artifacts,
so spec/ was the most expensive kind of stale documentation.

- delete spec/ and the spec-check CI workflow
- README: constitution rewritten around ADRs as decision truth
- AGENTS.md/CLAUDE.md: discipline re-anchored (new decisions -> new ADR,
  never rewrite ADR history; supersede instead)
- code comments: re-anchor 'Mirrors Spec.X' invariants to ADR numbers
  (cph-diag, cph-check, cph-model, hub runner/capacity/org, prisma)
- leave ADR bodies and .scratch audit snapshots untouched (history);
  fix live references in open readiness tickets
2026-07-20 09:07:26 +00:00

64 lines
1.8 KiB
TypeScript

/**
* ADR-0022 capacity dimensions.
* The 23 pinned dimensions; exact numeric ceilings are open and calibrated by
* capacity testing. This module is the single source of the dimension set shared
* by the platform-ceiling config and the org capacity-policy service.
*/
export const CAPACITY_DIMENSIONS = [
"requestRate",
"requestBodySize",
"agentConcurrency",
"admissionQueueLength",
"admissionQueueWait",
"fileSize",
"attachmentCount",
"archiveExpansion",
"projectStorage",
"organizationStorage",
"memberCount",
"projectCount",
"teamCount",
"folderCount",
"sessionCount",
"runWallTime",
"runTurns",
"runToolCalls",
"toolWallTime",
"runOutputSize",
"processMemory",
"processCpu",
"processCount",
] as const;
export type CapacityDimension = (typeof CAPACITY_DIMENSIONS)[number];
export const CAPACITY_DIMENSION_LABELS: Record<CapacityDimension, string> = {
requestRate: "HTTP 请求速率",
requestBodySize: "请求体大小",
agentConcurrency: "智能体并发",
admissionQueueLength: "接纳队列长度",
admissionQueueWait: "接纳队列等待",
fileSize: "单文件大小",
attachmentCount: "每消息附件数",
archiveExpansion: "归档展开",
projectStorage: "项目存储",
organizationStorage: "组织存储",
memberCount: "成员数",
projectCount: "项目数",
teamCount: "团队数",
folderCount: "文件夹数",
sessionCount: "会话数",
runWallTime: "单次运行墙钟",
runTurns: "单次运行轮次",
runToolCalls: "单次运行工具调用",
toolWallTime: "工具墙钟",
runOutputSize: "运行输出大小",
processMemory: "进程内存",
processCpu: "进程 CPU",
processCount: "进程数",
};
export function isCapacityDimension(value: string): value is CapacityDimension {
return (CAPACITY_DIMENSIONS as readonly string[]).includes(value);
}