Skip to content

refactor: rename @moca/knative-server to @moca/server - #804

Merged
pdettori merged 2 commits into
rossoctl:mainfrom
pdettori:rename-knative-server-to-server
Nov 16, 2026
Merged

pdettori merged 2 commits into
rossoctl:mainfrom
pdettori:rename-knative-server-to-server

Conversation

@pdettori

Copy link
Copy Markdown
Member

What

Renames packages/knative-server to packages/server and @moca/knative-server to @moca/server.

The package was never Knative-specific: it is the data-plane HTTP server and the P6 worker entrypoint the supervisor forks. ADR-0041 kept the code as P6-load-bearing and called the name historical; the rename decision it left owed lands here.

  • git mv packages/knative-server packages/server (history preserved)
  • package.json name → @moca/server
  • supervisor DEFAULT_WORKER_ENTRY, Dockerfile COPY/WORKDIR, the compose image test, the microvm smoke script, and live docs now name the new path
  • code comments that point at files in the package updated across harness, control-plane, k8s-sandbox, supervisor
  • pnpm-lock.yaml importer key renamed (no other lock change)

Historical records

ADR bodies, specs and docs/REORG-PLAN.md keep the old name deliberately — they record what the package was called then. ADR-0041 gains a dated 2026-11-12 — the package renamed revision noting the change.

Verification

  • pnpm -r typecheck — pass (all workspace packages)
  • Tests, affected suites: harness 790 passed / 5 skipped; control-plane 1220 / 3 skipped; k8s-sandbox 128 / 3 skipped; supervisor 239 / 3 skipped; server 566 passed
  • deploy/compose/tests/images.test.sh — pass
  • Prettier 3.9.10 on changed .ts/.md/.yaml/.json — clean (shell scripts are not parsed by Prettier)

Assisted-By: Claude Code

@pdettori
pdettori requested a review from cwiklik as a code owner November 13, 2026 04:02

@cwiklik cwiklik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A clean, mechanical rename. I verified completeness against the real tree rather than the diff: no @moca/knative-server or packages/knative-server reference survives anywhere in the head tree, and none survives after merging the 112 commits main has gained since this branch forked — so the rename will not go stale on merge. DEFAULT_WORKER_ENTRY resolves to ../../server/src/worker.ts with its assertion updated, pnpm-workspace.yaml's packages/* glob needs no change, the lockfile touches only the importer key, and ADR-0041 gains a dated revision closing the follow-up it owed itself. The three inline findings are cosmetic or test-tightening; none blocks merge.

Two notes that are not yours to fix:

  • GitHub shows mergeable_state: dirty, but it is stale. Its cached base is 6f9a736d, not current main (f60db301). A trial merge in a scratch worktree reports "Automatic merge went well." No rebase needed.
  • CI has not verified this PR. Only the DCO check ran (passing). The head is the fork pdettori/moca and there are zero workflow runs on 999d2097, so ci.yml (lint/typecheck/test) never fired. Verification currently rests on the local run reported in the body — worth approving the workflow run before merge on a 90-file refactor.

One pre-existing wart, mentioned not flagged: experiments/MOVED.md:18 is the only remaining knative-server path outside the deliberately-preserved ADRs/specs, but it was already broken before this PR — both the test it names and deploy/knative/ were deleted in 7299c05f, so renaming the path would not fix it. That paragraph is obsolete and belongs in its own issue.

Areas reviewed: TypeScript, Dockerfile, Shell, Docs, lockfile, commit/PR conventions, security, supply-chain gate
Agent/IDE config (.claude/.vscode): none — gate clean
Commits: 1, signed off (DCO passing)

Assisted-By: Claude Code

Comment thread README.md Outdated

> **Note:** The supervisor and its workers are the **same container image**: the supervisor forks
> `packages/knative-server/src/worker.ts` (the package name is historical — the code is
> `packages/server/src/worker.ts` — the code is

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: orphaned closing paren. Removing (the package name is historical — left P6-load-bearing). with no opener, and the line now wraps short.

Suggested change
> `packages/server/src/worker.ts` — the code is
> `packages/server/src/worker.ts` — the code is P6-load-bearing. The "brain" (model inference + session logic) runs in a worker; the "hands"

(then drop the now-duplicated > P6-load-bearing). The "brain" ... line below)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a583323 — the orphaned paren is gone and the note is rewrapped into two full lines.

// `DEFAULT_WORKER_ENTRY` had ZERO test references, so the highest-risk integration in the
// slice ran only on a real VM.
expect(DEFAULT_WORKER_ENTRY).toMatch(/knative-server[/\\]src[/\\]worker\.ts$/);
expect(DEFAULT_WORKER_ENTRY).toMatch(/server[/\\]src[/\\]worker\.ts$/);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: this regex got strictly weaker. /server[/\\]src[/\\]worker\.ts$/ still matches the old knative-server/src/worker.ts, and any other *server/src/worker.ts — so it would no longer catch a regression that pointed the entry back at a stale path.

The comment just above calls this "the highest-risk integration in the slice," which argues for keeping the guard as tight as it was:

Suggested change
expect(DEFAULT_WORKER_ENTRY).toMatch(/server[/\\]src[/\\]worker\.ts$/);
expect(DEFAULT_WORKER_ENTRY).toMatch(/packages[/\\]server[/\\]src[/\\]worker\.ts$/);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a583323. The pin is now /[/\\]packages[/\\]server[/\\]src[/\\]worker\.ts$/, anchored on the separator so knative-server/src/worker.ts no longer matches. It is the separator-anchored form from the later review, which also rejects a hypothetical foopackages/server/.... Re-ran real-worker.integration.test.ts: "is the default entry…" passes.

Comment thread Dockerfile Outdated
WORKDIR /app/packages/knative-server
# Default entrypoint: the HTTP server (package name historical — ADR-0041). The P6 supervisor
WORKDIR /app/packages/server
# Default entrypoint: the HTTP server. The P6 supervisor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: same unrewrapped-comment artifact as the README one — "the HTTP server. The P6 supervisor" / "forks src/worker.ts instead" now breaks mid-sentence after the parenthetical was deleted. Cosmetic; rewrap or leave.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewrapped in a583323.

@webchang

Copy link
Copy Markdown
Member

A note on merge order with three open PRs. #759, #789 and #790 change files under packages/knative-server/ (4, 4 and 6 files), so they overlap this rename. A trial merge of this branch into current main (ab8d10e) is clean, as noted above, and none of the three needs to wait for it:

  • If this PR merges first, each of the three carries the knative-server → server rename in its next merge of main, and we check that no packages/knative-server path or @moca/knative-server reference survives in its tree.
  • If any of them merges first, this branch's next merge of main takes their changes under the new path.

Assisted-By: Claude Code

@pdettori pdettori added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 16, 2026

@ingpaolodettori-dev ingpaolodettori-dev 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.

Summary

This PR is a mechanical rename of packages/knative-server → packages/server (@moca/server): 52 pure renames, plus reference updates in the Dockerfile, deploy scripts, supervisor, harness comments, docs and the lockfile, plus an ADR-0041 addendum. I found no remaining non-historical knative-server reference in code, CI or scripts, including against a local merge with current main (ccf393b). But the branch is 634 commits behind main, GitHub reports it dirty/not mergeable, and only DCO has run on this head. Typecheck, tests, the image build and k8s-kind-e2e have never exercised the rename. Please merge or rebase on main and get CI green. A local git merge-tree against ccf393b resolves without conflicts, so this should be cheap. After that, the two nits below are optional.

Author: pdettori (MEMBER — maintainer)
Areas reviewed: rename completeness (code, Dockerfile, shell, CI, lockfile), docs/ADR
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: not run (PR dirty; DCO only)

Also: docs/REORG-PLAN.md open question 7 ("knative-server rename …") could now be marked resolved.

Assisted-By: Claude Code

// `DEFAULT_WORKER_ENTRY` had ZERO test references, so the highest-risk integration in the
// slice ran only on a real VM.
expect(DEFAULT_WORKER_ENTRY).toMatch(/knative-server[/\\]src[/\\]worker\.ts$/);
expect(DEFAULT_WORKER_ENTRY).toMatch(/server[/\\]src[/\\]worker\.ts$/);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: /server[/\\]src[/\\]worker\.ts$/ also matches the old knative-server/src/worker.ts, so this pin no longer proves the rename. Anchor it on the separator: /[/\\]packages[/\\]server[/\\]src[/\\]worker\.ts$/.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a583323, using exactly this form.

Comment thread packages/server/src/server.ts Outdated

// Exact entrypoint match — avoids a fragile substring
// match that would misfire for any argv path containing "knative-server".
// match that would misfire for any argv path containing "server".

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The rationale reads oddly now: a substring match on "server" would misfire for almost any path. Consider …for any argv path that merely contains "server" (e.g. another package's entrypoint). or simply drop the quoted name.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded in a583323: "a substring test on the file name would misfire for any other entrypoint whose path merely contains it (another package's server.ts, say)."

@clawgenti clawgenti 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.

Summary

Mechanical rename of packages/knative-server → packages/server (@moca/server), re-reviewed on head 999d209. The rename itself is complete: no knative-server path or @moca/knative-server reference survives in the head tree outside deliberately-historical ADR/spec records, DEFAULT_WORKER_ENTRY, the Dockerfile, deploy scripts and the lockfile all name the new path, and DCO passes. The outstanding issue is unchanged from the previous review round: the branch is 634 commits behind main (merge-base 86d63503), GitHub reports it not mergeable (dirty), and only DCO has run on this head — typecheck, tests, image build and e2e have never exercised the rename. A local git merge-tree of this head against current main (ccf393b8) resolves with zero conflicts, so a rebase/merge-and-rerun should be cheap. Recommend updating the branch and getting CI green before merge.

nit — docs/REORG-PLAN.md still lists the knative-server rename as an open question; now that it has landed here, that entry could be marked resolved (or pointed at this PR / ADR-0041's addendum). Not blocking.

Author: pdettori (MEMBER — maintainer)
Areas reviewed: rename completeness (code, Dockerfile, shell, lockfile), docs/ADR
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: DCO pass; all other checks not run (PR reported dirty)

Verified on head 999d209: full-tree grep for knative-server/@moca/knative-server (only historical ADR/spec hits), git merge-tree --write-tree against origin/main ccf393b (clean), gh pr checks, and gh api mergeable state.

Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).

@clawgenti clawgenti 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.

(Marker for the review bot — see the full review above for the substantive findings.)

Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).

The package was never Knative-specific: it is the data-plane HTTP server and
the P6 worker entrypoint the supervisor forks. ADR-0041 kept the code as
P6-load-bearing and called the name historical; the rename decision it left
owed lands here.

- packages/knative-server -> packages/server, @moca/knative-server ->
  @moca/server
- the supervisor's DEFAULT_WORKER_ENTRY, the Dockerfile COPY/WORKDIR, the
  compose image test and current docs name the new path
- ADRs, specs and the reorg plan keep the old name as historical records;
  ADR-0041 gains a 2026-11-12 revision noting the rename

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
- the DEFAULT_WORKER_ENTRY pin anchors on packages/server, so it no longer
  also matches the old knative-server path
- README and Dockerfile comments rewrapped where the "name historical"
  parenthetical was removed (README lost an orphaned closing paren)
- server.ts's isMainModule rationale no longer hinges on the word "server"
- REORG-PLAN open question 7 records the rename as answered

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
@pdettori
pdettori force-pushed the rename-knative-server-to-server branch from 999d209 to a583323 Compare November 16, 2026 14:45
@pdettori

Copy link
Copy Markdown
Member Author

Review round addressed (head a583323e):

  • Branch updated. Rebased onto current main (a7d568d6). The rebase was clean: no file remains under packages/knative-server/, and outside the historical ADRs/specs the tree has no knative-server reference except the already-obsolete experiments/MOVED.md:18 noted in the first review. pnpm install --frozen-lockfile and pnpm -r typecheck pass. Locally, supervisor gives 239 passed / 3 skipped and server 576 passed (with Redis).
  • docs/REORG-PLAN.md open question 7 is marked partly answered: the rename landed here, but the sandbox-transport extraction it also asks about is still open.
  • Inline nits: fixed in a583323e, with a reply in each thread.

This is a fork-head PR, so ci.yml may need a maintainer to approve the workflow run before it fires.

Assisted-By: Claude Code

@ingpaolodettori-dev ingpaolodettori-dev 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.

Summary

Follow-up to our REQUEST_CHANGES at 999d209. The branch is now rebased onto current main (a7d568d, 0 behind, mergeable), so the blocker is gone. CI ran on the rename this time. I checked the rebase with git range-diff: the only differences in the rename commit come from main's own context. a583323 closes both of our nits and cwiklik's three: the worker-entry pin is separator-anchored (/[/\\]packages[/\\]server[/\\]src[/\\]worker\.ts$/), the isMainModule rationale is reworded, the README orphaned paren is gone, and the Dockerfile comment is rewrapped. REORG-PLAN Q7 is marked partly answered. The tree has no packages/knative-server directory. Outside the historical ADRs/specs, no knative-server / @moca/knative-server reference remains in code, CI, deploy or scripts. Renamed files differ from their originals only by the name/comment/pathspec updates.

Optional: experiments/MOVED.md:18 still cites packages/knative-server/test/swebench-sandbox-pool.test.ts. That test doesn't exist at either path, so the line was already stale and can be fixed separately.

Author: pdettori (MEMBER — maintainer)
Areas reviewed: rename completeness (code, Dockerfile, shell, CI, lockfile), docs/ADR, prior review threads
Agent/IDE config (.claude/.vscode): none
Commits: 2 commits, all signed-off: yes
CI status: green except k8s-kind-e2e, deploy-scripts, deploy-scripts-bash32 (pending at draft time)

Assisted-By: Claude Code

@pdettori
pdettori merged commit fb9d839 into rossoctl:main Nov 16, 2026
17 checks passed
@pdettori
pdettori deleted the rename-knative-server-to-server branch November 16, 2026 15:02
webchang added a commit to webchang/moca that referenced this pull request Nov 16, 2026
Upstream main at 032c8f6 (merge of rossoctl#818). Brings, since ccf393b:
- rossoctl#819: the retire/reject guard for an active session pinned to a build,
  with ownership.ts's index of the sessions pinned to each build;
- rossoctl#804: packages/knative-server renamed to packages/server;
- rossoctl#818: a registered build is reused only while a fresh host holds its
  snapshot (no fresh host at all: reused as before), and a supersede at
  registration narrowed to rebuildOf-flagged rebuilds (excludes the
  reporting host, records claim.held, moves the leases); buildById and
  buildByRef.

The fork carried earlier ports of rossoctl#818 and rossoctl#819 (d43a7a8 stillHeld;
144314a and e674b3c the pinned-session retire guard and its pruning).
Upstream's versions win. Conflicts, each resolved to upstream's side:
- docs/api/openapi.yaml: the create's reuse paragraph (fresh hosts,
  supersede) and retire's build_in_use wording.
- packages/control-plane/src/ownership.ts: buildSessionsKey's comment
  (retire or reject), indexSession and cascadeDelete's key local, and
  hasActiveSessionOnBuild's comment.
- packages/control-plane/src/sandbox-handlers.ts: stillHeld (fresh hosts,
  heldFresh, no fresh host means reuse) and buildsInUse's comment.
- packages/control-plane/test/activation.test.ts: the pinned-session
  retire test and the pruning test, as upstream has them.
- packages/control-plane/test/template-create.test.ts: the reuse test,
  plus upstream's stale-host and no-fresh-host cases.

After the resolution these five files are byte-identical to upstream's,
so no fork duplicate of the ports remains. CHANGELOG.md is upstream's.
No fork-only file references packages/knative-server.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
@pdettori pdettori added this to the v0.11.0 milestone Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants