Skip to content

fix(council): omit generated shell descriptions from review prompts - #181

Open
hsin-c wants to merge 1 commit into
NVIDIA:developfrom
hsin-c:hsinc/nomos-106-omit-auto-generated-shell-descriptions-from
Open

hsin-c wants to merge 1 commit into
NVIDIA:developfrom
hsin-c:hsinc/nomos-106-omit-auto-generated-shell-descriptions-from

Conversation

@hsin-c

@hsin-c hsin-c commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Tracks NOMOS-106.

Shell authorization now omits the generated description from Council review prompts when they already show the full command. The prompts retain the full command, justification, and requester-authored descriptions, including text identical to the fallback. Server-owned provenance stays in private intent state, so System One, OPA inputs, serialized intents, and writ binding retain their existing behavior.

Verification

  • 475 tests passed across Council authorization and prompt rendering, structured tools, System One, OPA, and writs.
  • Ruff lint and formatting passed for all four changed files. Targeted mypy passed for the three changed production modules. Repository-wide mypy reported the same four Redis typing errors on the base and this branch.

Adversarial review

  • An independent reviewer exercised the registered authorization callbacks and gRPC proxy with in-process mocks. The review checked initial voting, debate, chairman, and packaged-file prompts, plus preservation of System One, OPA, and writ inputs. It also verified that a request cannot spoof the server-owned provenance flag.
  • The reviewer found that the original test fixture could miss command truncation at 80 characters. The revised regression test uses a longer command. All three cases pass for omitted, empty, and explicitly identical descriptions, and all three fail when the formatter is deliberately truncated. The review closed with no outstanding findings.

Summary by CodeRabbit

  • Bug Fixes
    • Reviewer prompts no longer show automatically generated shell descriptions when the requester leaves the description blank or omits it. Target resources remain visible.
    • Requester-provided descriptions continue to appear in reviewer prompts. Structured tool requests retain their description behavior, including displaying generated fallback text when applicable.
    • Authorization continues to receive the generated shell fallback description.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Authorization now tracks when a shell description is generated as a fallback. Council review prompts omit that description while retaining the command and other intent fields. Tests cover shell and structured-tool authorization prompts with supplied and fallback descriptions.

Changes

Authorization Prompt Rendering

Layer / File(s) Summary
Track generated shell descriptions
nomos/level_0/types/intent.py, nomos/nat/functions.py
Intent gains a private flag for shell-description fallback provenance. Authorization sets the flag when a shell request has no supplied description.
Render descriptions in review prompts
nomos/llm/council_agent.py, tests/test_nat_functions.py
Council omits the description when a command is present and the flag marks it as generated. Tests cover shell and structured-tool prompts with empty, omitted, and explicit descriptions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 3f067

This change hides generated shell description fallbacks from Council review prompts. Requester-written descriptions, the command, and policy inputs remain unchanged. No actionable merge-blocking risk was found.

Security architecture risk: Minimal · up to 3f067

The change removes a redundant, shortened copy of the command from the review. Reviewers still see the full command, its target, the reason for the request when provided, and any description supplied by the requester. The change leaves policy checks and the binding between an approval and the authorized action intact.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed presentation can affect Council decisions for shell authorization requests with omitted or empty descriptions. The delta adds no route to another Council, target, or execution capability. Requests that supply a description and structured tool requests do not take the omission branch.

Trust Boundaries and Controls

  • observed — The requester controls the command, description, and justification, but does not set the provenance marker. The server derives it after the existing identity checks. Its use is limited to omitting the generated description line; the formatter retains the full command, target resource, working directory, and supplied justification.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the Conventional Commits format with the allowed type 'fix' and scope '(council)', lowercase throughout, no trailing period, and 67 characters. It clearly describes the main change: the…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses the Conventional Commits format with the allowed type 'fix' and scope '(council)', lowercase throughout, no trailing period, and 67 characters. It clearly describes the main change: the Council review prompt omits server-generated shell descriptions when the full command is present, which matches the raw summary and PR objectives.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: NVIDIA/Nomos
  • Branch: develop
  • File: .coderabbit.yaml
  • Commit: af2d980
  • Layers: Repository YAML
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: cb58efee-eb65-4d58-afaf-001b62def933
Commits

Reviewing files that changed from the base of the PR and between af2d980 and 3f06757.

Files selected for processing: 4

  • nomos/level_0/types/intent.py
  • nomos/llm/council_agent.py
  • nomos/nat/functions.py
  • tests/test_nat_functions.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Recent review details

Context from checks skipped due to timeout: 3

  • GitHub Check: Unit tests
  • GitHub Check: CodeRabbit
  • GitHub Check: OPA policy tests
Additional context used

Code guidelines: 1

.agents/architecture.md — configured
Path-based instructions: 5

Core library, organized into layered levels (level_0..level_4) plus auth, crypto, opa, store, mcp, grpc, and llm subsystems.

CodeRabbit configuration file

Files:

  • nomos/level_0/types/intent.py
  • nomos/llm/council_agent.py
  • nomos/nat/functions.py
Tests are mandatory for behavior changes and should cover failure paths, not only happy paths.

CodeRabbit configuration file

Files:

  • tests/test_nat_functions.py
Every hand-authored source and configuration file must begin with the Apache-2.0 header: an SPDX-FileCopyrightText copyright line followed by SPDX-License-Identifier: Apache-2.0.

CodeRabbit configuration file

Files:

  • nomos/level_0/types/intent.py
  • nomos/llm/council_agent.py
  • nomos/nat/functions.py
  • tests/test_nat_functions.py
Source excerpt: Current architectural intent: `nomos/nat`, `nomos/grpc`: ingress and adapter layers.

CodeRabbit inference engine (.agents/architecture.md)

Files:

  • nomos/nat/functions.py
Source excerpt: Current architectural intent: `nomos/level_0`: primitives, types, clocks, crypto.

CodeRabbit inference engine (.agents/architecture.md)

Files:

  • nomos/level_0/types/intent.py
ast-grep (0.51.3)

tests/test_nat_functions.py

[info] 1028-1028: Do not hardcode temporary file or directory names
Context: "/tmp"
Note: [CWE-377] Insecure Temporary File.

(hardcoded-tmp-file)

[info] 1217-1217: Do not hardcode temporary file or directory names
Context: "/tmp"
Note: [CWE-377] Insecure Temporary File.

(hardcoded-tmp-file)

Additional comments: 4

nomos/level_0/types/intent.py: 1

164-165: LGTM!

nomos/nat/functions.py: 1

4499-4500: LGTM!

nomos/llm/council_agent.py: 1

373-375: LGTM!

tests/test_nat_functions.py: 1

1[REDACTED]5-1044: LGTM!

Also applies to: 1154-1157, 1172-1172, 1201-1202, 1205-1224

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.

1 participant