Skip to content

Commit d910ec5

Browse files
committed
docs: document global dependency budget
1 parent 58ea1cb commit d910ec5

5 files changed

Lines changed: 20 additions & 5 deletions

File tree

.coderabbit.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ reviews:
1515
Focus on newly introduced GlobalV/GlobalC/PARAM dependencies, default
1616
parameters in headers, module placement, CMakeLists.txt linkage, C++11
1717
compatibility, and focused tests for behavior changes.
18+
During the legacy global-state migration period, treat a net increase in
19+
GlobalV/GlobalC/PARAM code references as blocking, and treat
20+
migration-neutral added usage as reviewer-visible warnings requiring
21+
reason, scope, risk, and cleanup rationale.
1822
- path: "source/source_io/module_parameter/**"
1923
instructions: |
2024
Treat INPUT parameter metadata, parsing, defaults, descriptions, and

.github/instructions/abacus-governance.instructions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ Apply these instructions when reviewing or changing ABACUS code:
1212
newly introduced symbols, and changed text files for line-ending checks.
1313
- Do not treat untouched historical debt as a default blocker. Mention it only
1414
when it affects the changed area, and label it as advisory.
15-
- Flag newly introduced `GlobalV`, `GlobalC`, or `PARAM` cross-layer control.
15+
- Flag PRs that increase `GlobalV`, `GlobalC`, or `PARAM` code references as
16+
blocker-level governance issues. Flag migration-neutral added usage as a
17+
warning that requires reason, scope, risk, and cleanup/follow-up rationale.
1618
Prefer explicit dependencies or narrow local interfaces.
1719
- Flag new default arguments in existing header interfaces. Prefer explicit
1820
call-site updates, overloads, or a clearer configuration object.

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Fix #...
2222
- Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...
2323

2424
### Governance Checklist
25-
- Global dependencies: no new `GlobalV`, `GlobalC`, or `PARAM` cross-layer control, or exception requested below.
25+
- Global dependencies: no net increase in `GlobalV`, `GlobalC`, or `PARAM` code references, or exception requested below with reason, scope, risk, and cleanup plan.
2626
- Default parameters: no new default arguments added to existing interfaces, or exception requested below.
2727
- Headers: no unnecessary header dependencies or `.hpp` propagation, or rationale provided below.
2828
- Line endings: text files use LF; only `.bat` and `.cmd` use CRLF.

AGENTS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ rules. Read the complete governance document before making or reviewing changes:
99
## Required Baseline
1010

1111
- Follow the seven ABACUS coding rules summarized from the project governance:
12-
1. Do not introduce new cross-layer control through `GlobalV`, `GlobalC`, or
13-
`PARAM`; pass dependencies explicitly.
12+
1. Do not increase cross-layer control through `GlobalV`, `GlobalC`, or
13+
`PARAM`; pass dependencies explicitly where practical. Migration-neutral
14+
moves must keep the PR-level global dependency budget non-increasing and
15+
explain the remaining global usage.
1416
2. Do not hide workflow switches in mutable member variables that can be
1517
changed from multiple places.
1618
3. Keep header dependencies minimal.

docs/developers_guide/agent_governance.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ decisions.
6969
| --- | --- | --- | --- | --- | --- | --- | --- |
7070
| Basic text format | LF line endings | phase-one mechanical | hook + CI | medium | block | full changed text file | `.bat` and `.cmd` keep CRLF |
7171
| Language baseline | C++11 compatibility | build/toolchain | CI | high | block | build/static tooling | Actual compiler/toolchain result wins |
72-
| New global dependency | Added `GlobalV`/`GlobalC`/`PARAM` as cross-layer control | phase-one mechanical + AI review | CI + AI review | high | block | added code lines | Historical untouched usage and documentation mentions are not blocked |
72+
| Global dependency budget | Net increase of `GlobalV`/`GlobalC`/`PARAM` references in code diff | phase-one mechanical + AI review | CI + AI review | high | block on net increase, warn on non-increasing added usage | added and removed code lines | Historical untouched usage and documentation mentions are not blocked; migration-neutral moves require reviewer rationale |
7373
| New default parameter | Header declaration adds a default argument | phase-one mechanical + AI review | CI + AI review | high | block | header diff | High misuse risk |
7474
| `.hpp` propagation | New `.hpp` or header includes `.hpp` | phase-one mechanical warning | CI + AI review | medium | warn | new files and added includes | Exception can be recorded in PR |
7575
| Header dependency growth | Header diff adds includes | phase-one mechanical warning + AI review | CI + AI review | medium | warn | added header includes | Necessity is semantic and not mechanically decided |
@@ -97,6 +97,13 @@ explicit governance change. For header include warnings, the rationale should
9797
state whether the header needs a complete type, for example because it owns a
9898
value member rather than a pointer or reference.
9999

100+
For global dependencies, the mechanical checker uses a PR-level budget during
101+
the legacy migration period. A PR blocks only when the number of code references
102+
to `GlobalV`, `GlobalC`, or `PARAM` increases after accounting for deleted
103+
references. If a PR adds global references while deleting at least as many
104+
elsewhere, the checker warns instead of blocking; reviewers should confirm the
105+
change is a migration-neutral move or part of a cleanup path.
106+
100107
## Automation Responsibilities
101108

102109
Local hooks:

0 commit comments

Comments
 (0)