-
Notifications
You must be signed in to change notification settings - Fork 0
chore: harden agent hardlink automation #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
✅ No Issues Found15 files reviewed | Confidence: 95% | Recommendation: Approved Review DetailsFiles Changed:
Checked: Script robustness, portability, error handling, documentation consistency, CI configuration Summary: This PR successfully hardens agent hardlink automation with significant improvements to portability, robustness, and user experience. All changes are improvements with no issues identified. Key Improvements:
PR Status: ✅ Already merged successfully on 2026-01-01 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR hardens the agent instruction mirroring automation and improves documentation consistency across the repository. The changes focus on making hardlink management scripts more robust, portable, and informative while aligning documentation with the current policy that AGENTS.md is the canonical source at the repo root.
Key Changes:
- Enhanced hardlink scripts with portable
statdetection, better error messages, and--quietmode support - Updated CI split guidance to reflect that builds and unit tests run on GitHub-hosted runners (only hardware tests on self-hosted)
- Consolidated README to remove duplication and outdated STT claims
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/ensure_agent_hardlinks.sh |
Major refactor: adds portable stat detection (GNU/BSD), hardlink verification, copy fallback, and actionable error messages |
scripts/install_git_hardlink_hooks.sh |
Adds --quiet mode, idempotency checks, and improved status reporting |
mise.toml |
Updates to use --quiet flag instead of output redirection |
.githooks/post-merge |
Switches from output redirection to --quiet flag |
.githooks/post-checkout |
Switches from output redirection to --quiet flag |
docs/dev/CI/architecture.md |
Updates CI split rationale: GitHub-hosted now handles builds+tests, self-hosted only for hardware tests |
AGENTS.md |
Updates CI split table to reflect new architecture |
.github/copilot-instructions.md |
Mirror of AGENTS.md CI split update |
.kilocode/rules/agents.md |
Mirror of AGENTS.md CI split update |
.github/workflows/docs-ci.yml |
Improves mirror drift error messages with actionable hints |
docs/plans/documentation/proposal-documentation-restructure.md |
Adds current-state override notes clarifying AGENTS.md policy |
docs/plans/documentation/future-documentation-architecture.md |
Adds current-state override notes clarifying AGENTS.md policy |
docs/plans/documentation-migration-mapping.md |
Adds current-state override notes clarifying AGENTS.md policy |
docs/MasterDocumentationPlaybook.md |
Clarifies that agent mirrors should be hardlinked (preferred) rather than symlinked |
README.md |
Major simplification: removes 100+ lines of duplicated/outdated content, consolidates to minimal entrypoint |
| echo "error: $dst is not hardlinked to $src (same contents, different inode)" >&2 | ||
| echo "hint: ensure both files are on the same filesystem; rerun scripts/ensure_agent_hardlinks.sh" >&2 | ||
| exit 2 |
Copilot
AI
Jan 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script exits with status 2 if hardlinking succeeds but verification fails. However, if hardlinking initially fails in link_or_copy and falls back to copying (line 70), the subsequent verification at line 101 will always fail because the files won't be hardlinked. This creates an inconsistent behavior where the script warns about copying but then exits with an error.
Consider either:
- Tracking whether a copy fallback occurred and skipping the hardlink verification for those cases
- Making the hardlink verification a warning instead of an error when content matches
- Exiting early after copy fallback with appropriate status
| echo "error: $dst is not hardlinked to $src (same contents, different inode)" >&2 | |
| echo "hint: ensure both files are on the same filesystem; rerun scripts/ensure_agent_hardlinks.sh" >&2 | |
| exit 2 | |
| echo "warning: $dst is not hardlinked to $src (same contents, different inode)" >&2 | |
| echo "hint: ensure both files are on the same filesystem; rerun scripts/ensure_agent_hardlinks.sh if you require hardlinks" >&2 |
|
|
||
| echo "Enabled repo hooks via core.hooksPath=.githooks" | ||
| "$repo_root/scripts/ensure_agent_hardlinks.sh" | ||
| "$repo_root/scripts/ensure_agent_hardlinks.sh" ${quiet:+--quiet} |
Copilot
AI
Jan 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter expansion ${quiet:+--quiet} is used without quotes. While this works when the variable expands to nothing or a single word, it's safer to quote it. If the expansion ever included spaces or special characters, this could cause unexpected word splitting.
Use "${quiet:+--quiet}" instead for proper quoting.
User description
Addresses bot-flagged robustness items for agent instruction mirroring + does a quick documentation consistency pass.
Changes:
PR Type
Enhancement, Bug fix
Description
Harden agent hardlink automation with portable stat, fallback copy, and idempotency checks
Replace output suppression with explicit
--quietflag for better controlImprove docs-ci mirror drift errors with actionable hints and error context
Align documentation policy:
AGENTS.mdcanonical; remove conflictingdocs/agents.mdreferencesUpdate CI architecture guidance: move
cargo buildand unit tests to GitHub-hosted runnersSimplify README: remove outdated STT claims and consolidate development setup
Diagram Walkthrough
File Walkthrough
2 files
Harden hardlink script with portability and robustnessAdd actionable error hints for mirror drift detection4 files
Add quiet mode and improve hook configuration outputUse explicit quiet flag instead of output redirectionUse explicit quiet flag instead of output redirectionUse quiet flag for hardlink hook installation9 files
Update CI split guidance for build and unit testsUpdate CI split guidance for build and unit testsUpdate CI split guidance for build and unit testsSimplify and remove outdated STT documentation claimsClarify hardlink mirrors policy and remove docs/agents.mdRestructure CI split rationale and move build to GitHub-hostedAdd override note on canonical AGENTS.md policyAdd override note removing docs/agents.md from future stateAdd override note on canonical AGENTS.md and remove docs/agents.md