Skip to content

Bind installed D-AI Skill to canonical runtime - #39

Merged
keida merged 1 commit into
mainfrom
codex/installed-runtime-binding-closure-20260906
Sep 6, 2026
Merged

keida merged 1 commit into
mainfrom
codex/installed-runtime-binding-closure-20260906

Conversation

@keida

@keida keida commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • make the installed D-AI Skill resolve the runtime only through an explicit machine-local .runtime-root
  • add an idempotent, validated set-runtime-binding.ps1 creation/update path
  • fail closed on missing, stale, invalid, relative, or drive-relative bindings before runtime or durable-state mutation
  • keep installed Skill root, runtime root, and user workspace distinct

Verification

  • focused PowerShell integration: 7/7 passed
  • typecheck: passed
  • structural health: passed after commit
  • git diff check: passed
  • added-line privacy/secret scan: passed
  • independent reviewer: PASS, no P0-P2

Final real home-installed Quote Float acceptance remains a post-merge gate. This PR does not add Quote Float aliases or status grammar and does not touch command-runner, product code, durable schema, or CI.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T08:11:15.320513Z ec75b18 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec75b183c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +67 to +72
$package = Get-Content -LiteralPath $packagePath -Raw | ConvertFrom-Json
if ([string]::IsNullOrWhiteSpace([string]$package.scripts.'d-ai')) {
throw 'package.json does not define the d-ai npm script'
}
if (-not (Test-Path -LiteralPath (Join-Path $Candidate 'src\entry\codex-cli.ts') -PathType Leaf)) {
throw 'canonical D-AI Codex entry is missing'

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 Badge Verify the bound repository identity before executing it

When .runtime-root points to an obsolete worktree or unrelated directory containing a package.json with any nonempty d-ai script plus src/entry/codex-cli.ts, this check accepts it and line 117 executes that package script. A binding can therefore silently route durable commands through the wrong implementation—or execute an arbitrary npm command—despite being presented as a validated canonical D-AI-Hub checkout; verify the Git repository/remote identity and intended canonical revision rather than only these filenames.

AGENTS.md reference: AGENTS.md:L15-L19

Useful? React with 👍 / 👎.

Comment on lines +78 to +81
$temporaryPath = "$bindingPath.$([guid]::NewGuid().ToString('N')).tmp"
try {
[System.IO.File]::WriteAllText($temporaryPath, "$resolvedRuntimeRoot`r`n", [System.Text.UTF8Encoding]::new($false))
Move-Item -LiteralPath $temporaryPath -Destination $bindingPath -Force

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Ignore the repository-local runtime binding

When the documented repository-local entry at skills/custom/d-ai/scripts/invoke.ps1 is configured by passing its own Skill root, this write creates skills/custom/d-ai/.runtime-root, but no ignore rule covers that machine-local file. Normal activation therefore leaves the canonical checkout dirty, which makes the documented sync path refuse to pull and contaminates subsequent release diffs; add a narrowly scoped ignore rule for the binding.

AGENTS.md reference: AGENTS.md:L28-L31

Useful? React with 👍 / 👎.

@keida
keida merged commit 1800a43 into main Sep 6, 2026
9 checks passed
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.

1 participant