- Notifications
You must be signed in to change notification settings - Fork 0
feat(ownir): bound source coordinates and nesting depth (Python-first)#326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
PhysShell
wants to merge
4
commits into
mainChoose a base branch
from
claude/ownir-defensive-limits
base:main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+501
−22
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
bc8790c
feat(ownir): bound source coordinates and nesting depth, Python-first
claude 9f909c7
fix(ownir): put the limits in the JSON schema, and stop overclaiming …
claude 4125978
fix(ownir): bind sourceLine to exactly the paths load() checks
claude c6e3699
test(ownir): assert the whole subschema, not just its $ref
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -48,8 +48,15 @@ | ||
| "$defs": { | ||
| "sourceColumn": { | ||
| "description": "1-based source column of the SAME node `line` anchors on. Optional and additive, so OWNIR_VERSION stays 0 (spec/OwnIR.md §2): a producer that does not report one omits it and no consumer substitutes a value — not 0, not 1, and never recovered by re-reading the source line. Rides to SARIF as region.startColumn, where the OwnAudit occurrence anchor reads it (Own.NET#317).", | ||
| "type": ["integer", "null"], | ||
| "minimum": 1, | ||
| "maximum": 9223372036854775807 | ||
| }, | ||
coderabbitai[bot] marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| "sourceLine": { | ||
| "description": "A source line. Bounded to a signed 64-bit integer (spec/OwnIR.md \u00a74.2): Python integers are unbounded and the reference used to accept coordinates no other consumer could represent, which made the vocabulary implementable only in a language with bignums. A coordinate nothing downstream can hold is not a usable coordinate. Pinned to ownlang/obligations.py::INT64_MIN/INT64_MAX.", | ||
| "type": "integer", | ||
| "minimum": 1 | ||
| "minimum": -9223372036854775808, | ||
| "maximum": 9223372036854775807 | ||
| }, | ||
| "resourceKind": { | ||
| "description": "The resource-kind discriminator (spec/OwnIR.md §4). It selects the analysis path, so a present-but-unknown value is rejected at load (fail-loud) and a new kind must bump OWNIR_VERSION. Pinned to ownlang/ownir.py::_KNOWN_RESOURCE_KINDS.", | ||
| @@ -82,7 +89,7 @@ | ||
| "properties": { | ||
| "type": { "type": "string" }, | ||
| "file": { "type": "string" }, | ||
| "line": { "type": "integer" } | ||
| "line": { "$ref": "#/$defs/sourceLine" } | ||
| } | ||
| }, | ||
| "component": { | ||
| @@ -168,7 +175,7 @@ | ||
| "required": ["name"], | ||
| "properties": { | ||
| "name": { "type": "string" }, | ||
| "line": { "type": "integer" }, | ||
| "line": { "$ref": "#/$defs/sourceLine" }, | ||
| "column": { "$ref": "#/$defs/sourceColumn" }, | ||
| "effect": { "$ref": "#/$defs/paramEffect" } | ||
| } | ||
| @@ -295,9 +302,9 @@ | ||
| "weak_deps": { "type": "array", "items": { "type": "string" } }, | ||
| "root_resolves": { "type": "array", "items": { "type": "string" } }, | ||
| "file": { "type": "string" }, | ||
| "line": { "type": "integer" }, | ||
| "line": { "$ref": "#/$defs/sourceLine" }, | ||
| "ctor_file": { "type": "string" }, | ||
| "ctor_line": { "type": "integer" }, | ||
| "ctor_line": { "$ref": "#/$defs/sourceLine" }, | ||
| "ctor_type": { "type": "string" }, | ||
| "root_resolve_sites": { "type": "array", "items": { "$ref": "#/$defs/site" } }, | ||
| "scope_cached": { "type": "array", "items": { "type": "string" } }, | ||
| @@ -311,7 +318,7 @@ | ||
| "description": "Whether the effect performs I/O (default false).", | ||
| "type": "boolean" | ||
| }, | ||
| "line": { "type": "integer" }, | ||
| "line": { "$ref": "#/$defs/sourceLine" }, | ||
| "deps": { | ||
| "description": "The effect's dependency-array names.", | ||
| "type": "array", | ||
| @@ -333,7 +340,7 @@ | ||
| "type": "string" | ||
| }, | ||
| "refs": { "type": "array", "items": { "type": "string" } }, | ||
| "line": { "type": "integer" } | ||
| "line": { "$ref": "#/$defs/sourceLine" } | ||
| } | ||
| }, | ||
| "protocolMatcher": { | ||
| @@ -420,7 +427,7 @@ | ||
| "ev": { "const": "assign" }, | ||
| "target": { "type": "string", "minLength": 1 }, | ||
| "value": { "type": ["boolean", "null"] }, | ||
| "line": { "type": "integer" } | ||
| "line": { "$ref": "#/$defs/sourceLine" } | ||
| }, | ||
| "required": ["ev", "target"] | ||
| }, | ||
| @@ -431,7 +438,7 @@ | ||
| "ev": { "const": "call" }, | ||
| "callee": { "type": "string", "minLength": 1 }, | ||
| "arg": { "type": ["string", "null"] }, | ||
| "line": { "type": "integer" } | ||
| "line": { "$ref": "#/$defs/sourceLine" } | ||
| }, | ||
| "required": ["ev", "callee"] | ||
| }, | ||
| @@ -440,7 +447,7 @@ | ||
| "description": "A normal method exit.", | ||
| "properties": { | ||
| "ev": { "const": "return" }, | ||
| "line": { "type": "integer" } | ||
| "line": { "$ref": "#/$defs/sourceLine" } | ||
| }, | ||
| "required": ["ev"] | ||
| }, | ||
| @@ -449,7 +456,7 @@ | ||
| "description": "An exceptional method exit. Frontends thread finally bodies onto exits, like the flow lowering (§5).", | ||
| "properties": { | ||
| "ev": { "const": "throw" }, | ||
| "line": { "type": "integer" } | ||
| "line": { "$ref": "#/$defs/sourceLine" } | ||
| }, | ||
| "required": ["ev"] | ||
| }, | ||
| @@ -458,7 +465,7 @@ | ||
| "description": "A branch with both arms lowered.", | ||
| "properties": { | ||
| "ev": { "const": "if" }, | ||
| "line": { "type": "integer" }, | ||
| "line": { "$ref": "#/$defs/sourceLine" }, | ||
| "then": { "type": "array", "items": { "$ref": "#/$defs/protocolEvent" } }, | ||
| "else": { "type": "array", "items": { "$ref": "#/$defs/protocolEvent" } } | ||
| }, | ||
| @@ -469,7 +476,7 @@ | ||
| "description": "A loop; the checker solves the body to a local fixpoint.", | ||
| "properties": { | ||
| "ev": { "const": "while" }, | ||
| "line": { "type": "integer" }, | ||
| "line": { "$ref": "#/$defs/sourceLine" }, | ||
| "body": { "type": "array", "items": { "$ref": "#/$defs/protocolEvent" } } | ||
| }, | ||
| "required": ["ev"] | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an owned-resource record or flow operation contains a line outside the signed 64-bit range,
load()still accepts it:components[].subscriptions[].lineis never checked, and_check_flow_columns()validates onlycolumnand nesting. For example, both a subscription and areturnflow op withline: 2**80pass the strict door, contradicting this new normative “every line” limit and preserving the Python/port divergence this change is intended to eliminate. Apply the integer type/range check to these records recursively as well.AGENTS.md reference: AGENTS.md:L14-L14
Useful? React with 👍 / 👎.