Skip to content

feat: record-preserving Scientist runtime upgrades #75

Closed

Description

@Jammy2211

Pin, upgrade and recover an independent Scientist runtime

Type: feature
Epic: scientist-adoption-pilot
Target: PyAutoScientist
Difficulty: medium
Autonomy: supervised
Consequence: judge
Status: proposed

Original request

do next task

Context

Bounded implementation of scientist_record_preserving_upgrades.md, following
Scientist PR#74 and Broca PR#19. Independent config and organ data already live
outside framework checkouts. @PyAutoScientist owns this local runtime selection
helper; Brain is a pinned dependency, not an implementation target. Hosted pilot
acceptance remains separately recorded and is not claimed by upgrade tests.

High-level plan

  • Record the chosen Scientist and Brain checkout paths and exact Git revisions in
    a private instance runtime manifest.
  • Preview an upgrade to an already prepared second pair, validate compatibility
    with existing configuration offline, then explicitly apply the selection.
  • Preserve the previous selection for recovery; rollback changes framework choice,
    never restores old user configuration over newer records.
  • Demonstrate upgrade, failed upgrade and recovery with unchanged project, task,
    research and Broca records in an independently named synthetic instance.

Tier: judge — merge mode: human /prm.

Detailed implementation plan

  1. Add scripts/instance_runtime.py with initialize, upgrade, rollback and check
    commands. Initialize/upgrade/rollback preview by default and require --apply
    to write. The manifest is separate from instance.json and references the
    canonical map and profile rather than copying them. Record exact Scientist/Brain
    revisions, current selection and one previous selection. Reject dirty tracked
    code, invalid identities/paths and changed inputs before atomic replacement.
  2. Require already prepared local Git checkouts and resolve exact commits; no
    fetch, pull, checkout, reset, environment installation or network calls. Both
    framework pairs remain available so switching does not mutate shared checkouts.
    A selected revision mismatch fails closed until deliberately reviewed.
  3. Use the selected pair's existing --check-instance validator in a subprocess
    with explicit PYAUTO_BRAIN and profile/map paths. Bound execution, disable
    bytecode writes, report validation failure and retain the current manifest.
    Record-preservation checks cover the instance files and explicitly supplied
    record directories, with documented treatment of Git internals and symlinks.
    These checks detect drift; they are not a sandbox for untrusted framework code.
  4. Provide a launcher/check path that actually uses the manifest's selected
    Scientist/Brain pair. The manifest must influence execution, not be decorative
    version metadata. Keep normal feed-fetching render an explicit user action;
    upgrade and rollback validation remain offline. The same launcher can select
    the old pair after recovery, without changing instance/profile/project records.
  5. Rollback validates the previous pair against current configuration before
    switching. If newer configuration is incompatible, report it and leave the
    selection and records alone. Explain manual recovery from retained checkouts
    and the original manifest if the launcher itself becomes unusable. Do not
    promise arbitrary schema downgrade or conflict-free framework updates.
  6. Add tests/test_instance_runtime.py: synthetic local Git pairs, exact pin
    checks, successful upgrade/rollback, invalid candidate, missing previous pair,
    incompatible current config, concurrent-input change and write-failure cases.
    Hash fixture instance/Mind/research/Broca files before and after. Validate with
    real current owner scripts as well as fault-injection fixtures.
  7. Add an upgrade guide and update STARTER.md with registration of existing
    instances, preview/apply, fresh-chat resumption, selected-pair invocation and
    recovery. Keep paths/manifests private; no publication-bundle inclusion.

Acceptance and limits

One Scientist PR. Framework selection and recovery are implemented for the minimal
Scientist + Brain runtime only; no package/environment upgrades, owner-organ code
upgrades, schema migration, hosted rollout or collaborator access. Existing
instance and owner records are reused and preserved. Record hashes are evidence
for the declared protected paths, not an assertion about every file on the host.

Scientist main is clean at 396f3e0; no active claim. The old DNA worktree is clean
and already contained in main; leave it untouched. Proposed branch:
feature/scientist-record-preserving-upgrade, bundle under .worktrees/.
Route start_workspace -> ship_workspace. Heart STALE only for missing current-source
release rehearsal; no RED or YELLOW reasons. Plan awaits explicit approval.

Activity

  1. Jammy2211 commented on Oct 12, 2026

    @Jammy2211
    ContributorAuthor

    Shipped: record-preserving Scientist runtime upgrades

    Completed: 2026-10-12
    Issue: #75
    PR: #76 (MERGED)
    Merge: 9eb3baf

    Implemented private exact-revision Scientist/Brain runtime selection with preview/apply initialization, upgrade and rollback, plus a check/render launcher. Validates prepared clean local checkout pairs against existing configuration offline; retains one previous pair and verifies declared protected records. Rollback uses current records, never replaces them with old copies. Includes the starter-linked upgrade/recovery guide.

    Validation: 142 Python and 7 Node tests passed, including synthetic preservation/failure cases and real owner-validator upgrade/recovery. Exact-head GitHub Board tests run 38268112457 and its tests job passed; GitHub reported clean mergeability. Feature head c7e04e0 is an ancestor of origin/main. Heart at ship was STALE solely for missing current-source release rehearsal; no readiness rerun at merge.

    Limits: trusted candidate Python executes; fingerprints detect drift and are not a sandbox or backup. Protection is limited to declared paths. Retained checkout pairs and launcher are needed for recovery. This covers the minimal Scientist + Brain runtime, not environment/package or owner-organ upgrades, arbitrary schema downgrades, hosted rollout, or real collaborator acceptance. Those acceptance milestones remain separate. No independent review claimed.

    Local test logs and readiness evidence retained under tmp/scientist-record-preserving-upgrade/.

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