docs: document zero-threshold policy fix and improve ledger/policy inline docs#4
Merged
Gsbreddy merged 1 commit intoMay 1, 2026
Conversation
…cstrings - CHANGELOG.md: add Fixed entry under Unreleased for PR #3 (zero policy sample thresholds were silently ignored due to falsy 'or' fallback; now uses 'is not None' checks) - ledger.py: add docstrings to confidence_label, evaluate_policy, and diff_releases explaining threshold semantics (None vs 0 vs config default), confidence label tiers, constraint fields, and agent-id invariant - models.py: add Policy class docstring explaining the None/0 distinction for min_* threshold fields versus constraint (max_*) fields - schemas/v1/policy.schema.json: regenerated to pick up Policy docstring Co-authored-by: Gottam Sai Bharath <Gsbreddy@users.noreply.github.com>
Gsbreddy
added a commit
that referenced
this pull request
May 1, 2026
* feat: FlightDeck 1.0.1 package and v1 rollout readiness Ship the local-first CLI, schemas, tests, and CI. Slim-repo docs link to canonical flightdeckdev/flightdeck main. OpenTelemetry is optional-only. Also: pytest basetemp under .tmp/pytest for Windows, Python 3.13–3.14 in CI, ruff 0.15.12 aligned with ruff-pre-commit, pre-commit-hooks v5, .gitattributes LF for golden bundle, CHANGELOG 1.0.1 section and empty Unreleased, RELEASE_NOTES v1.0.1 patch notes, README quickstart_smoke first. Co-authored-by: Cursor <cursoragent@cursor.com> * adds pypi fixes * adds ci fixes * fix: respect zero policy sample thresholds (#3) Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Gottam Sai Bharath <Gsbreddy@users.noreply.github.com> * Fix promotion audit sequencing (#5) Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Gottam Sai Bharath <Gsbreddy@users.noreply.github.com> * docs: document zero-threshold policy fix and improve ledger/policy docstrings (#4) - CHANGELOG.md: add Fixed entry under Unreleased for PR #3 (zero policy sample thresholds were silently ignored due to falsy 'or' fallback; now uses 'is not None' checks) - ledger.py: add docstrings to confidence_label, evaluate_policy, and diff_releases explaining threshold semantics (None vs 0 vs config default), confidence label tiers, constraint fields, and agent-id invariant - models.py: add Policy class docstring explaining the None/0 distinction for min_* threshold fields versus constraint (max_*) fields - schemas/v1/policy.schema.json: regenerated to pick up Policy docstring Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Gottam Sai Bharath <Gsbreddy@users.noreply.github.com> --------- Co-authored-by: zendaya <zendaya@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Gottam Sai Bharath <Gsbreddy@users.noreply.github.com> Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
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.
Docs added/updated
CHANGELOG.mdAdded a
### Fixedentry under Unreleased for the zero-threshold policy sample bug merged in PR #3. The entry explains what broke (falsyor-based fallback treated an explicit0likeNone), what was fixed (is not Noneguards), and what it enables (a policy can set thresholds to0to unconditionally accept any sample size).src/flightdeck/ledger.pyAdded docstrings to three previously undocumented functions:
confidence_label— documents the HIGH / MEDIUM / LOW tier logic, explains that a threshold of0is valid and means "no minimum required", and notes the empty-window case.evaluate_policy— lists each constraint checked (max_cost_per_run_usd,max_latency_ms,max_error_rate,require_high_diff_confidence) and documents the skip conditions.diff_releases— full Args/Returns/Raises docstring covering: threshold resolution (None→ config default,0→ explicit override), the agent-id invariant for cross-agent diff rejection, howwindowis used (label only, not a filter), and the returnedDiffResult.src/flightdeck/models.pyAdded a class docstring to
Policythat documents the two field groups and their distinct semantics:max_*) —Nonedisables the constraint.min_*) —Nonedefers to workspace config;0unconditionally accepts any sample size (the key distinction introduced by PR fix: respect zero policy sample thresholds #3).schemas/v1/policy.schema.jsonRegenerated (via
scripts/generate_schemas.py) to include the newPolicydocstring as the JSON Schemadescriptionfield. All 49 tests pass includingtest_committed_json_schemas_match_models.Which codepaths these cover
flightdeck.ledger.diff_releases— the primary comparison engine (cost, latency, error-rate rollups, confidence labelling, policy evaluation).flightdeck.models.Policy— the on-disk and in-memory policy object consumed bydiff_releasesand the CLI'srelease diff/release promote/release rollbackcommands.Key knowledge gaps addressed
Nonevs0threshold contract was implicit in the code and absent from any docs; it is now explicit in bothPolicy's docstring anddiff_releases's docstring.confidence_labelthresholds actually mean (including the0-is-valid edge case) was previously only discoverable by reading the implementation.evaluate_policychecks and when it skips them was undocumented.CHANGELOG.mdso future readers understand whyis not Noneis used instead ofor.