Skip to content

SW-216 — Reject duplicate keys in stellarforge.config.json #398

Open

Description

@dDevAhmed

Summary

JSON.parse silently accepts duplicate object keys and keeps the last value. A project config containing duplicate network, identity, or version keys can therefore be interpreted ambiguously by tools that use different parsing rules. Reject duplicate keys before validating the configuration object.

Workstream

  • Workstream: WS-CONFIG
  • Primary scope: src/config/project.ts; src/config/schema.ts; tests/config-malformed-json.test.ts
  • Protected surface: Yes — maintainer review required
  • Priority: P1
  • Difficulty: high
  • Proposed points: 200

Acceptance Criteria

  • Duplicate keys at the top level are detected and rejected.
  • Duplicate keys nested in unsupported values are rejected consistently or explicitly documented as out of scope.
  • No network or identity value is selected from an ambiguous document.
  • Error output identifies the duplicate key without echoing its value.
  • Existing valid config files remain compatible.

Dependencies

None.

Out of Scope

  • Unrelated architecture or public command-contract changes.
  • New runtime dependencies without maintainer approval.
  • Mainnet deployment or remote template execution.

Definition of Done

  • Acceptance criteria have deterministic regression coverage.
  • Security and compatibility boundaries remain intact.
  • Supported-platform CI passes.

Labels

  • Stellar Wave (do not apply until activation is explicitly authorized)
  • type: security
  • area: config
  • priority: P1
  • difficulty: high
  • points: 200
  • workstream: config

Sequencing and scope note

Related existing scope: #340 covers static config-file permissions and symlink policy; this issue is specifically duplicate JSON property detection.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions