Skip to content

docs(design): document policy.py, the fail-closed resource limits - #13

Merged
minglong51 merged 1 commit into
mainfrom
docs/policy-module
Aug 9, 2026
Merged

docs(design): document policy.py, the fail-closed resource limits#13
minglong51 merged 1 commit into
mainfrom
docs/policy-module

Conversation

@minglong51

Copy link
Copy Markdown
Owner

First finding from the new --audit pass, and a clean demonstration of why it exists.

policy.py was named in no design doc, despite being imported by ir.py, parser.py, runtime.py and server.py. The drift report could never have flagged it — the module predates the LLD's last change, so it sits outside every forward diff. That's precisely the class --audit was added to catch.

What's now documented

All 14 constants, tabulated, plus the scope statement from the module's own docstring:

conservative defaults for the single-node runtime, not distributed-runtime service-level guarantees

A workload that needs more should split programs or put an authenticated admission layer in front of the server — not raise the numbers. That distinction is the difference between a limit and a suggestion, and it's the kind of intent a regenerated doc would reduce to "there are some constants."

Also recorded: fail-closed means rejected, never truncated. A silently clipped program would execute something the author didn't write.

Verification

--audit now reports 0 unnamed for this repo (was 1). 5 pytests pass; drift clean. Section edited in place, not regenerated.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VE91emzDnxCY2MWDmuuip7

Surfaced by the new --audit pass: policy.py was named in no design doc despite
being imported by ir.py, parser.py, runtime.py and server.py. The drift report
could never have flagged it — the module predates the LLD's last change, which is
exactly the class --audit exists to catch.

Tabulates all 14 constants and records the scope statement from its docstring:
these are conservative defaults for the SINGLE-NODE runtime, not
distributed-runtime service-level guarantees. A workload that needs more should
split programs or add an authenticated admission layer, not raise the numbers —
that distinction is the difference between a limit and a suggestion.

Also records that fail-closed means rejected, never truncated: a silently clipped
program would execute something the author did not write.

Section edited in place; the doc was NOT regenerated.

X-Review-Waive: documentation only, no product code touched. Claims traced to
policy.py:1-22 and its importers ir.py:34, parser.py:55, runtime.py:48,
server.py:31.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@minglong51
minglong51 merged commit 10fc87d into main Aug 9, 2026
4 of 5 checks passed
@minglong51
minglong51 deleted the docs/policy-module branch August 22, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant