Skip to content

docs(skills): capture PR-editing + symlink-guard testing lessons - #43

Closed
gitricko wants to merge 1 commit into
mainfrom
feat/skill-updates-from-pr42-session
Closed

gitricko wants to merge 1 commit into
mainfrom
feat/skill-updates-from-pr42-session

Conversation

@gitricko

Copy link
Copy Markdown
Owner

Summary

Skill-library updates distilled from the PR #42 session (persisting pi-agent LM config across Codespace rebuilds):

  • github-codespace: new "Editing PR title/body when gh pr edit lacks scope" section. gh pr edit can fail with missing read:project scope; fallback is a REST PATCH using the device-code OAuth token (gho_) stored in ~/.config/gh/hosts.yml. Don't use the VS Code server App token (ghu_) — it 403s on PR PATCH.
  • codespace-persistent-symlinks: two new pitfalls:
    • Test-stub leak — never cp a runtime file back into the tracked location while testing a rebuild guard; the tool's own stub (e.g. defaultProvider: "x") gets committed. Greptile caught this exact bug in PR refactor: persist pi-agent LM config across Codespace rebuilds #42.
    • Name config dirs after the tool, not the skill — a firstmate/ folder holding pi's config is misleading; rename to pi-config/ and scope the PR title to the real change.

Verification

  • ci-lint-check.sh: ALL CHECKS PASSED (markdownlint + SKILL.md validation).

🤖 Generated with Hermes Agent.

- github-codespace: document REST PATCH fallback when 'gh pr edit' lacks
  read:project scope (device-code gho_ token works; ghu_ App token 403s)
- codespace-persistent-symlinks: add test-stub-leak pitfall (never cp runtime
  stub back into tracked config; Greptile caught defaultProvider:'x' shipped
  this way) and 'name config dirs after the tool not the skill' guidance
Copilot AI lite review requested due to automatic review settings August 21, 2026 08:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds operational lessons for persistent per-file symlinks and a REST fallback for editing pull requests when gh pr edit lacks scope.

  • Documents mixed-state runtime directory handling, rebuild-guard testing, and tracked configuration naming.
  • Documents token selection and a direct pull-request PATCH request.
  • The persistent-symlinks update contains unresolved Git conflict markers that must be removed.

Confidence Score: 4/5

The pull request should not merge until the unresolved conflict markers in the persistent-symlinks skill are removed.

The newly added persistent-symlink guidance is committed inside literal Git conflict markers, leaving malformed documentation and potentially failing conflict-marker validation.

Files Needing Attention: .devcontainer/skills/codespace-persistent-symlinks/SKILL.md

Important Files Changed

Filename Overview
.devcontainer/skills/codespace-persistent-symlinks/SKILL.md Adds symlink and testing lessons, but commits unresolved merge-conflict markers around the entire new section.
.devcontainer/skills/github-codespace/SKILL.md Adds documentation for editing pull-request metadata through the REST API when the normal CLI command lacks scope.
Prompt To Fix All With AI
### Issue 1
.devcontainer/skills/codespace-persistent-symlinks/SKILL.md:67-87
**Unresolved conflict markers remain**

When this skill is read or validated, the committed Git conflict markers expose unresolved merge metadata around the new guidance, leaving the intended document state ambiguous and causing checks that reject conflict markers to fail.

```suggestion
- **Mixed-state runtime dirs need per-file symlinks, not whole-folder.** `~/.pi/agent/`
  is the canonical case: symlink only `models.json`/`settings.json` into
  `.devcontainer/pi-config/`; never symlink the whole dir (it drags in `auth.json`,
  `sessions/`, locks). Add a `start-hermes.sh` guard to re-link past the tool's own
  first-launch stub, and verify the guard replaces a plain stub with the symlink.
- **Test-stub leak: never `cp` from runtime back to tracked during guard testing.** When
  simulating a rebuild, the runtime file (e.g. `~/.pi/agent/settings.json`) may contain
  the tool's own stub (`defaultProvider: "x"`). If you `cp` it to the tracked location
  (`.devcontainer/pi-config/settings.json`), you commit the stub instead of the intended
  config. Instead: write the correct canonical content to the tracked file directly, then
  verify the guard correctly relinks from tracked → runtime. The guard's job is
  tracked→runtime; the test's job is to ensure tracked has the RIGHT content. (Observed:
  Greptile caught `defaultProvider: "x"` shipped in a PR because a rebuild-sim had copied the
  pi stub back into the tracked file.)
- **Name tracked config dirs after the tool, not the skill.** A folder named after the
  installing skill (e.g. `firstmate/` holding pi's LM config) is misleading to reviewers and
  drifts from the PR's actual purpose. Name it for what it holds (`pi-config/`), and keep the
  PR title scoped to the real change (persisting pi config), not the skill install.
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "docs(skills): capture PR-editing + symli..." | Re-trigger Greptile

Comment on lines +67 to +87
<<<<<<< Updated upstream
=======
- **Mixed-state runtime dirs need per-file symlinks, not whole-folder.** `~/.pi/agent/`
is the canonical case: symlink only `models.json`/`settings.json` into
`.devcontainer/pi-config/`; never symlink the whole dir (it drags in `auth.json`,
`sessions/`, locks). Add a `start-hermes.sh` guard to re-link past the tool's own
first-launch stub, and verify the guard replaces a plain stub with the symlink.
- **Test-stub leak: never `cp` from runtime back to tracked during guard testing.** When
simulating a rebuild, the runtime file (e.g. `~/.pi/agent/settings.json`) may contain
the tool's own stub (`defaultProvider: "x"`). If you `cp` it to the tracked location
(`.devcontainer/pi-config/settings.json`), you commit the stub instead of the intended
config. Instead: write the correct canonical content to the tracked file directly, then
verify the guard correctly relinks from tracked → runtime. The guard's job is
tracked→runtime; the test's job is to ensure tracked has the RIGHT content. (Observed:
Greptile caught `defaultProvider: "x"` shipped in a PR because a rebuild-sim had copied the
pi stub back into the tracked file.)
- **Name tracked config dirs after the tool, not the skill.** A folder named after the
installing skill (e.g. `firstmate/` holding pi's LM config) is misleading to reviewers and
drifts from the PR's actual purpose. Name it for what it holds (`pi-config/`), and keep the
PR title scoped to the real change (persisting pi config), not the skill install.
>>>>>>> Stashed changes

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Unresolved conflict markers remain

When this skill is read or validated, the committed Git conflict markers expose unresolved merge metadata around the new guidance, leaving the intended document state ambiguous and causing checks that reject conflict markers to fail.

Suggested change
<<<<<<< Updated upstream
=======
- **Mixed-state runtime dirs need per-file symlinks, not whole-folder.** `~/.pi/agent/`
is the canonical case: symlink only `models.json`/`settings.json` into
`.devcontainer/pi-config/`; never symlink the whole dir (it drags in `auth.json`,
`sessions/`, locks). Add a `start-hermes.sh` guard to re-link past the tool's own
first-launch stub, and verify the guard replaces a plain stub with the symlink.
- **Test-stub leak: never `cp` from runtime back to tracked during guard testing.** When
simulating a rebuild, the runtime file (e.g. `~/.pi/agent/settings.json`) may contain
the tool's own stub (`defaultProvider: "x"`). If you `cp` it to the tracked location
(`.devcontainer/pi-config/settings.json`), you commit the stub instead of the intended
config. Instead: write the correct canonical content to the tracked file directly, then
verify the guard correctly relinks from tracked → runtime. The guard's job is
tracked→runtime; the test's job is to ensure tracked has the RIGHT content. (Observed:
Greptile caught `defaultProvider: "x"` shipped in a PR because a rebuild-sim had copied the
pi stub back into the tracked file.)
- **Name tracked config dirs after the tool, not the skill.** A folder named after the
installing skill (e.g. `firstmate/` holding pi's LM config) is misleading to reviewers and
drifts from the PR's actual purpose. Name it for what it holds (`pi-config/`), and keep the
PR title scoped to the real change (persisting pi config), not the skill install.
>>>>>>> Stashed changes
- **Mixed-state runtime dirs need per-file symlinks, not whole-folder.** `~/.pi/agent/`
is the canonical case: symlink only `models.json`/`settings.json` into
`.devcontainer/pi-config/`; never symlink the whole dir (it drags in `auth.json`,
`sessions/`, locks). Add a `start-hermes.sh` guard to re-link past the tool's own
first-launch stub, and verify the guard replaces a plain stub with the symlink.
- **Test-stub leak: never `cp` from runtime back to tracked during guard testing.** When
simulating a rebuild, the runtime file (e.g. `~/.pi/agent/settings.json`) may contain
the tool's own stub (`defaultProvider: "x"`). If you `cp` it to the tracked location
(`.devcontainer/pi-config/settings.json`), you commit the stub instead of the intended
config. Instead: write the correct canonical content to the tracked file directly, then
verify the guard correctly relinks from tracked → runtime. The guard's job is
tracked→runtime; the test's job is to ensure tracked has the RIGHT content. (Observed:
Greptile caught `defaultProvider: "x"` shipped in a PR because a rebuild-sim had copied the
pi stub back into the tracked file.)
- **Name tracked config dirs after the tool, not the skill.** A folder named after the
installing skill (e.g. `firstmate/` holding pi's LM config) is misleading to reviewers and
drifts from the PR's actual purpose. Name it for what it holds (`pi-config/`), and keep the
PR title scoped to the real change (persisting pi config), not the skill install.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .devcontainer/skills/codespace-persistent-symlinks/SKILL.md
Line: 67-87

Comment:
**Unresolved conflict markers remain**

When this skill is read or validated, the committed Git conflict markers expose unresolved merge metadata around the new guidance, leaving the intended document state ambiguous and causing checks that reject conflict markers to fail.

```suggestion
- **Mixed-state runtime dirs need per-file symlinks, not whole-folder.** `~/.pi/agent/`
  is the canonical case: symlink only `models.json`/`settings.json` into
  `.devcontainer/pi-config/`; never symlink the whole dir (it drags in `auth.json`,
  `sessions/`, locks). Add a `start-hermes.sh` guard to re-link past the tool's own
  first-launch stub, and verify the guard replaces a plain stub with the symlink.
- **Test-stub leak: never `cp` from runtime back to tracked during guard testing.** When
  simulating a rebuild, the runtime file (e.g. `~/.pi/agent/settings.json`) may contain
  the tool's own stub (`defaultProvider: "x"`). If you `cp` it to the tracked location
  (`.devcontainer/pi-config/settings.json`), you commit the stub instead of the intended
  config. Instead: write the correct canonical content to the tracked file directly, then
  verify the guard correctly relinks from tracked → runtime. The guard's job is
  tracked→runtime; the test's job is to ensure tracked has the RIGHT content. (Observed:
  Greptile caught `defaultProvider: "x"` shipped in a PR because a rebuild-sim had copied the
  pi stub back into the tracked file.)
- **Name tracked config dirs after the tool, not the skill.** A folder named after the
  installing skill (e.g. `firstmate/` holding pi's LM config) is misleading to reviewers and
  drifts from the PR's actual purpose. Name it for what it holds (`pi-config/`), and keep the
  PR title scoped to the real change (persisting pi config), not the skill install.
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@gitricko gitricko closed this Aug 21, 2026
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.

3 participants