Skip to content

fix(adf): generate Copilot instructions at the supported repository path - #419

Merged
stackbilt-admin merged 6 commits into
mainfrom
fix/issue-403-copilot-path
Nov 3, 2026
Merged

stackbilt-admin merged 6 commits into
mainfrom
fix/issue-403-copilot-path

Conversation

@stackbilt-admin

Copy link
Copy Markdown
Member

Problem and behavior

Fresh adf init --emit-pointers and bootstrap wrote a root-level Copilot file that GitHub does not use. Generate .github/copilot-instructions.md, creating its parent when needed, with file-relative links to the selected AI directory. GitHub documents this repository-wide path in its official instructions guide.

Closes #403.

The legacy root filename, exported POINTER_COPILOT_MD, vendor modes and explicit root migration/tidy/restore APIs remain supported. No file is automatically moved or deleted. Canonical pointers are rendered at call time rather than capturing an import-time working directory; only native path separators are normalized.

Canonical and legacy files participate in vendor status, inference, discovery, migration, tidy/restore, doctor, score and staged pre-commit handling. Copilot stays pointer-only: a fresh scaffold has five vendors and compile --target all still checks the same four compilable targets. Compiler target/JSON contracts are not broadened. Existing generated hooks can be refreshed with charter hook install --pre-commit.

Preservation and review corrections

  • Existing hand-authored or recorded-unmanaged canonical instructions remain untouched during bootstrap, including --yes and --force. Explicit adf migrate --source remains available with a byte-preserving adjacent backup.
  • Physical-identity guards preserve unmanaged canonical content through every vendor alias, automatic pointer writes, automatic migration and module-index refresh. Hard-link fixtures include CLAUDE, AGENTS, Gemini, Cursor and legacy Copilot, plus a recorded-unmanaged hybrid/sentinel alias under force. Ordinary non-aliased migration and index refresh continue working.
  • Exact generated canonical preambles are analyzed separately for grounding so directories containing spaces do not create false path fragments. Their actual directory and manifest are still validated, user-added missing references are still reported, and edited/unmanaged text is not blanket-exempted. CRLF normalization is for comparison/analysis only; no file bytes are rewritten by score.
  • Restore creates a missing canonical parent only on actual writes; dry-run does not create it and failed parent creation rolls back vendor recording.

Prerequisite and scope

This branch includes reviewed PR #416 through 400bc07e72a1181884190236bfc650a23285a836 (generated-context snapshot/case handling). The issue-only comparison is against that commit; this PR targets main so CI runs. Its source changes cover Copilot path consumers and preservation only, with no instruction-file edits, package-version changes or changelog changes.

Validation

Windows Node24.19.0 / pnpm9.15.9 in an isolated worktree:

  • Frozen install, build and typecheck: passed.
  • Final Copilot regression file: 28/28 passed, including actual init/bootstrap, custom directories, LF/CRLF and missing-path controls, default/force alias preservation, vendor modes, restore rollback, tidy, migration backup and legacy controls.
  • Final pre-wording consumer regression suite: 734/734 passed across 21 files (all ADF CLI suites, vendor/doctor/score, bootstrap merge and hook tests). After the wording-only clarification below, the Copilot/vendor/doctor/score suites passed 195/195 on the final source text.
  • Real generated pre-commit hook, staged canonical Copilot rules: passed; the hook migrated only the staged file and left a clean worktree.
  • Docs check: passed (optional local docs-sync config absent; papers-lint passed).
  • Existing LF source/doc line endings preserved; new files use LF. git diff --check passed. ADF command LOC 1037/1041 and migrate LOC 792/792, no budget increases.
  • Full suite after all confirmed pre-review logic fixes: 1,962 passed, four failed (1,966 total), 239.99 seconds. All four failures exactly match the established Windows baseline: bootstrap POSIX premise, context-refresh/serve path separators, Ctrl-D fake-TTY. Log: .cache/issue-403-all-review-fixes-full-tests-final.log.
  • After that full run, only the canonical helper wording gained (paths are relative to this file). Paths, ownership marker and logic are unchanged. Rebuilt and typechecked the final text, then ran 195/195 Copilot/vendor/doctor/score regressions successfully. Per coordinator direction, no second complete suite was run solely for that wording change. Final focus log: .cache/copilot-final-wording-focus.log.

An earlier pre-review run had 1952 passes and the four baseline failures. A subsequent incomplete run was stopped only in this worktree before applying the final review variants; it is not final validation evidence. Main's dependency audit is handled separately by #413's approved-preparation major Zod migration and compatible repairs; this PR does not suppress any gate. No merge, tag/main push, publication, deployment, production writes, repository setting change or remote branch deletion performed.

@stackbilt-admin
stackbilt-admin marked this pull request as ready for review November 3, 2026 16:06
@stackbilt-admin
stackbilt-admin merged commit 67827ee into main Nov 3, 2026
7 checks passed
@stackbilt-admin
stackbilt-admin deleted the fix/issue-403-copilot-path branch November 27, 2026 23:55
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.

Copilot pointer is written to the repo root instead of .github/

2 participants