Skip to content

feat(agent-config): structured policy_data tree editor [16/21] - #337

Merged
gusfcarvalho merged 4 commits into
agent-config/15-inline-editingfrom
agent-config/16-policy-data-tree
Oct 6, 2026
Merged

gusfcarvalho merged 4 commits into
agent-config/15-inline-editingfrom
agent-config/16-policy-data-tree

Conversation

@gusfcarvalho

@gusfcarvalho gusfcarvalho commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Part 16 of 21 of the stacked split of #318 (agent remote configuration). Every layer adds the final version of its files from #318, and only imports from layers below it, so each layer passes make reviewable on its own. Nothing is reachable in the app until layer 20 wires the Configuration tab in.

What

The structured policy_data tree editor: section, tree, node and add-item form.

Tests

Covered by PolicyDataSection.spec.ts in the next layer, since that spec mounts it inside the plugin summary card.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a structured view of reported policy data, with an option to inspect and edit it as raw JSON.
    • When editing is available, you can add, change, remove, and revert values. Inputs are validated before changes are applied.
    • Policy data now shows access notes, pending changes, and differences across instances where applicable. Read-only views remain available when editing is unavailable.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 10:52
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 37484ae3-8ed5-4985-8d99-6e766dd960b9
📥 Commits

Reviewing files that changed from the base of the PR and between 20ee278 and 4cc87d3.

📒 Files selected for processing (6)
  • src/components/agents/config/__tests__/PolicyDataDiffers.spec.ts
  • src/components/agents/config/effective/PolicyDataAddForm.vue
  • src/components/agents/config/effective/PolicyDataNode.vue
  • src/components/agents/config/effective/PolicyDataSection.vue
  • src/components/agents/config/effective/PolicyDataTree.vue
  • src/components/agents/config/effective/policyDataContext.ts

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


📝 Walkthrough

Walkthrough

The change adds a policy-data section with structured and raw editing. Nested nodes support pointer-based edits, removals, and additions. Validation handles parsed values and raw JSON. Tests cover instance-difference hints and rendering.

Changes

Policy Data Editor

Layer / File(s) Summary
Draft section and tree wiring
src/components/agents/config/effective/policyDataContext.ts, src/components/agents/config/effective/PolicyDataSection.vue, src/components/agents/config/effective/PolicyDataTree.vue
The section selects reported or draft data and provides structured and raw editing paths. The tree receives pointer-based edit operations and access information from the injected context.
Nested value display and editing
src/components/agents/config/effective/PolicyDataNode.vue, src/components/agents/config/__tests__/PolicyDataDiffers.spec.ts
Nodes display nested values and support type-aware edits and removals. Editable arrays can show instance-difference hints. Tests check hint visibility and scalar-versus-container rendering.
Adding object keys and array items
src/components/agents/config/effective/PolicyDataNode.vue, src/components/agents/config/effective/PolicyDataAddForm.vue
Editable containers render an add form. The form validates object keys and parsed values, then emits the new key or array item.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Editor
  participant PolicyDataSection
  participant PolicyDataTree
  participant PolicyDataNode
  participant PolicyDataTreeContext
  PolicyDataSection->>PolicyDataTree: Render data and pointer
  PolicyDataTree->>PolicyDataNode: Render nested value
  Editor->>PolicyDataNode: Submit value edit
  PolicyDataNode->>PolicyDataTree: Emit pointer and value
  PolicyDataTree->>PolicyDataTreeContext: Forward pointer and value
Loading

Merge Risk: ⚪ Minimal · up to 4cc87

No actionable issue was established in this change; it is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (4 skipped: 4 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: a structured policy_data tree editor for agent configuration.
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: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit taps the fields with care,
Then nests new keys in tidy rows.
It checks each value before it’s shared,
And spots where lists do not align.
The burrow keeps its edits neat.

Comment @coderabbitai help to get the list of available commands.

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gusfcarvalho
gusfcarvalho force-pushed the agent-config/16-policy-data-tree branch from e9eeeb8 to 3e293b4 Compare October 5, 2026 16:32
@ccf-lisa
ccf-lisa Bot force-pushed the agent-config/16-policy-data-tree branch from 3e293b4 to 7af204d Compare October 6, 2026 09:40
@ccf-lisa
ccf-lisa Bot force-pushed the agent-config/16-policy-data-tree branch from 7af204d to 75cd86e Compare October 6, 2026 11:38
ianmiell
ianmiell previously approved these changes Oct 6, 2026

@ianmiell ianmiell 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.

ccf-review: APPROVE

no findings.

Stack (gh stack 343): #322 → #323 → #324 → #325 → #326 → #327 → #328 → #329 → #330 → #331 → #332 → #333 → #334 → #335 → #336 → #337 → #338 → #339 → #340 → #341 → #342

gusfcarvalho and others added 4 commits October 6, 2026 12:14
Layer 16 of 21 in the stacked split of #318.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e as typed

JSON.parse reads 1e999 as Infinity, which would be saved as null (an RFC
7396 delete of the key), and rounds integers past 2^53; the raw view now
shows an error instead of applying them, like the structured add form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A policy_data list is written whole (RFC 7396), so an edit gives every
instance the same list. Like the other editors (FieldHints), an
editable list whose value differs between the instances' files now says
"differs across instances" (useEditor().differsAcrossInstances, through
the tree context).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "differs across instances" span sat between the container branch
and its v-else-if chain, starting a new chain: every container node
that did not differ also rendered the empty scalar value span. The
container branch is now one template holding the summary and the hint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gusfcarvalho
gusfcarvalho force-pushed the agent-config/16-policy-data-tree branch from 02be378 to 4cc87d3 Compare October 6, 2026 15:14
@gusfcarvalho
gusfcarvalho merged commit e3b6803 into main Oct 6, 2026
4 checks passed
@gusfcarvalho
gusfcarvalho deleted the agent-config/16-policy-data-tree branch October 6, 2026 16:57
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.

3 participants