Skip to content

Commit 2d351e3

Browse files
authored
Merge branch 'main' into issue_360-iv_summary_method
2 parents b43c63f + deb8774 commit 2d351e3

66 files changed

Lines changed: 6104 additions & 583 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/skills/github-issues/reference/issue-evaluation.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,26 @@ description: Analyze an issue, check current relevance, and propose next steps o
1010
gh issue view <issue_number> --json number,title,body,state,labels,comments,assignees
1111
```
1212

13+
## Check for sub-issues (native hierarchy)
14+
15+
Always check whether an issue has native sub-issues. The `trackedIssues` / `trackedInIssues` GraphQL fields only cover older markdown task-list tracking and will miss native sub-issues.
16+
17+
```bash
18+
gh api graphql -f query='query {
19+
repository(owner:"<owner>", name:"<repo>") {
20+
issue(number: <issue_number>) {
21+
subIssues(first: 50) { nodes { number title state url } }
22+
parent { number title state url }
23+
}
24+
}
25+
}'
26+
```
27+
1328
## Analyze context
1429
- Extract the problem statement and acceptance criteria
1530
- Summarize discussion history and blockers
1631
- Identify affected files/modules
32+
- Review sub-issues (if any) for work breakdown and progress
1733

1834
## Assess relevance
1935
- Search codebase for mentioned APIs or modules

.github/skills/github-issues/reference/parent-child-issues.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,24 @@ gh api graphql \
9191
-f sub='<CHILD_NODE_ID>'
9292
```
9393

94-
## 6) Verify links rendered correctly
94+
## 6) Discover existing sub-issues
95+
96+
When evaluating an issue that may already have sub-issues, always use the `subIssues` GraphQL field. Do **not** use `trackedIssues` / `trackedInIssues` -- those only cover older markdown task-list tracking and will miss native sub-issues.
97+
98+
```bash
99+
gh api graphql -f query='query {
100+
repository(owner:"<owner>", name:"<repo>") {
101+
issue(number: <issue_number>) {
102+
subIssues(first: 50) {
103+
nodes { number title state url }
104+
}
105+
parent { number title state url }
106+
}
107+
}
108+
}'
109+
```
110+
111+
## 7) Verify links rendered correctly
95112

96113
```bash
97114
gh api graphql -f query='query {

.github/skills/python-environment/SKILL.md

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
11
---
22
name: python-environment
3-
description: Detect and configure a conda-compatible tool, create the CausalPy environment, and run commands inside it. Use before any task that requires Python execution.
3+
description: Detect, configure, and use a conda-compatible tool. Use before tasks that need the project environment, such as importing project code, running tests, building docs, or invoking repo tooling.
44
---
55

66
# Python Environment
77

88
Set up and run commands inside the CausalPy conda environment.
99

10+
## Decide whether the env is required
11+
12+
Use the `CausalPy` env when the command:
13+
14+
- imports project code (for example `import causalpy` or project modules)
15+
- runs tests
16+
- builds docs
17+
- invokes repo tooling such as `make`, `prek`, or notebook execution
18+
19+
For simple inspection helpers that only read local text/JSON or use the Python standard library, any Python on `PATH` is acceptable.
20+
21+
## Reuse before creating
22+
23+
Do the least work that will get the task done:
24+
25+
1. Reuse an existing `CausalPy` env if one is already available.
26+
2. If `run -n CausalPy` cannot resolve the env, check whether it exists under a different prefix and use `run -p`.
27+
3. Only create the env if no suitable existing env is available.
28+
4. Only update the env or rerun `make setup` when dependencies changed, the editable install is stale, or the current checkout has not been installed into that env yet.
29+
1030
## Detect the conda tool
1131

1232
Use whichever of `mamba`, `micromamba`, or `conda` is available (checked in that order):
@@ -24,21 +44,25 @@ If `CONDA_EXE` is empty, no conda-compatible tool was found. Propose installing
2444

2545
After installation, set `CONDA_EXE=micromamba`.
2646

27-
## Create the environment
47+
## Create the environment only if needed
48+
49+
If no suitable existing env can be reused, create it:
2850

2951
```bash
3052
$CONDA_EXE env create -f environment.yml
3153
```
3254

33-
## Install the package (required after creating or updating the environment)
55+
## Install the package only when needed
56+
57+
Run `make setup` after creating or updating the env. Also rerun it when using a different git worktree if that env has not been installed against the current checkout yet.
3458

3559
```bash
3660
$CONDA_EXE run -n CausalPy make setup
3761
```
3862

3963
## Run commands
4064

41-
Always use `run -n` instead of `activate`:
65+
Never use `$CONDA_EXE activate`, instead use `$CONDA_EXE run -n CausalPy <command>`.
4266

4367
```bash
4468
$CONDA_EXE run -n CausalPy <command>
@@ -54,6 +78,25 @@ $CONDA_EXE env update --file environment.yml --prune
5478

5579
## Troubleshooting
5680

81+
### Named env cannot be resolved
82+
83+
If `$CONDA_EXE run -n CausalPy ...` fails with errors such as `The given prefix does not exist`:
84+
85+
```bash
86+
$CONDA_EXE env list
87+
$CONDA_EXE run -p "/full/path/to/CausalPy" <command>
88+
```
89+
90+
Keep using `run -p` with that full prefix for the rest of the session.
91+
92+
### Git worktrees and remote machines
93+
94+
Git worktrees do not require a fresh env per agent session. Prefer reusing an existing env to save time. The main caveat is that this repo uses editable installs, so one shared env can point at whichever checkout most recently ran `make setup`.
95+
96+
- For ordinary local work on one checkout, reuse the existing env.
97+
- For long-lived parallel worktrees, one env per worktree is the safest option, but do not create one unless needed.
98+
- On a fresh remote machine or ephemeral container, create the env once. On a persistent remote machine with an existing env, reuse it.
99+
57100
If you hit issues with an outdated tool, update it:
58101

59102
- **mamba / micromamba**: `$CONDA_EXE self-update`

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
python-version: "3.12"
2727
- name: Run prek on changed files in PRs
2828
if: github.event_name == 'pull_request'
29-
uses: j178/prek-action@53276d8b0d10f8b6672aa85b4588c6921d0370cc # v2.0.1
29+
uses: j178/prek-action@cbc2f23eb5539cf20d82d1aabd0d0ecbcc56f4e3 # v2.0.2
3030
with:
3131
extra-args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
3232
- name: Run prek on all files on pushes
3333
if: github.event_name != 'pull_request'
34-
uses: j178/prek-action@53276d8b0d10f8b6672aa85b4588c6921d0370cc # v2.0.1
34+
uses: j178/prek-action@cbc2f23eb5539cf20d82d1aabd0d0ecbcc56f4e3 # v2.0.2
3535
with:
3636
extra-args: --all-files
3737

0 commit comments

Comments
 (0)