Skip to content

Bug: SPECS_DIR key in setup-plan.sh JSON output contains FEATURE_DIR value #4017

Description

@pierluigilenoci

Summary

The JSON output of scripts/bash/setup-plan.sh exposes a key named SPECS_DIR but populates it with the $FEATURE_DIR value (the per-feature subdirectory, e.g. specs/001-my-feature) rather than the actual specs root directory (specs/).

Affected file

scripts/bash/setup-plan.sh

Bug locations

Line ~71 (jq path):

# Current (wrong):
--arg specs_dir "$FEATURE_DIR"

# Should be:
--arg feature_dir "$FEATURE_DIR"

Line ~73 (jq JSON key):

# Current (wrong):
'{FEATURE_SPEC:$feature_spec,IMPL_PLAN:$impl_plan,SPECS_DIR:$specs_dir,BRANCH:$branch}'

# Should be:
'{FEATURE_SPEC:$feature_spec,IMPL_PLAN:$impl_plan,FEATURE_DIR:$feature_dir,BRANCH:$branch}'

Line ~75 (printf fallback):

# Current (wrong):
printf '{"FEATURE_SPEC":"%s","IMPL_PLAN":"%s","SPECS_DIR":"%s","BRANCH":"%s"}\n'

# Should be:
printf '{"FEATURE_SPEC":"%s","IMPL_PLAN":"%s","FEATURE_DIR":"%s","BRANCH":"%s"}\n'

Line ~81 (text-mode output):

# Current (wrong):
echo "SPECS_DIR: $FEATURE_DIR"

# Should be:
echo "FEATURE_DIR: $FEATURE_DIR"

Impact

Consumers of the JSON output who treat SPECS_DIR as the specs root directory will receive the wrong path instead of the feature subdirectory.

Fix

Rename the key from SPECS_DIR to FEATURE_DIR in all 4 locations listed above.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions