Skip to content

feat(lastcode): reconcile checked-in Project Actions in managed environments #108

Closed

Description

@lastobelus

Problem

LastCode actions are declared in t3.json, but runnable Project Actions are stored separately in each environment's project state. Refreshing a managed canonical checkout makes a new action appear under From t3.json, but does not make it runnable or resumable in new threads.

This left a managed environment without Build Intel package (macOS) even though the action was checked in. New threads already inherit actions saved for their environment; the missing piece is a LastCode-only reconciliation step in each explicitly managed environment.

Scope

Add a LastCode workflow helper that reconciles Project Actions for the explicitly managed LastCode project after setup and after a successful managed-anchor refresh.

  • Run only for a checkout explicitly marked as the managed LastCode anchor, after verifying repository identity.
  • Read the current t3.json and reconcile non-setup actions into that environment's saved project scripts.
  • Use deterministic action IDs and adopt an existing exact legacy import rather than creating a duplicate.
  • Track which entries the helper owns in environment-local LastCode state.
  • Add missing actions and update their managed fields when t3.json changes.
  • Preserve local-only fields, especially keybindings and allowAgentResume.
  • Remove a no-longer-declared action only when it is recorded as managed and still matches the last managed specification; otherwise retain it and report the divergence.
  • Apply updates through the event-sourced project command path. Never write state.sqlite directly.
  • Invoke reconciliation during lastcode-setup and after managed-anchor refresh.

Out of scope: automatic imports for arbitrary T3 repositories or changes to generic T3 Project Action behavior.

Security boundary

A checked-in command is not permission for an agent to execute it. Newly discovered actions default to allowAgentResume: false. Reconciliation preserves the environment's existing value and never enables it merely because an action appears in t3.json or matches a known name.

An explicit environment-local trust allowlist may grant resume permission to stable LastCode action IDs after a deliberate setup/configuration choice. Removing trust disables the managed grant without deleting the action.

Acceptance criteria

  • Fresh LastCode setup saves Wait for PR, Build Intel package (macOS), and Run Full CI as Project Actions; Setup Worktree is not duplicated as a normal action.
  • Adding a non-setup action to t3.json, then refreshing the managed anchor, installs it once in every configured managed environment without manual import.
  • Reconciliation is idempotent and creates no duplicates.
  • Managed name, command, and icon changes propagate while local keybindings and resume permission survive.
  • User-created or locally diverged actions are not silently overwritten or deleted.
  • New actions cannot be launched by an agent until locally trusted.
  • Live and stopped-server paths have focused coverage, including repository/anchor guards and error reporting.
  • LastCode operations docs distinguish automatic availability from local execution trust.

Likely implementation

  • A focused scripts/lastcode-project-actions.* helper and tests.
  • Integration in scripts/lastcode-setup.mjs and the checkpoint supervisor's post-refresh hook.
  • Minimal server CLI plumbing if needed to perform event-sourced project updates safely.
  • LastCode setup and operations documentation.

Activity

  1. added 7 commits that reference this issue on Sep 3, 2026
    9c002fd
    eaf9d54
    8440a83
    2a6afdc
    f7c07ba
    09d0ded
    ffe7eae
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions