Repository navigation
core: list the subjects in the report - #245
Merged
Merged
Conversation
The report now has a top-level `subjects` section with one entry for each subject a requirement uses, including the subjects it narrows or reads from. Each entry has the subject's `description`, a `from` sentence that says how it is found, its `identified_by` path (or null), and an empty `parts`. A subject written wrong still gets an entry, with `<invalid from>` or `<invalid identified_by>`. Each requirement entry also has `subject`, the name of the subject it checks, or null when it names none or one that isn't in the policy. Subjects written as lists are printed as sentences too. An old-syntax filter that can't be a sentence is shown as `<condition name>` instead of being left out. Changes the report: every report has a new top-level `subjects` key and every requirement entry has a new `subject` field. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A naming step with keys listed, or with no keys, has no from-line form, so it was left out of the printed from. It's now shown in angle brackets, like a filter with no sentence form: <each of "a", "b"> and <each as it>. One whose keys come from a ref prints as named by each of, whatever its alias. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
First of three PRs for #244 (decision 6 there). A report now says where each subject comes from: a top-level
subjectssection, andsubjecton each requirement.With this input:
{"deployments": [ {"id": "d-1", "environment": "prod", "approved_by": "alice"}, {"id": "d-2", "environment": "staging"} ]}and this policy:
the report has
"subject": "prod deployment"on the requirement, and (fromopa eval):releaseisn't listed because no requirement uses it.fromandidentified_byare printed as sentences. A narrowing subject has the id of the subject it narrows.partsis always{}for now. The third PR fills it.fromwritten as a list is printed as its path, thenwhoseand itsapplies_tofilters sorted by name. Anything with no sentence form shows in angle brackets, so it's never left out: a filter with a custom operator or a substitute is<condition name>, a naming step with listed keys is<each of "a", "b">, and one with no keys is<each as it>. A naming step whose keys come from a ref prints asnamed by each of $params.suites.fromor id written wrong shows as<invalid from>or<invalid identified_by>, and the subject is still listed.Changes the report: every report has
subjects, and every requirement entry hassubject.Checks
subjectsandsubjectare removed.🤖 Generated with Claude Code