Skip to content

Placement P2 follow-ups for P4/P5 (from the #798 review) #805

Closed

Description

@scuttletoby

Follow-ups left after the fix round on #798 (review: #798 (comment)). None of them belong in P2 (settings only); each is work for a later placement row.

  1. P5 (placement P5: pure rule engine, hard rules H1 to H9 and upstream's rank #787) must read needs through readPlacementNeeds. placementNeeds (server and project) is now labels | { unreadable, problem }. A broken value fits no machine; readPlacementNeeds gives { fits: "none", reason } with the plain reason. P5 must not treat a broken value as [].
  2. Merge the two label functions. P2's canonicalPlacementLabels (packages/contracts/src/placement.ts) and P5's canonicalLabels (packages/shared/src/forkPlacement.ts) do the same thing: trim, lower-case, drop blanks and repeats. Keep one when both are in. P5's comment "P2 stores labels in this form" is now true.
  3. P4 runner, factsCommand. Before running it, re-check the path on the runner's own host (isPlaytestProgramFullyQualified with its platform). A hand edit can skip the server's checks, so treat a path it cannot run as "not available". Spawn the path with no shell and no argument splitting, because spaces are legal in the path.
  4. Threat notes for P4+ (review minor 8). "Person-only" covers T3 tool inputs only. An agent with a shell can still edit the settings file or call the settings RPC, the same as for modelPolicy. This is in docs/fork/README.md now; state it in the P4+ threat notes too, since placement decides where work runs.
  5. Small: a wrong-OS factsCommand is kept in its read form. It is not kept byte for byte: missing fields get their defaults filled in, e.g. weights: {}. The value stays stable across saves (no growth). Keep the raw text if the load ever gets access to it.

Activity

  1. scuttletoby commented on Nov 21, 2026

    @scuttletoby
    OwnerAuthor

    Note for P4 and P5 (from #798): the settings load does not check placement.factsCommand against the server's OS. Placement code must read placement through readPlacementForThisOs (apps/server/src/fork/placementRead.ts), never settings.placement directly; a path this OS cannot run then reads as off, with its problem. P4's runner must also check the path again on the host that runs it, and treat one it cannot run as "not available".

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