Skip to content

Resolve project names to active durable tasks - #34

Merged
keida merged 4 commits into
mainfrom
codex/project-task-resolution-20260903
Sep 3, 2026
Merged

keida merged 4 commits into
mainfrom
codex/project-task-resolution-20260903

Conversation

@keida

@keida keida commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Problem

Natural-language project continuation must resolve only a canonical durable project identity in the current workspace. Revision 2 also hardened invalid task-id probes and bounded ambiguity output.

Solution

Resolve an exact project name from the single persisted remote-repository: identity among active durable tasks discovered for the current workspace, then route exactly one match through the existing continue path. Exact task-id loads retain priority only for task ids accepted by the existing durable-store syntax rule. The remote identity must match the approved host/owner/repository shape before its final segment is used.

Fail-closed

Zero matches, closed-only tasks, wrong-workspace tasks, malformed repository identity, invalid task-id-shaped input, and multiple matches block without creating or mutating a task. Multiple candidates are sorted by task id, capped at 3 displayed candidates, each task id/stage/workspace identity field is bounded to 96 characters, and the response reports total and omitted counts. No goal or other metadata is exposed.

Compatibility

Existing status/close discovery and explicit task-id continuation remain unchanged. Natural-language activation continues to use the existing parser and runtime seams. The runtime reuses the durable store task-id and remote-repository validation rules without changing the store.

Out-of-scope

No new durable schema, registry, parser, command-runner, actor/session, Memory, aliases, semantic matching, task auto-creation, or cross-workspace resume behavior.

Revision 3 evidence

  • RED: malformed persisted remote-repository:garbage/D-AI-Hub was incorrectly resolved and continued before the fix.
  • GREEN: the same malformed identity now returns exactly No active durable task found for project D-AI-Hub with zero writes.
  • The canonical host/owner/repository pattern is defined once in src/runtime/d-ai-runtime.ts and reused by execution identity validation and project resolution.
  • Revision 2 multi-word invalid task-id and bounded ambiguity tests remain green.
  • Focused runtime + activation tests: 112 passed.
  • Integration command through the repository script: 49 passed, 1 skipped.
  • npm run typecheck: passed.
  • npm run health-check:structural: healthy after commit.
  • git diff --check: passed.
  • Changed-added-line high-confidence secret scan: no matches.
  • New exact HEAD: 3d91b04.
  • No merge performed.

Review thread classification

  • Task-id P2: CODE RESOLVED / THREAD OUTDATED by revision 2 exact-head evidence.
  • Repository-identity P1: CODE RESOLVED / THREAD OUTDATED after exact new-head CI/GitGuardian evidence.

Revision 4 evidence

  • Standards P2 fixed by extracting the existing durable task-id rule into src/domain/task-id.ts and using that helper from both runtime and FileDurableContextStore.
  • Standards P2: CODE RESOLVED / THREAD OUTDATED after exact revision-4 head verification.
  • No parser, schema, or durable-store semantics changed.
  • Focused runtime + activation tests: 112 passed; project-resolution/discovery integration tests: 5 passed.
  • Commit: 53a4468.
  • Exact workflow 33747460072: 8/8 Quality/Integration passed.
  • GitGuardian Security Checks: pass.
  • Merge performed: NO.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 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-03T10:22:59.143805Z 7533b14 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: 7533b14671

ℹ️ 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 thread src/runtime/d-ai-runtime.ts Outdated
command: Extract<DAICommand, { readonly kind: "continue" }>,
dependencies: DAIRuntimeDependencies,
): Promise<string | DAIResponse> {
const exact = await dependencies.store.load(command.taskIdOrProject);

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 Skip task-ID lookup for non-task project names

When the project name is not valid task-ID syntax—for example .github, which is accepted by the runtime's own remote-repository format—the configured FileDurableContextStore.load() throws InvalidTaskStateError here instead of returning a miss, so discovery never runs and @D-AI continue .github rejects its promise rather than resolving the matching task. Gate this lookup on task-ID syntax or treat an invalid task ID as a miss before performing project discovery.

AGENTS.md reference: AGENTS.md:L7-L9

Useful? React with 👍 / 👎.

Comment thread src/runtime/d-ai-runtime.ts Outdated
Comment on lines +1964 to +1966
const repository = entries[0]!.slice("remote-repository:".length);
const separator = repository.lastIndexOf("/");
return separator < 0 || separator === repository.length - 1 ? null : repository.slice(separator + 1);

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 Validate the full repository identity before matching

When persisted state contains a malformed repository identity such as remote-repository:garbage/D-AI-Hub, this extraction still returns D-AI-Hub; the durable-state schema permits arbitrary manifest strings, and workspace discovery validates only the workspace identity, so the resolver can select and continue a task whose claimed repository identity was never valid. Require the complete canonical host/owner/repository shape before using the final segment so malformed identity data fails closed.

Useful? React with 👍 / 👎.

@keida
keida merged commit 74211ea into main Sep 3, 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