uttrflow / uttrflow/uttrflow-swift

Just completions read Makefile targets and ignore the project justfile

Open
#794 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
4
Forks
17
Avg merge
3h 32m
Merged PRs (30d)
277

Description

## Problem

On main `8d93f5b8574f3c7b8c30086d9c817bf7f5d4827d`, the environment reader dispatches both `make` and `just` to the Makefile parser. A project with only a justfile supplies no recipes; a project with both files supplies Makefile targets as `just` recipes. This creates incorrect environment-sourced terminal suggestions and omits the actual recipes.

[Reader dispatch and Makefile names](https://github.com/uttrflow/uttrflow-swift/blob/8d93f5b8574f3c7b8c30086d9c817bf7f5d4827d/Sources/UttrflowPredict/EnvironmentReading+System.swift#L122-L131).

The [just manual](https://just.systems/man/en/quick-start.html) specifies justfiles as the recipe source; its [listing interface](https://just.systems/man/en/listing-available-recipes.html) exposes recipe names.

## Reproduction

An isolated Swift test links the unchanged production Predict module and creates a temporary directory:

1. Write `justfile` containing a `verify-just` recipe with an echo command.
2. Call `SystemEnvironmentReader.values(of: .subcommand(of: "just"), in: directory)`.
3. Add `Makefile` containing a `verify-make` target with an echo command and call again.
4. Construct an `EnvironmentIndex(reader: reader)` and `EnvironmentSource(index: index)`. Request candidates for a terminal surface scoped to this directory, matching `just ver`; await `index.settle()` and request again.

Observed:

```text
Only justfile: nil
Both files: ["verify-make"]
Environment candidates: ["just verify-make"]
```

Expected: the `verify-just` recipe is available and `verify-make` is not supplied as a just recipe. Four expected-behavior assertions fail. The three existing `ProgramVerbsTests` pass, but test parsers independently of this dispatch.

This probe executes no recipes, downloads no tools or models, and does not claim an end-to-end UI acceptance result.

## Suggested fix and acceptance

Give `just` its own recipe discovery path, respecting its file discovery and recipe syntax. If using a command listing, bound and cancel the subprocess correctly (the existing timeout defect is #663).

Add reader-level regression coverage for a justfile-only project and a mixed Makefile/justfile project. Verify the real environment candidate path offers only the correct program's targets. Keep Makefile completion working.

## Related work

#751 asks for testable reader dispatch rules; this is a concrete behavior defect in that dispatch. #764 and PR #768 concern terminal validation, but do not correct this recipe source. Checked open and closed issues and the current open PRs before filing.

Contributor guide

Open the contributing guide

Research direction

Start in Sources/UttrflowPredict/EnvironmentReading+System.swift at the reader dispatch and Makefile names linked in the issue, then inspect the existing recipe parsers and ProgramVerbsTests. Reproduce the justfile-only and mixed-file cases through SystemEnvironmentReader and EnvironmentSource. Done means reader-level regressions cover both cases, only the correct recipes appear in environment candidates, and Makefile completion still passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
cli, developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.