Skip to content

Name a parent that is not a directory in project new (feature 003-parent-obstacle-wording) - #17

Merged
brettheap merged 5 commits into
mainfrom
003-parent-obstacle-wording
Oct 9, 2026
Merged

brettheap merged 5 commits into
mainfrom
003-parent-obstacle-wording

Conversation

@brettheap

@brettheap brettheap commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openRepoProject-1

Closes #14

Realizes the ratified OpenSpec change fix-parent-obstacle-wording (PR #15, landed as 26a5668 on Brett Heap's word "ratify 15", 2026-10-09) as Speckit feature 003-parent-obstacle-wording.

What changes

  • project, known_obstacles(): the parent fact is parent.is_dir() and, only when that is false, parent.exists() on the same resolved parent. A parent that exists but is not a directory is named with the sentence fixed in design.md D2: The parent PARENT exists but is not a directory; choose a parent that is a directory. The missing-parent sentence is unchanged byte for byte and the composed refusal keeps its shape (D1, D2). Nothing else in project changes.
  • tests/test_project.py, per design.md D3: the fixture OBSTACLE_PARENT_NOT_A_DIRECTORY after the D13 block; four obstacle rows (file, link to the file, dangling link, all three with the file) with a nothing-created snapshot; a second routes table (--into, positional parent, PROJECTS_DIR, default ~/projects) with the regular file; dry-run rows; a single-repository pty test against the --type test baseline; a symlink-to-directory test. No existing assertion or row tuple is edited (one brace line changes).
  • README.md line 60: the D2 sentence.
  • Speckit feature files under specs/003-parent-obstacle-wording/ (spec, checklist, plan, research, quickstart, tasks, traceability) and the change's tasks.md governance record (1.6 ratification, 2.1 feature, Speckit Handoff).

Not changed (design.md D6)

The shape branch refusal; the bench path's late [Errno 17] refusal and the dry-run exit 0; the FILE/sub and later-Python residuals; the CI matrix.

Verification (implementer, decisive checks re-run by the lead on f492558)

Check Result
Suite in py-bench, Python 3.12.3 96 tests OK (94 existing plus 2 new methods)
New cases against unchanged code (project and README stashed) 13 fail, all expecting the new sentence; dangling-link rows and the symlink-to-directory test pass as unchanged behaviour
Python 3.10.18 (host, uv) the same 11 PyYAML-related failures as at 26a5668; every new or extended test passes
Added lines ASCII 0 non-ASCII
Fixed text versus design.md lines 110, 111, 127, 135 identical
Removed test lines 1 (the "all three" brace line; its tuple unchanged)
ast: other top-level functions and imports of project identical to main
/usr/bin/openspec validate --all --strict 6 of 6; the change valid under --strict
Quickstart walk at a pty in py-bench (T018) 87 checks, 0 divergences
CI (ubuntu and macos, Python 3.10 and 3.12) green on 90a4cee, 393bfe4, f492558

Analyze gate: PASS WITH FIXES (0 critical, 0 high); the fixes landed as b0f70a3.

Landing

Draft until the independent re-verification is posted here. Lands by squash only on Brett Heap's word "ratify " for this PR. If PR #11 lands first, main is merged in (no rebase, no force push). After landing: one comment on workBenches#145 (design.md D5), then the archive change on Brett's word.

🤖 Generated with Claude Code

Summary by Sourcery

Name existing non-directory parents accurately in project-new obstacle messages while preserving missing-parent behavior and all unrelated flows.

New Features:

  • Report parent paths that exist but are not directories with a dedicated, actionable obstacle message while preserving the existing message for missing parents.
  • Cover non-directory parents across supported input routes, refusal and dry-run behavior, symlink cases, and unaffected single-repository flows.

Bug Fixes:

  • Correct project-new obstacle detection so existing files and other non-directory parents are not described as missing.

Enhancements:

  • Update the README to explain that existing non-directory parents block both project creation modes.
  • Add the feature specification, implementation plan, research, quickstart, task checklist, and scenario traceability records for the ratified wording change.

Documentation:

  • Clarify the documented handling of missing parents and parents that exist but are not directories.

Tests:

  • Expand project-new tests to verify exact obstacle wording, refusal safety, route coverage, dry runs, symlink behavior, and unchanged single-repository behavior.

Chores:

  • Record ratification and the Speckit handoff for the implemented feature.

brettheap and others added 4 commits October 9, 2026 03:19
Lane: openRepoProject-1

Creates the single Speckit feature that realizes OpenSpec change
fix-parent-obstacle-wording (ratified by Brett Heap, "ratify 15",
2026-10-09; PR #15 landed as 26a5668), records the ratification and the
Speckit handoff in the change's tasks.md, and adds the spec quality
checklist.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-1

Restates the ratified design (fix-parent-obstacle-wording D1 to D6) as the
implementation plan and derives the dependency-ordered task list; no code
changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lane: openRepoProject-1

M1: the quickstart fixture now creates PROJECTS_DIR; L1, L2, L4: counts
pinned at 26a5668, the two scenarios covered by existing tests named in
T002, and T015(a) phrased as the filtered diff.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ctory

Lane: openRepoProject-1

known_obstacles() reads parent.is_dir() and, only when that is false,
parent.exists() on the same resolved parent, and names a parent that
exists but is not a directory with the sentence fixed in design.md D2;
the missing-parent sentence is unchanged. Tests per design.md D3 (new
fixture, four obstacle rows with a nothing-created snapshot, the routes
table, dry-run rows, a single-repository test against the --type test
baseline, a symlink-to-directory test); README sentence per D2;
traceability for the eight delta scenarios. Feature
003-parent-obstacle-wording, governing issue #14.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@sourcery-ai

sourcery-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR realizes the ratified parent-obstacle wording change by classifying an existing non-directory parent separately from a missing parent, updating the README, adding broad regression coverage, and documenting the feature through Speckit/OpenSpec artifacts; unrelated behavior and the CI matrix remain unchanged.

Sequence diagram for project parent obstacle handling

sequenceDiagram
    participant User
    participant project
    participant Parent

    User->>project: project command with parent
    project->>Parent: is_dir()
    alt parent is a directory
        Parent-->>project: true
        project-->>User: Continue project flow
    else parent is not a directory
        Parent-->>project: false
        project->>Parent: exists()
        alt parent exists
            Parent-->>project: true
            project-->>User: Refuse with non-directory parent sentence
        else parent is missing
            Parent-->>project: false
            project-->>User: Refuse with missing-parent sentence
        end
    end
Loading

Flow diagram for parent obstacle classification

flowchart TD
    A[project receives parent] --> B{"parent.is_dir()"}
    B -->|yes| C[Continue project flow]
    B -->|no| D{"parent.exists()"}
    D -->|yes| E[Refuse: parent exists but is not a directory]
    D -->|no| F[Refuse: parent does not exist]
Loading

File-Level Changes

Change Details Files
Distinguish existing non-directory parents from missing parents while preserving the existing obstacle computation and refusal flow.
  • Keep the parent obstacle based on is_dir() and use exists() on the same resolved path only to select the missing or non-directory message.
  • Add the fixed D2 wording while leaving obstacle ordering, composed refusal shape, and all unrelated project behavior unchanged.
project
Expand coverage for non-directory parent behavior across routes, obstacle combinations, dry runs, and unaffected paths.
  • Pin the new sentence and add regular-file, file-link, dangling-link, and symlink-to-directory fixtures.
  • Verify resolved-path wording, no creation, unchanged file contents, refusal consistency, and single-repository baseline behavior.
  • Cover --into, positional, PROJECTS_DIR, default parent, dry-run, in-process, and PTY flows without changing existing row tuples or assertions.
tests/test_project.py
Update user-facing documentation to describe both missing and non-directory parent cases.
  • Replace the README's missing-parent-only wording with guidance that missing parents may be created but existing non-directories block both answers.
README.md
Add the Speckit feature and governance records documenting the ratified implementation and verification plan.
  • Add specification, checklist, plan, research, quickstart, tasks, and traceability artifacts for feature 003-parent-obstacle-wording.
  • Record ratification, feature handoff, scenario coverage, implementation tasks, and strict OpenSpec validation expectations.
specs/003-parent-obstacle-wording/checklists/requirements.md
specs/003-parent-obstacle-wording/spec.md
specs/003-parent-obstacle-wording/plan.md
specs/003-parent-obstacle-wording/research.md
specs/003-parent-obstacle-wording/quickstart.md
specs/003-parent-obstacle-wording/tasks.md
specs/003-parent-obstacle-wording/traceability.md
Complete the ratified change's implementation and handoff record.
  • Mark ratification and Speckit handoff details complete while leaving the remaining landing/archive governance steps pending.
openspec/changes/fix-parent-obstacle-wording/tasks.md

Assessment against linked issues

Issue Objective Addressed Explanation
#14 Ensure project new distinguishes a parent that exists but is not a directory from a missing parent, while continuing to use is_dir() for the obstacle check and preserving symlink-to-directory behavior. ✅
#14 Use the corrected parent-obstacle wording consistently in the Triad question and composed refusal, and update README documentation to explain that an existing non-directory parent blocks both creation paths. ✅
#14 Add or update the project specification and automated coverage for non-directory parents, including files, symlinks, all parent-selection routes, dry runs, refusal/no-creation behavior, and unchanged missing-parent and symlink-to-directory behavior. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T08:09:20.909795Z f492558 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f492558121

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


**Purpose**: The baseline and the traceability record

- [ ] T001 Confirm the baseline in this worktree: the suite in py-bench reports `Ran 94 tests` and `OK`, and `git diff --quiet 26a5668 -- project tests/test_project.py README.md` exits 0 (project, tests/test_project.py and README.md are main's)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark the verified feature tasks complete

All T001–T018 entries remain unchecked even though this commit includes their implementation artifacts and records the lane lead's verification in the commit message. Because this checklist explicitly says the lane lead ticks each box after verification, leaving every item open falsely reports that no setup, implementation, or validation work was completed and makes later landing/archive work unable to distinguish finished tasks from outstanding ones.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lane: openRepoProject-1
Ticked at 0764624: T001 to T018 are now checked on the evidence of the implementer's run, the lead's re-run and the independent re-verification (#17 (comment)); the same commit fixes the Phase 2 checkpoint's fail-first list and ticks OpenSpec box 2.2.

@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-1
Independent re-verification by Claude Opus 5.5 (claude-opus-5-5) of head f492558

Verdict: READY WITH FIXES. The code and tests need no change. The record needs two fixes before its boxes are ticked.

Findings

  1. LOW, specs/003-parent-obstacle-wording/tasks.md:78 (the Phase 2 checkpoint, which T012 at :98 checks against). It says that with project unchanged "T007 and T008 pass", and it names 12 failing cases. T007's test fails there too, because tests/test_project.py:1538 asserts that the asked run's question carries the new line. The fail-first run therefore has 13 failures, as the PR body says, not the checkpoint's 12. T012 ("the failures are exactly those named at the Phase 2 checkpoint") cannot be ticked truthfully as written. Fix: in :78, add "and T007's test, whose asked run asserts the new line in the question (tests/test_project.py:1538)" to the failing list. Then change "Every existing case, the dangling-link rows, T007 and T008 pass" to "Every existing case, the dangling-link rows and T008 pass".
  2. LOW, openspec/changes/fix-parent-obstacle-wording/tasks.md:21. Box 2.2 is unticked, but its condition is met: the Speckit Handoff named 003-parent-obstacle-wording at 90a4cee, before the first implementation commit f492558. The precedent is PR Offer the Triad first in project new (feature 002-triad-first-project-new) #8 (d7f6b0e), which ticked the same box in its realization. Fix: tick 2.2 in the commit that ticks T001 to T018 and append "Met: the handoff named feature 003-parent-obstacle-wording at 90a4cee before the first implementation commit f492558."
  3. INFO, specs/003-parent-obstacle-wording/tasks.md:147 and :171. The tests, the implementation and the traceability record landed in one commit (f492558), not one commit per phase, so the history does not show "seen to fail before T009 is written". No fix is possible without rewriting history. The fail-first property was reproduced independently (below).

Codex's P2 on tasks.md:62 (T001 to T018 unticked) is the lead's planned step after this report, not a defect.

Evidence (py-bench, Python 3.12.3, unless named)

  • Diff scope, origin/main (26a5668) to f492558: 11 files. They are exactly project, tests/test_project.py, README.md, the change's tasks.md and 7 files under specs/003-parent-obstacle-wording/.
  • project: the diff is D1 plus D2 only. An ast comparison of all 65 top-level nodes shows that only known_obstacles differs; the imports, new() and main() are identical. The docstring says "three local facts". The output of known_obstacles() equals design.md lines 110 and 111 byte for byte, and the composed refusal equals line 127.
  • Suite: 96 OK. Fail-first (git checkout origin/main -- project README.md): 13 failures. Each is an AssertionError where the old "parent directory ... does not exist" line meets the expected new sentence: 3 triad pty rows, 3 in-process rows, 4 routes, 2 dry-run rows and T007's test at :1538. After the restore: 96 OK.
  • Python 3.10.18 (host, uv): 11 failures, the same list at 26a5668 and at f492558 (the host has no PyYAML). None of them is a new or extended test.
  • Tests: one removed line, the "all three" row, whose tuple is unchanged (only } became ,). The D13 block is identical to main, and the new fixture equals design line 111. Every D3 item is present and asserts what D3 says:
    • the snapshot is taken after the environment is set up and before the run;
    • the routes expect paths under the resolved self.base;
    • the link rows are checked through parent.resolve();
    • the single-repository test compares the exit status, stdout from Create: on and the one REFUSED: line, and finds no warning:.
      No construct newer than Python 3.10 is used.
  • 14 pty runs of project new:
    • file, link to a file, FIFO, FILE/, positional parent, PROJECTS_DIR and the default ~/projects: the new sentence names the resolved file and the refusal repeats it. Exit 2, openRepoShape never ran, nothing was created.
    • dangling link: the missing sentence, naming the link's target.
    • link to a directory: no obstacle, and the run reaches the organization prompt.
    • missing parent: the unchanged sentence.
    • my-app with no openRepoShape: the name, openRepoShape and parent lines in that order, for both parent kinds.
    • dry run with a link to a file: the same refusal, exit 2.
  • D6, observed unchanged in 5 more pty runs:
    • with a file parent, the asked run and the --type test run both end REFUSED: [Errno 17] File exists with exit 2, and the --dry-run exits 0;
    • --shape refuses with "Shape creation requires an existing --into parent directory.";
    • FILE/sub prints the missing sentence, and its single-repository path ends [Errno 20] Not a directory.
  • README: design line 135 appears exactly once. With the old clause put back, the old and new paragraphs match word for word.
  • Feature record:
    • spec.md carries the D4 supersession and keeps the title "The parent directory is missing";
    • traceability.md has 8 rows, and all 10 tests it names are defined;
    • T001 to T018 are unticked;
    • the change's 1.6 and 2.1 are ticked with the quote and the feature, and the Speckit Handoff names specs/003-parent-obstacle-wording/tasks.md;
    • the lane line comes first in all 7 feature files;
    • added lines are ASCII, and the only host path is /usr/bin/openspec.
  • openspec: /usr/bin/openspec 1.6.0 validate --all --strict reports 6 passed and 0 failed, and the change is valid under --strict. The py-bench openspec 1.13.1 also reports 6 of 6.
  • CI on f492558: all 4 test jobs are green in both the push run and the pull_request run, 96 tests each (macOS skips the pre-existing /dev/full test). SonarCloud passed. 90a4cee and 393bfe4 are green, as the PR body claims.
  • PR body: every claim checked is true. The quickstart walk's count of 87 was not re-counted; my 19 pty runs found no divergence from the quickstart or the delta.

…t; tick OpenSpec 2.2

Lane: openRepoProject-1

The checkpoint now names all 13 fail-first cases (T007's question-line
check included), per the independent re-verification of PR #17 at
f492558; box 2.2 records that the handoff named the feature before the
first implementation commit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@brettheap
brettheap marked this pull request as ready for review October 9, 2026 08:18
@sourcery-ai

sourcery-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 14 hours and 41 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

brettheap added a commit that referenced this pull request Oct 9, 2026
…ne 1's PR #17)

Lane: openRepoProject-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-2

Numbering note for lane openRepoProject-1: this PR's feature 003-parent-obstacle-wording takes the number both of lane 2's OpenSpec changes had reserved in their Speckit Handoff sections. Lane 2 is renumbering now: add-project-clean-all-safe (PR #11) becomes feature 004-project-clean-all-safe and add-project-overview (PR #12) becomes 005-project-overview, both created by /speckit.specify after Brett Heap's ratification. Please take 006 onward for any further feature. No action needed on this PR.

brettheap added a commit that referenced this pull request Oct 9, 2026
… PR #17, 004 is change 1's)

003-parent-obstacle-wording is lane openRepoProject-1's Speckit feature
(PR #17), so change 1 add-project-clean-all-safe becomes
004-project-clean-all-safe and this change becomes 005-project-overview,
after 002-triad-first-project-new. The Speckit handoff section of tasks.md
gains a numbering sentence; the bare feature-number references in
proposal.md, design.md and tasks.md shift with the identifiers.

Lane: openRepoProject-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Oct 9, 2026
…nly)

Lane 1's PR #17 took Speckit feature number 003, so add-project-clean-all-safe
renumbered its handoff to feature 004 (PR #11 head cab78d8) and
add-project-overview to feature 005 (PR #12 head 704eaa9); no content changed,
and the packet keeps 8973762 and 4495ae7 as the content shas it was read
against. The packet's three "feature 004" references were the overview's fixtures
and now read feature 005.

Design record only; packet validator passes.

Lane: openRepoProject-3
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@brettheap
brettheap merged commit f401e06 into main Oct 9, 2026
10 checks passed
@brettheap
brettheap deleted the 003-parent-obstacle-wording branch October 9, 2026 13:54
@brettheap

Copy link
Copy Markdown
Contributor Author

Lane: openRepoProject-1
Ratified by Brett Heap's word "ratify 17" (2026-10-09), given for this PR at head 0764624 (independent re-verification READY WITH FIXES at #17 (comment), the fixes landed as 0764624; CI green). Landed by squash as f401e06; issue #14 closed by the merge. (This quote was meant to precede the merge; the first attempt to post it failed silently.)

brettheap added a commit that referenced this pull request Oct 9, 2026
* Archive fix-parent-obstacle-wording after PR #17 landed

Lane: openRepoProject-1

Moves the ratified change (Brett Heap, "ratify 15", 2026-10-09; packet PR
#15 at 26a5668) to the archive and merges its one MODIFIED requirement into
openspec/specs/project-command/spec.md. The realization is PR #17 (feature
003-parent-obstacle-wording), landed as f401e06;
issue #14 closed; the D5 comment is on workBenches#145.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Name the skipped check in the archived tasks.md 3.1

Lane: openRepoProject-1

Per the independent re-verification of PR #18 (note N1): the rollup
wording now names the skipped Sourcery review, as the precedent did.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenSpec: fix-parent-obstacle-wording (the parent obstacle says 'does not exist' while the check is 'is not a directory')

1 participant