Skip to content
This repository was archived by the owner on Nov 9, 2026. It is now read-only.

fix(baseline): Make the Sandcastle gate command configurable and harden path and body handling - #284

Merged
mpaulosky merged 1 commit into
mainfrom
chore/sandcastle-review-fixes
Oct 25, 2026
Merged

mpaulosky merged 1 commit into
mainfrom
chore/sandcastle-review-fixes

Conversation

@mpaulosky

Copy link
Copy Markdown
Owner

Template fixes from Copilot's review of the four migration PRs (mpaulosky/Articles#358, mpaulosky/IssueManager#324, mpaulosky/IssueTracker#279, mpaulosky/TicketManager#242). The findings are on Owned files, so the fix goes in the Template and is re-applied, not patched in one repo.

  • GATE_COMMAND (Seed lib/repo-config.mts, default scripts/gate.sh): the command the host runs as the gate at each checkpoint and in a follow-up pass. The sandbox has no Docker daemon, so a repo whose tests start containers points it at a script that skips those and keeps the lints. checkpoint.mts and follow-up-pass.mts use it, messages included.
  • plan.mts: resolveFiles folds .. into the segment before it, so src/Web/../Web/Program.cs and src/Web/Program.cs are one path for the overlap check. A path that climbs above the root gives the no-files fallback.
  • prompts.mts: an issue with an empty body gets (no description), since Sandcastle refuses an empty prompt value and the requirements may be in trusted comments.
  • references/sandcastle.md names GATE_COMMAND and adds the migration step for repos with Docker-backed tests.

scripts/gate.sh passes, with new tests for each fix.

… in planned paths and give an empty issue body a sentence

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 25, 2026 21:10
@mpaulosky
mpaulosky merged commit d10c1f4 into main Oct 25, 2026
3 checks passed
@mpaulosky
mpaulosky deleted the chore/sandcastle-review-fixes branch October 25, 2026 21:13

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.

🟡 Changes recommended

The documented custom gate conflicts with hard-coded test expectations and fixtures, preventing it from passing its own Sandcastle checks.

2 open issues
What changed in this PR

This PR updates the reusable Sandcastle baseline to support repository-specific gate commands, normalize parent-directory path segments, and handle empty issue descriptions. The Owned changes are mirrored in dotfiles.

Changes:

  • Adds GATE_COMMAND and uses it for gate execution and status messages.
  • Normalizes .. path segments and supplies a fallback for blank issue bodies, with regression tests.
  • Documents custom-gate setup for repositories with Docker-backed tests.
File Description
Support For New Projects/​.claude/​skills/​repo-ci-baseline/​template/​seed/​.sandcastle/​lib/​repo-config.mts Adds the default gate command setting.
Support For New Projects/​.claude/​skills/​repo-ci-baseline/​template/​owned/​.sandcastle/​lib/​prompts.test.mts Tests blank issue descriptions.
Support For New Projects/​.claude/​skills/​repo-ci-baseline/​template/​owned/​.sandcastle/​lib/​prompts.mts Supplies a nonempty description fallback.
Support For New Projects/​.claude/​skills/​repo-ci-baseline/​template/​owned/​.sandcastle/​lib/​plan.test.mts Tests parent-segment normalization and root escapes.
Support For New Projects/​.claude/​skills/​repo-ci-baseline/​template/​owned/​.sandcastle/​lib/​plan.mts Canonicalizes paths for overlap checks.
Support For New Projects/​.claude/​skills/​repo-ci-baseline/​template/​owned/​.sandcastle/​lib/​follow-up-pass.mts Reports the configured gate command.
Support For New Projects/​.claude/​skills/​repo-ci-baseline/​template/​owned/​.sandcastle/​lib/​checkpoint.mts Executes and reports the configured gate.
Support For New Projects/​.claude/​skills/​repo-ci-baseline/​references/​sandcastle.md Documents gate configuration and migration.
.sandcastle/​lib/​repo-config.mts Sets dotfiles’ gate command.
.sandcastle/​lib/​prompts.test.mts Mirrors blank-description tests.
.sandcastle/​lib/​prompts.mts Mirrors the description fallback.
.sandcastle/​lib/​plan.test.mts Mirrors path-normalization tests.
.sandcastle/​lib/​plan.mts Mirrors path canonicalization.
.sandcastle/​lib/​follow-up-pass.mts Mirrors configurable gate messages.
.sandcastle/​lib/​checkpoint.mts Mirrors configurable gate execution.

Review effort: Balanced

export async function runGate(sandbox: Pick<Sandbox, "exec">): Promise<GateRun> {
const before = await headOf(sandbox);
const { stdout, exitCode } = await sandbox.exec("scripts/gate.sh 2>&1");
const { stdout, exitCode } = await sandbox.exec(`${GATE_COMMAND} 2>&1`);
Comment on lines +85 to +86
7. The sandbox has no Docker daemon. A repo whose test projects start containers sets `GATE_COMMAND` in `lib/repo-config.mts` to a script that leaves
those out and keeps the lints (its `.sandcastle/check.sh`), and points the gate-fixer and follow-up roles' instructions at it.
mpaulosky added a commit that referenced this pull request Oct 25, 2026
…command (#285)

Follow-up to #284. `GATE_COMMAND` made the gate command
repo-configurable, but the Owned tests still named `scripts/gate.sh`, so
a repo that sets it (the four Sandcastle migrations set
`.sandcastle/check.sh`) failed 16 of them.

- `build.test.mts`, `checkpoint.test.mts` and `follow-up-pass.test.mts`:
the fake sandbox reports the configured command as the Template's
default, so the expected command lists stay as they are.
- `git-sandbox-fake.mts`: writes its gate script at `GATE_COMMAND`'s
path.
- `follow-up-pass.test.mts`: the red-gate message test checks the
configured command.

`scripts/gate.sh` passes here. With `GATE_COMMAND` set to
`.sandcastle/check.sh`, `pnpm run check:sandcastle` passes in Articles,
IssueManager, IssueTracker and TicketManager.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants