Skip to content

Concurrent config/schema edits conflict (no merge driver) and pm validate reports ok:true by silently falling back to defaults — settings/schema silently lost #609

Closed

Description

@unbraind

Summary

The workspace's shared JSON config/schema files — .agents/pm/settings.json and .agents/pm/schema/{types,statuses,fields,workflows}.json — are single git-tracked files with no merge driver. Two agents changing different config keys, or adding different custom types, both rewrite the same file → git conflict → invalid JSON with conflict markers. The failure is then masked: pm validate reports ok:true by silently falling back to defaults, so the merge gate is green while governance settings / custom schema silently revert or are lost entirely.

Distinct from #607 (item .toon files) — this is the config/schema layer.

Verified repro A — settings.json (pm 2026.7.18)

git checkout -b cfgA
pm config project set governance-metadata-validation-profile strict   --json >/dev/null
git add -A && git commit -m "A: profile strict"
git checkout -b cfgB main
pm config project set governance-require-close-reason disabled         --json >/dev/null
git add -A && git commit -m "B: close-reason disabled"
git checkout cfgA && git merge --no-edit cfgB          # CONFLICT in .agents/pm/settings.json (invalid JSON)
pm validate --json            # ok: true   (stderr: settings_read_invalid_json → fell back to defaults)
pm validate --strict-exit --json; echo $?   # rc=1   (this DOES catch it)
pm health --json              # ok: false  (also catches it)

Observed: default pm validate is blind (ok:true, silently using defaults — both agents' governance changes gone). --strict-exit returns rc=1 and pm health returns ok:false, so the corruption is detectable — but only if you know to use those, not via the obvious pm validate.

Verified repro B — schema add-type (data loss, no strict flag needed)

git checkout -b schA
pm schema add-type FeatureRequest --description A --folder featreqs --json >/dev/null
git add -A && git commit -m "A: add type"
git checkout -b schB main
pm schema add-type Hotfix --description B --folder hotfixes --json >/dev/null
git add -A && git commit -m "B: add type"
git checkout schA && git merge --no-edit schB          # CONFLICT in schema/types.json
pm validate --json      # ok: true
pm schema list --json   # neither FeatureRequest nor Hotfix present — BOTH custom types silently lost

Impact

Concurrent governance/schema evolution across branches is impossible without silent data loss, and the default integrity gate (pm validate) reports green on the corrupted result.

Suggested fixes

  1. Generate .gitattributes entries + a JSON deep-merge driver for settings.json/schema/*.json (these are additive maps — key-level 3-way merge is well-defined and conflict-free for disjoint keys).
  2. Make default pm validate fail (or at least warn loudly) when a config/schema file is present but unparseable, instead of silently substituting defaults and reporting ok:true. Falling back to defaults on invalid JSON is exactly the case a validator must surface.

Filed from a multi-agent merge stress test; reproduced independently on 2026.7.18.

Activity

  1. added
    bugSomething isn't working
    agent-experienceImproves the AI agent / MCP / CLI ergonomics and token efficiency
    on Jul 18, 2026
  2. coderabbitai commented on Jul 18, 2026

    @coderabbitai
    🔗 Related PRs

    #41 - perf: drop zod from settings hot path (~38% faster) + unblock auto daily release [closed]
    #106 - Complete schema customization: remove-type, add-status, per-type workflows, config create_default_type [closed]
    #200 - Add validation self-repair and agent ergonomics primitives [closed]
    #425 - Strengthen SDK linked-test imports and mandatory quality gates [merged]
    #520 - Harden SDK workspace customization and schema boundaries [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  3. unbraind commented on Jul 19, 2026

    @unbraind
    OwnerAuthor

    pm tracker item: pm-xdn6

  4. unbraind commented on Jul 19, 2026

    @unbraind
    OwnerAuthor

    Fixed via PR#614 (SDK-first field-aware merge safety and storage integrity, merged 2026-07-19). Tracker item pm-xdn6 closed with resolution + packed Git acceptance evidence.

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-experienceImproves the AI agent / MCP / CLI ergonomics and token efficiencybugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions