Skip to content

caseworkctl source add should support non-empty flow-style accessProfiles #1026

Description

@jeremi

Problem

caseworkctl source add now accepts the shipped empty flow form accessProfiles: [] and preserves a trailing comment when converting it to the block form needed for the generated reader profile. It still refuses a valid non-empty flow-style sequence such as accessProfiles: [{id: reader, ...}] because safely editing arbitrary flow YAML while preserving authored text and comments is a broader patching problem.

This is presentation-dependent behavior for valid BReg YAML, but it does not block the shipped starters or the tutorial added by #1016.

Acceptance criteria

  • caseworkctl source add can add the generated reader profile when accessProfiles is a valid non-empty flow-style YAML sequence.
  • Both one-line and multiline flow sequences accepted by the BReg parser are covered.
  • Existing profiles, comments, and unrelated authored text are preserved, or the command clearly previews an intentional localized normalization before apply.
  • The rendered candidate round-trips to exactly the expected parsed BReg project.
  • Conflicting existing casework-reader profiles remain fail-closed.

Relationship

Follow-up to #1016. The common empty flow form is already handled there.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyReady for an implementation agent.area:caseworkRegistry Casework runtime, tooling, and clientscriticality:p3Priority/criticality P3.enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions