Skip to content

Refresh typeutil and intent package specifications - #79039

Closed
gh-aw-bot wants to merge 4 commits into
mainfrom
copilot/spec-librarian-specification-audit
Closed

gh-aw-bot wants to merge 4 commits into
mainfrom
copilot/spec-librarian-specification-audit

Conversation

@gh-aw-bot

@gh-aw-bot gh-aw-bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

The package audit found that ParseIntValue’s documented rejection cases were incomplete and that intent’s API inventory omitted exported policy types and errors.

  • typeutil — Document rejection of NaN, infinities, out-of-range floats, and uint64 values above the maximum int; clarify that in-range floats truncate toward zero.
  • intent — Add the missing policy types and document ErrToolDenied and ErrToolNotAllowed.
n, ok := typeutil.ParseIntValue(math.NaN())
// n == 0, ok == false

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@gh-aw-bot gh-aw-bot changed the title [WIP] Fix accuracy issue in typeutil ParseIntValue specification Refresh typeutil and intent package specifications Nov 18, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 18, 2026 16:39
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 16:39
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by PR Specification Reviewer for #79039 · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.7K · ◷

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~2 AIC · ⌖ ~2 AIC · ⊞ 1.5K · ◷

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by Ponytail Reviewer for #79039 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete: no actionable correctness or regression issues found in the changed documentation and specification tests. The added coverage matches the documented ParseIntValue rejection behavior, and the intent API inventory updates are consistent with the exported policy types and sentinel errors.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~2 AIC · ⊞ 1.5K
Comment /review to run again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain, and the changes are limited to updating specifications, conformance tests, and API documentation for current numeric conversion and authorization behavior.

No open issues 🎉

What changed in this PR

Refreshes the typeutil and intent package specifications and conformance tests to align with current numeric conversion behavior and exported APIs.

Changes:

  • Documents ParseIntValue rejection cases and truncation semantics, with expanded specification coverage.
  • Adds missing exported policy types and authorization errors to the intent API documentation.
File Description
pkg/​typeutil/​spec_test.go Adds specification cases for float truncation, invalid floating-point values, range overflow, and excessive uint64 values.
pkg/​typeutil/​README.md Documents ParseIntValue rejection cases and truncation behavior while distinguishing it from SafeUint64ToInt.
pkg/​intent/​README.md Adds exported policy types and documents the ErrToolDenied and ErrToolNotAllowed authorization errors.

Review effort: Lite (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-8b6fb7b8-a08c-4f31-8730-b993513943e6","parents":[],"payload":{"id":"ldg-3d9fe7d1-a349-4861-8fc1-693dfa166557","operation":"append","value":{"finding_count":0,"head_sha":"e147fde848a2d1817191e0b1b57c890e62eac3a5","outcome":"no_findings"}},"sha":"sha256:4ddf60d29e5c00bcfa37bfb3c92586ce8b9025a2b87028d293f44e517cf54c4f","timestamp":"2026-11-18T16:46:38.107Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-21a2e738-0e7e-424a-b5a3-9f2e17372ea6","parents":[],"payload":{"id":"ldg-2b05ab99-56ba-49e0-9ba3-3e799577a8f9","operation":"append","value":{"finding_count":0,"head_sha":"e147fde848a2d1817191e0b1b57c890e62eac3a5","outcome":"aligned"}},"sha":"sha256:5fa0a7c25e486356e234fca8c8af0b812062e942e6f5451209de7816596f3280","timestamp":"2026-11-18T16:47:56.406Z","type":"ledger_append","version":1}
History

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /tdd and /grill-with-docs. The code matches the README claims and the typeutil and intent spec tests pass. Four follow-ups: two test-coverage gaps and two doc accuracy issues.

📋 Key Themes & Highlights

Key Themes

  • Boundary coverage (/tdd): The new float and uint64 cases only test one side of each limit. The README now documents exact int bounds and negative truncation, and those cases are not pinned. A floor-vs-truncate or off-by-one regression would still pass.
  • Enforcement overstated (/grill-with-docs): Authorizer is documented as an operational control. ExecutionPolicy says not to rely on it until it is integrated, and nothing outside pkg/intent calls AuthorizeTool.
  • Inventory consistency (/grill-with-docs): ErrToolDenied and ErrToolNotAllowed appear only in a trailing sentence, not the inventory table. Authorizer appears in two tables with different wording.

Verification

  • go test ./pkg/typeutil/ ./pkg/intent/ passes.
  • A temporary probe confirmed that -3.7 gives -3, that -2^63 is accepted and 2^63 rejected, and that uint64(MaxInt) is accepted and MaxInt+1 rejected. The README is accurate. The probe file was removed.
  • I checked each exported intent symbol against the README. Only the two sentinel errors are missing from the table.

Positive Highlights

  • ✅ The NaN, infinity, and overflow cases are well chosen and match the implementation.
  • ✅ The spec doc comments were updated along with the README.
  • ✅ The SafeUint64ToInt vs ParseIntValue distinction in the README is accurate and useful.

Next steps: address the four inline comments. None is blocking.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again

Comment thread pkg/typeutil/spec_test.go
wantOK: true,
},
{
name: "float64 fractional value truncates toward zero",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] The README now says in-range floats truncate toward zero, but the only fractional case is positive (3.14). For positive values truncation and floor agree, so a regression to floor semantics would still pass. Add a negative case.

💡 Suggested test
{
    name:      "negative float64 fractional value truncates toward zero",
    input:     float64(-3.7),
    wantValue: -3,
    wantOK:    true,
},

Truncation toward zero differs from floor for negatives, so this pins the documented contract.

@copilot please address this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a negative fractional test that distinguishes truncation toward zero from floor semantics. Commit: f07470b.

Comment thread pkg/typeutil/spec_test.go Outdated
wantOK: false,
},
{
name: "uint64 overflow returns (0, false)",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] This test only uses ^uint64(0), the largest possible value, so it does not pin the documented boundary. A regression that rejects values below math.MaxInt would still pass. Add cases on both sides of the int limits.

💡 Suggested tests
{
    name:      "uint64 at max int returns value",
    input:     uint64(math.MaxInt),
    wantValue: math.MaxInt,
    wantOK:    true,
},
{
    name:      "uint64 one above max int returns (0, false)",
    input:     uint64(math.MaxInt) + 1,
    wantValue: 0,
    wantOK:    false,
},
{
    name:      "float64 at negative int limit returns value",
    input:     -math.Ldexp(1, strconv.IntSize-1),
    wantValue: math.MinInt,
    wantOK:    true,
},
{
    name:      "float64 at positive int limit returns (0, false)",
    input:     math.Ldexp(1, strconv.IntSize-1),
    wantValue: 0,
    wantOK:    false,
},

The float cases use strconv.IntSize, so the file needs a strconv import. Using it keeps the limits correct on 32-bit targets too.

@copilot please address this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added both uint64 boundary cases and float64 values at the signed int limits using strconv.IntSize. Commit: f07470b.

Comment thread pkg/intent/README.md Outdated
|------|------|-------------|
| `AttributionStatus` | string | Classifies the outcome of intent attribution |
| `AttributionSource` | string | Identifies the data source used for attribution |
| `Authorizer` | struct | Checks tool calls against a compiled execution policy |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/grill-with-docs] This row presents tool authorization as operational. But ExecutionPolicy says not to rely on it until AuthorizeTool is integrated into the execution path, and nothing outside pkg/intent calls it yet. The inventory should keep that caveat, or the README overstates what is enforced.

💡 Suggested wording

For example: Checks tool calls against a compiled execution policy. Not yet enforced in the execution path; see ExecutionPolicy. Apply the same caveat to the Tool authorization section (around line 89).

@copilot please address this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the execution-path caveat to the Authorizer inventory entry and AuthorizeTool description. Commit: f07470b.

Comment thread pkg/intent/README.md Outdated
| `Authorizer` | struct | Authorizes individual tool calls against a compiled `ExecutionPolicy` |
| `AuthorizeTool` | `func (a Authorizer) AuthorizeTool(policy ExecutionPolicy, tool string) error` | Returns `ErrToolDenied` if `tool` is in `DeniedTools` (denial always wins), `ErrToolNotAllowed` if `AllowedTools` is non-nil and does not contain `tool`, or `nil` otherwise. A `nil` `AllowedTools` is unrestricted; a non-nil empty `AllowedTools` denies every tool. |

The package exports `ErrToolDenied` and `ErrToolNotAllowed` as sentinel errors returned by `AuthorizeTool` for those respective denial cases.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/grill-with-docs] The new sentinel errors are documented only in this trailing sentence, while the rest of the README API uses table rows. Authorizer is also listed in two tables with different descriptions. Add the errors to the inventory table, and keep one canonical Authorizer entry.

💡 Suggested rows
| `ErrToolDenied` | error | Returned by `AuthorizeTool` when the tool is in `DeniedTools` |
| `ErrToolNotAllowed` | error | Returned by `AuthorizeTool` when `AllowedTools` is non-nil and does not contain the tool |

@copilot please address this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added both sentinel errors to the API inventory and removed the duplicate Authorizer entry. Commit: f07470b.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator Author

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/typeutil/spec_test.go:50): address unresolved feedback - Review comment
  3. Review (pkg/typeutil/spec_test.go:86): address unresolved feedback - Review comment
  4. Review (pkg/intent/README.md:24): address unresolved feedback - Review comment
  5. Review (pkg/intent/README.md:92): address unresolved feedback - Review comment

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "e147fde848a2d1817191e0b1b57c890e62eac3a5",
  "kind": "requested",
  "schema_version": "1",
  "state": "f22c06814f96b262a0d82f781bdb1a5e06ed380102aa895252a83abaf70fef12",
  "work": [
    "a355ac6332f414027105482252d60442f0bf5cb312612610d679aec44f0bb801",
    "b1974b30ac8c5ec91cefad24e6adf65862987f095e3427f6e8c10d646995e60e",
    "b27bae9d53f8ac9111d1dbc669e154fbe19b34c8cb27d474240276e12dfc5ab0",
    "c1d5716c196189839d558ac49ee473f46fa732c5bb21cace2b58c3f5934cd313"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

gh-aw-bot and others added 2 commits November 18, 2026 17:24
…n-specification-audit

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[spec-librarian] Specification Audit — 2026-11-18 — 6 issues found

4 participants