Skip to content

Unify portable acceptance and completion-target evidence - #12

Merged
nsticco merged 3 commits into
mainfrom
codex/4265-portable-acceptance-policy
Sep 12, 2026
Merged

nsticco merged 3 commits into
mainfrom
codex/4265-portable-acceptance-policy

Conversation

@nsticco

@nsticco nsticco commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Description

Related to MoonLadderStudios/MoonMind#4265.

Assessment and verification now share one portable acceptance policy. Mandatory checks remain mandatory when tools are unavailable; optional diagnostics and separately authorized production operations are distinct. Initial assessment records apparent implementation without claiming objective acceptance or landing.

The verifier ships a standard-library helper that binds evidence to actual Git content, original scope, requirements, freshness, and a completion target. The command wrapper delegates to the Skill instead of maintaining conflicting rules. In plain terms, passing on a feature branch still requires publication; matching verified target content can reuse the checks.

Testing

  • Tested locally with uv run specify --help (CLI unchanged)
  • Ran existing tests with uv sync && uv run pytest (equivalent isolated pytest run below)
  • Tested with a sample project: real dirty Git candidate, detached checkout, non-main target, squash-shaped landing, and stale/missing evidence
python tools/validate_bundle.py
python -m pytest --confcutdir=. -o addopts='' -q
python tools/project_bundle.py --target /tmp/moonspec-4265-projection --projection moonmind --write
python tools/project_bundle.py --target /tmp/moonspec-4265-projection --projection moonmind --check

25 tests passed; bundle and projection checks passed. Python/pytest ran in an isolated environment to avoid the consumer repository's tools package.

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

AI-assisted implementation, tests, and documentation; an independent Skill exercise verified candidate/target behavior while preserving local edits.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 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-12T06:56:41.619115Z 2ad69ae 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: 2ad69aefa8

ℹ️ 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 +157 to +159
or any(
not row.get("evidenceRefs") or not all(row["evidenceRefs"]) for row in rows
)

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 Reject string-valued evidence references

When a verifier emits evidenceRefs as a nonempty string instead of the required list, all(row["evidenceRefs"]) iterates its characters and accepts the malformed binding. With matching subject and target content, reuse() then returns both reusable and completionEligible as true, so invalid objective evidence can authorize issue completion; validate that this field is a nonempty list of valid reference strings before accepting it.

Useful? React with 👍 / 👎.

Comment on lines +99 to +102
if not requirement_ids or len(set(requirement_ids)) != len(requirement_ids):
raise ValueError(
"supply the unique mandatory requirement IDs from the original scope"
)

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 Reject blank mandatory requirement IDs

If source extraction supplies --requirement "", this validation treats the blank value as a unique mandatory requirement and marks the scope complete; a matching blank evidence row then passes reuse() and can become completion-eligible without identifying any real requirement. Reject empty or whitespace-only IDs here so an empty/truncated requirement inventory cannot certify the whole issue.

Useful? React with 👍 / 👎.

Comment on lines +49 to +51
Use the resolved `moonspec-verify` Skill to verify the original instructions or authoritative declarative source. Load its `SKILL.md` and `references/acceptance-policy.md`; the Skill owns scope resolution, required checks, evidence binding, verdicts, and continuation decisions. This command supplies the user input and runs the extension hooks; it does not define a separate acceptance policy.

1. **Setup**: Resolve the verification baseline in this order:
- explicit user instructions or an explicitly referenced declarative document
- issue-brief verification inputs
- an explicitly provided `spec.md` or feature directory
- an active feature directory discovered from repository context (run `.specify/scripts/bash/check-prerequisites.sh --json --paths-only` to discover it without requiring `plan.md` or `tasks.md`)
Use absolute paths for file-backed sources. Do not require `spec.md`, `plan.md`, or `tasks.md` when another usable baseline exists.
Resolve the Skill from `$MOONMIND_ACTIVE_SKILLS_DIR` when exported, otherwise the host's available Skill resolver or `.agents/skills/moonspec-verify`. Pass `$ARGUMENTS` unchanged, including the original issue/source, constraints, candidate, completion target, and evidence references. Do not require `spec.md`, `plan.md`, or `tasks.md` when another usable original baseline exists.

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 Assign extension hooks to only one verification layer

When /moonspec.verify has an enabled conditionless hook, this command runs its pre/post hook sections and then delegates to moonspec-verify, whose SKILL.md independently runs the same pre/post hooks. Mandatory hooks can therefore execute twice, including hooks with external side effects; remove hook execution from either the wrapper or the delegated Skill so each hook has one owner.

Useful? React with 👍 / 👎.

Comment on lines +73 to +77
"foreach",
"--quiet",
"--recursive",
'test -z "$(git status --porcelain --untracked-files=all)" || echo "$displaypath"',
)

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 Detect dirty unregistered embedded repositories

When an untracked directory is itself a Git repository, the isolated git add --all records it as a gitlink, but git submodule foreach only inspects registered submodules. Changes inside that embedded repository can therefore vary while capture() returns the same content digest, allowing evidence to be reused for content that was never verified; reject or explicitly inspect every staged gitlink, not only entries traversed as configured submodules.

Useful? React with 👍 / 👎.

@nsticco
nsticco merged commit e07ad0a into main Sep 12, 2026
2 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