Repository navigation
Conversation
Add a doc comment to every public type, enum variant and field of the policy model, stating the values it accepts and its default and, where the policy code makes it clear, what it is for, so a policy author can find these in the code and the generated API documentation. Enable `#![deny(missing_docs)]` in the policy module so that a new public item without documentation fails the build. The lint is scoped to this module; other modules of the crate are unchanged. Existing comments are kept as they were and only missing lines are added. There is no change to code, dependencies or bundled policies. Signed-off-by: Teemu Kuusisto <[email protected]>
siloteemu
force-pushed
the
chore/policy-field-docs
branch
from
November 25, 2026 15:58
e089dc8 to
b7d9444
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
#![deny(missing_docs)]keeps that true as the policy model grows: a new public item without a doc comment fails the build. A separate hand-kept reference would drift from the code.Technical Details
crates/axis-core/src/policy.rs.///doc comments on every public type, enum variant and field of the policy model, onPolicyError, and on the three public methods that had none (RuntimeContainment::as_str,RuntimeProvider::as_str,ProcessPolicy::effective_max_processes).#![deny(missing_docs)]is an inner attribute of thepolicymodule only. Other modules ofaxis-coreare unaffected, and private andpub(crate)items are not checked.policy.rs, the comment states it. Where the code establishes nothing more, the comment states only the value form and the default.Cargo.lock, workflow or bundled policy change.policy.rsmust document it, and a change to a default should update theDefault:line in the same PR. If the process-limit defaults change (see fix(policy): implicit process limits fail on hosts without writable cgroup v2 #89), update theDefault:lines on those fields in the same change.Security impact: none. Documentation and a compile-time lint only; no behaviour change, and no change to parsing, validation or defaults (shown by the round trip in the Test Plan).
Test Plan
Linux (x86_64), locally:
cargo fmt --all -- --check,cargo fmt --manifest-path gui/linux/Cargo.toml -- --check,cargo clippy --locked --all-targets -- -D warnings,cargo test --locked,bash scripts/test_security_tier0.sh.RUSTDOCFLAGS="-D warnings" cargo doc --locked -p axis-core --no-deps.axis policy validateon all 17 bundled policies (policies/*.yaml,policies/agents/*.yaml).Policy::from_fileand re-serialized (YAML andDebugdump) onmainand on this branch, and the outputs compared.policy.rsto confirm the build fails (not committed).macOS and Windows: not run locally, because they cannot be compiled on this host; CI covers them.
policy.rshas no platform-specific items, so the lint checks the same set of items on every target.Test Result
cargo fmt(both): PASS.cargo clippy: PASS.cargo docwith-D warnings: PASS.axis policy validate: 17/17 valid.mainand on this branch (empty diff).cargo test --locked: 1040 passed, 46 failed, 6 not run (marked#[ignore]). The same 46 tests fail identically on an unmodifiedmainon this host: sandbox, seccomp/MXC and exit-status tests inaxis-sandbox,axis-cliandaxis-daemonthat need a runtime environment this host does not have. None is inaxis-core; its tests pass (250 unit tests, 5 policy fixture tests).scripts/test_security_tier0.sh: theaxis-coresteps pass. Its finalaxis-sandboxMXC step fails with 20 tests, identically on unmodifiedmain, for the same reason.Skipped:
e2e/linux/test_sandbox.sh,test_e2e_daemon.sh,e2e/agents/test_agents.sh). They exercise changed policies and the launch path, which this change does not touch, and they need an MXC runtime this host does not have.