Skip to content

bug(init): unresolved placeholders should route to human manifest review before verify #325

Closed

Description

@pengfei-threemoonslab

Completed on current main (2026-09-04). The shared setup envelope now withholds onward verification while human-owned placeholders remain, names the manifest fields and lines, and routes through doctor to verify after resolution. #372/#459 and subsequent setup-control fixes implement the acceptance below. Revalidated tests/test_setup_control.py and tests/test_adoption_walk.py (the latter: 16 passed). #504/#337 owns authenticated review decisions; that distinct gap does not keep this setup-routing defect open.

Summary

init --write --json can report unresolved CHANGE_ME placeholders while its rank-1 action tells the caller to continue. The machine route must stop at the human-owned manifest decision and, after resolution, return to the adopter-facing verify flow defined by #327.

Expected behavior

When placeholders remain:

  • control is non-complete;
  • the next actor is human when the values are human-owned;
  • the rank-1 action identifies exact manifest paths and source lines;
  • no action implies that a coding agent may invent purpose, binding, effect, authority, approval, or similar declarations.

Illustrative shape:

{
  "control": {
    "state": "human_review_required",
    "completion_allowed": false,
    "next_actor": "human",
    "next_action": {
      "kind": "review_manifest",
      "path": "shipgate.yaml",
      "fields": ["agent.declared_purpose"]
    }
  }
}

Acceptance criteria

  • Any non-empty human-owned placeholders[] prevents scan or verify from being the rank-1 action.
  • Output identifies exact paths and lines requiring review.
  • The action states which values must come from a human and why.
  • Once placeholders are resolved, doctor/validation deterministically advances to verify, not a user-facing scan step.
  • Human-owned semantic declarations are never synthesized or presented as agent-executable edits.
  • rollout(agent-mode): apply the shared control envelope across commands #323 applies the same setup-derived control vocabulary without pretending it came from a release decision.

Activity

  1. added
    bugSomething isn't working
    P1Picked up inside the current milestone window; keep about 15 open
    area:initinit / detect / manifest generation
    on Aug 7, 2026
  2. added this to the v0.17.0 milestone on Aug 7, 2026
  3. pengfei-threemoonslab commented on Aug 7, 2026

    @pengfei-threemoonslab
    ContributorAuthor

    Confirmed at 7e0bfdf5. cli/_register_init.py:301-304:

    placeholders = collect_placeholders(template)
    next_action_create = (
        "Replace placeholders, then run: agents-shipgate scan -c shipgate.yaml"
    )

    The string does carry the prerequisite as prose, and :540 emits "placeholders": placeholders alongside it — so the information is present but split across a free-text instruction and a separate array, with the machine-routable part being a scan command either way. An agent switching on the command runs scan; an agent parsing the sentence has to understand English conjunctions. That is the inconsistency as filed.

    Note the state is not uniform across branches: :327-328 already emits a structured next_actions=[action.model_dump(mode="json")], while :303, :340, :412, and :517 emit strings. So part of the fix is finishing a migration that was started, not beginning one.

    This issue should settle a question #323 also needs answered. The proposed control.state: "agent_action_required" for unresolved placeholders is the right routing, but init has no release_decision to project a control state from — unlike verify and check, where derive_agent_control reflects the gate. So init's control state derives from setup facts (placeholders, manifest validity, detection confidence) rather than from the verdict. That is defensible, but it must be stated, or control.state will mean two different things depending on which command produced it. Recommend deciding it here, since this is the concrete instance, and letting #323 generalize from the answer.

    One caution on the proposed shape: "kind": "edit_manifest" with "fields": ["agent.declared_purpose"] is an agent-actionable action kind, but agent.declared_purpose is a human-owned semantic declaration. The issue is explicit that Shipgate must not auto-fill these, and the acceptance criteria say so — but an action typed as agent_action_required invites exactly that. Worth checking whether the placeholder set is uniformly human-owned; if it is, the honest state may be closer to a human-input requirement that the agent surfaces rather than one it discharges.

    Labeled P1 / v0.17.0.

  4. pengfei-threemoonslab commented on Aug 7, 2026

    @pengfei-threemoonslab
    ContributorAuthor

    Flagging a direct conflict with the target flow now recorded in #327.

    This issue's fifth acceptance criterion reads:

    Once placeholders are resolved, rerunning init/doctor deterministically advances to scan.

    The adoption flow in #327 has no user-facing scan stage — it is verify --preview → init --local-review → verify, with scan remaining the engine rather than a step an adopter runs. Under that flow, a resolved manifest should advance to verify, not scan.

    Worth amending the criterion before implementation, otherwise this lands correctly against a flow that is being replaced.

    The rest of the issue is unaffected — the placeholder-gating requirement, the exact paths and lines, and the prohibition on synthesizing human-owned declarations all hold regardless of which command comes next.

    Also carrying forward the open semantics question from my earlier comment, since #327 now makes it load-bearing: init has no release_decision to project a control state from, but the target flow requires it to emit one. Whatever this issue decides about what agent_action_required means for a setup command becomes the definition #323 generalizes.

  5. changed the title [-]bug(init): unresolved placeholders should route to manifest review before scan[/-] [+]bug(init): unresolved placeholders should route to human manifest review before verify[/+] on Aug 9, 2026
  6. added 2 commits that reference this issue on Aug 13, 2026
  7. pengfei-threemoonslab commented on Aug 31, 2026

    @pengfei-threemoonslab
    ContributorAuthor

    Moved v0.18.0 → v0.19.0: scheduled with the review-surface completion batch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Picked up inside the current milestone window; keep about 15 openarea:agent-modeAgent-mode contract: control envelope, next actions, command stringsarea:initinit / detect / manifest generationbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions