Skip to content

feat: typed property values via --type flag for set command #226

@flyingrobots

Description

@flyingrobots

Context

git mind set currently treats all <value> arguments as strings (documented in GUIDE.md as of #222). The idempotency check uses strict equality (===), which works for strings but would always report changed: true for objects/arrays. This is fine for the current CLI use case (status values like done, in-progress) but limits programmatic use.

Proposal

Add an optional --type flag to git mind set:

git mind set task:a priority 3 --type number
git mind set task:a archived true --type bool
git mind set task:a metadata '{"key":"val"}' --type json

Types:

  • string (default, current behavior)
  • numberparseFloat(value), error on NaN
  • booltrue/false only
  • jsonJSON.parse(value), error on invalid JSON

The idempotency check in setNodeProperty would need a deep-equality path for structured values (e.g. util.isDeepStrictEqual).

Acceptance Criteria

  • --type number|bool|json flag parsed and validated
  • setNodeProperty uses deep equality when value is non-primitive
  • set.schema.json updated to allow non-string value field
  • Tests cover each type + error cases
  • Backward compatible — omitting --type preserves string behavior

Originated from PR #223 agent reflection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions