Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,10 @@ jobs:

# Both figures go into the PR description between marker comments, so
# a merge that takes the description as its message carries them too.
# A pull request from a fork gets a read-only token that cannot edit its
# description; the job summary and the uploaded reports still have them.
- name: Publish coverage numbers to the pull request
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
Expand Down
4 changes: 2 additions & 2 deletions CURRENT-STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ coordination branch. Detailed state belongs in each linked status file.
| `website` | 2026-09-16 | Deliver the website autonomy experiment: repository-owned landing/docs/blog content, independently developable website submodule, local preview and publishing mechanism | paused 2026-09-30; producer migration merged in PR #152 and the versioned documentation live; W04-C, W09-C, W11-C retained | `ws-website/contract-v1` | [workstream status](engineering-docs/wip/2026-09-16-website/CURRENT-STATUS.md) |
| `capsule-webconsole` | 2026-10-09 | Serve a token-gated web console from every capsule: configuration, versions, info, live resources, later records and workflow state | active; work order accepted 2026-10-09; the first iteration, deliverables 1 and 2, is three stacked pull requests, #184, #186 and the runtime-and-base slice, each reviewed by the Codex pair; the owner merges | `ws-capsule-webconsole/first-slice` | [workstream status](engineering-docs/wip/2026-10-09-capsule-webconsole/CURRENT-STATUS.md) |
| `wrapped-projects` | 2026-11-02 | Wrap a foreign repository as a submodule of a small wrapper project and work on it in a capsule with three commands; FRC learning project first | active; PR1 (#333) accepted by the owner 2026-11-03, awaiting merge; the project-capabilities design handed to workflow-improvements | `ws-wrapped-projects/wrap` | [workstream status](engineering-docs/wip/2026-11-02-wrapped-projects/CURRENT-STATUS.md) |
| `macos-launcher` | 2026-11-03 | Run the DevCapsule launcher natively on Apple Silicon Macs against Docker Desktop, with capsules as `linux-amd64` under emulation | active 2026-11-03; slices 1 to 4 done, the PyCharm smoke passing on an Apple Silicon Mac; waits on publication and the owner's rulings | `ws-macos-launcher/host-port` | [workstream status](engineering-docs/wip/2026-11-03-macos-launcher/CURRENT-STATUS.md) |
| `linux-arm64` | 2026-11-04 | Run capsules as `linux-arm64` as well as `linux-amd64`: natively on Apple Silicon Macs and on ARM Linux hosts | active 2026-11-04; slices 1 to 4 done, six IDEs running natively on Apple Silicon; waits on publication, the owner's arm64 base and rulings | `ws-linux-arm64/capsules` | [workstream status](engineering-docs/wip/2026-11-04-linux-arm64/CURRENT-STATUS.md) |
| `macos-launcher` | 2026-11-03 | Run the DevCapsule launcher natively on Apple Silicon Macs against Docker Desktop, with capsules as `linux-amd64` under emulation | active 2026-11-03; slices 1 to 4 done, on `main` since #338; waits on the owner's rulings | `ws-macos-launcher/host-port` | [workstream status](engineering-docs/wip/2026-11-03-macos-launcher/CURRENT-STATUS.md) |
| `linux-arm64` | 2026-11-04 | Run capsules as `linux-arm64` as well as `linux-amd64`: natively on Apple Silicon Macs and on ARM Linux hosts | active 2026-11-04; on `main` since #338, arm64 base published; the follow-up turns `main`'s CI green; waits on the owner's rulings | `ws-linux-arm64/mirror-and-published-base` | [workstream status](engineering-docs/wip/2026-11-04-linux-arm64/CURRENT-STATUS.md) |
| `website` | 2026-09-16 | Deliver the website autonomy experiment: repository-owned landing/docs/blog content, independently developable website submodule, local preview and publishing mechanism | paused 2026-09-20 at owner request to switch to maintenance; experiment accepted, A−; blog integrated and published; content/parent-integration follow-ups remain | `ws-website/initial-cut`; renamed from `website/initial-cut`; preparation and backlog-handoff exceptions in status | [workstream status](engineering-docs/wip/2026-09-16-website/CURRENT-STATUS.md) |

Paused and blocked workstreams remain open until they conclude successfully or
Expand Down
27 changes: 3 additions & 24 deletions devcapsule-src/devcapsule/configuration/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
)
from .capabilities import CapabilityPolicy, LocalCapabilities, requirement
from .capability_commands import check_documents, pin_selection
from .capability_selection import compose_lock, effective_lock, generate_lock, local_pins, matrix_for
from .capability_selection import compose_lock, effective_lock, generate_lock, local_pins
from .file_formats import (
AuthorizationScalar,
ConfigurationFileKind,
Expand Down Expand Up @@ -315,8 +315,6 @@ class InitializeReport:
checkout_record: Path
# None when the owner's checkout has no IDE yet: nothing to resolve.
resolve: ResolveReport | None
# The lock pins a base its registry does not hold yet (see ResolutionMatrix.base_unpublished).
base_unpublished: bool

def render(self) -> str:
required = " ".join(self.required) or "none"
Expand All @@ -330,9 +328,6 @@ def render(self) -> str:
if self.offered:
lines.append(f"Offers: {' '.join(self.offered)}")
lines.append(f"{self.lock_action} {self.lock_path} (base {self.base_display})")
if self.base_unpublished:
lines.append("Its base is not published yet: a checkout runs this lock only on a locally built base of "
"the same recipe, selected with 'devcapsule project config authorize base-image IMAGE'.")
for name, value, justification in self.recommendations:
line = f"Recommended {name} = {value} for every checkout"
lines.append(f"{line} ({justification})." if justification else f"{line}.")
Expand Down Expand Up @@ -551,7 +546,6 @@ def persist() -> None:
base_display=_base_display(shared_lock), recommendations=recommendations,
selection=selection, answered=(), carried=(), recommended=(),
checkout_record=record.input_path, resolve=None,
base_unpublished=_pins_unpublished_base(shared_lock),
)
lock = effective_lock(manifest, compose_lock(manifest, shared_lock, record.document), record.document, warn=False)
declarations = authorization_declarations(manifest, lock)
Expand Down Expand Up @@ -579,7 +573,6 @@ def persist() -> None:
answered=tuple(settled.answered), carried=tuple(settled.carried),
recommended=accepted_recommendations, checkout_record=record.input_path,
resolve=resolve_report,
base_unpublished=_pins_unpublished_base(shared_lock),
)


Expand All @@ -596,9 +589,7 @@ def _elicit_platform(elicitor: Elicitor, root: Path) -> Platform:
native = runnable[0]
locked = next((platform for platform in runnable if platform_lock_path(root, platform).is_file()), None)
choices = " or ".join(
f"{platform} ({'native' if platform is native else 'emulated'}"
+ ("; its base is built locally" if _base_unpublished(MATRICES[platform]) else "") + ")"
for platform in runnable
f"{platform} ({'native' if platform is native else 'emulated'})" for platform in runnable
)
answer = elicitor.seek(
"platform",
Expand Down Expand Up @@ -638,16 +629,11 @@ def validate(value: str) -> str:
return validate


def _base_unpublished(matrix: ResolutionMatrix) -> bool:
"""Whether every base ``matrix`` pins is still unpublished."""
return all(matrix.base_unpublished(base.reference) for base in matrix.base_images())


def _initialize_report(
manifest_path: Path, manifest_action: str, identity: _ProjectIdentity, lock_path: Path, lock_action: str,
*, base_display: str, recommendations: list[tuple[str, str]], selection: _OwnerSelection,
answered: tuple[str, ...], carried: tuple[str, ...], recommended: tuple[str, ...],
checkout_record: Path, resolve: ResolveReport | None, base_unpublished: bool,
checkout_record: Path, resolve: ResolveReport | None,
) -> InitializeReport:
return InitializeReport(
manifest_path=manifest_path,
Expand All @@ -672,15 +658,9 @@ def _initialize_report(
recommended=recommended,
checkout_record=checkout_record,
resolve=resolve,
base_unpublished=base_unpublished,
)


def _pins_unpublished_base(lock: Mapping[str, Any]) -> bool:
"""Whether ``lock`` pins a base its registry does not hold yet."""
return matrix_for(lock).base_unpublished(str(lock.get("base", {}).get("reference")))


def _base_display(lock: Mapping[str, Any]) -> str:
base = lock.get("base")
if isinstance(base, dict) and isinstance(base.get("reference"), str):
Expand Down Expand Up @@ -1656,7 +1636,6 @@ def _apply_answers_to_standing_checkout(
base_display=base_display, recommendations=[], selection=_existing_selection(root, manifest),
answered=tuple(settled.answered), carried=tuple(settled.carried), recommended=(),
checkout_record=record.input_path, resolve=resolve_report,
base_unpublished=_pins_unpublished_base(lock),
)


Expand Down
10 changes: 0 additions & 10 deletions devcapsule-src/devcapsule/environment_realization.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,6 @@ def realize_environment(
selection.local_image_identity if local_authorization else locked.base_identity
)

if not local_authorization and base_override is None:
from devcapsule.resolution_matrix import MATRICES

if MATRICES[capsule_platform].base_unpublished(base_reference):
raise CliError(
f"The lock's base {base_reference} is not published yet, so it cannot be pulled. Build the "
f"{capsule_platform} base locally ('devcapsule images build --type base --recipe ubuntu-24.04 "
f"--platform {capsule_platform} --tag IMAGE --source-revision REVISION') and select it "
"for this checkout ('devcapsule project config authorize base-image IMAGE')."
)
if obtain_image is not None:
obtain = obtain_image
elif local_authorization:
Expand Down
25 changes: 9 additions & 16 deletions devcapsule-src/devcapsule/resolution_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Capability:

@dataclass(frozen=True)
class _BasePin:
"""One base image and the capabilities it ships."""
"""One published base image and the capabilities it ships."""

mnemonic: str
# The family of base releases this pin belongs to — see _VerifiedEdge:
Expand All @@ -123,9 +123,6 @@ class _BasePin:
runtime: str = LAUNCHER_SUPPLIED_RUNTIME
source_revision: str | None = None
# A clean public-source builder need not have a release tag.
# False while the reference names an image its registry does not hold
# yet: only a locally built base of the same recipe stands in for it.
published: bool = True

@property
def contract(self) -> BaseContract:
Expand Down Expand Up @@ -250,10 +247,6 @@ def base_family(self, lock: Mapping[str, Any]) -> str | None:
return next((base.base_family for base in self._bases
if base.lock_table.get("reference") == reference), None)

def base_unpublished(self, reference: str) -> bool:
"""Whether the pinned base at ``reference`` is not in its registry yet."""
return any(base.lock_table.get("reference") == reference and not base.published for base in self._bases)

def base_image(self, reference: str) -> BaseImage | None:
"""The pinned base at ``reference``, described by its contract."""
return next((base.image for base in self._bases
Expand Down Expand Up @@ -1724,11 +1717,11 @@ def _formation(
# the public main commit b3f10b7d, whose devcapsule-webconsole the image
# installed. Inspected: linux/arm64, recipe 11 ready, display=contained,
# runtime=launcher-supplied, all six services, the web console root.
# Not published yet. The reference is the digest of the OCI image index in
# the builder's containerd store, which a push of this exact image to
# mycodespaceai/devcapsule-base keeps; a rebuild gets another digest and
# must be pinned again. Until the owner pushes it, a checkout selects the
# local image: `project config authorize base-image IMAGE`.
# This exact image was pushed as
# mycodespaceai/devcapsule-base:linux-arm64-recipe-11-20261104 at 15:29 UTC
# the same day; the digest below, its OCI image index, was read from the
# registry after the push. A rebuild gets another digest and must be
# pinned again.
_LINUX_ARM64_RECIPE_11_BASE = _BasePin(
mnemonic="v0.3.1.dev0-local-macos-aarch64",
source_revision="b3f10b7d95aec659f268afecc03d0912a2e89d2f",
Expand All @@ -1740,7 +1733,6 @@ def _formation(
recipe=11,
display=CONTAINED_DISPLAY,
runtime=LAUNCHER_SUPPLIED_RUNTIME,
published=False,
lock_table={
"reference": (
"docker.io/mycodespaceai/devcapsule-base"
Expand Down Expand Up @@ -1782,8 +1774,9 @@ def _on_linux_arm64(pin: _ComponentPin) -> _ComponentPin:
},
edges=(
# Native IDE smokes on Apple Silicon (Docker Desktop 29.3.1) against
# the local, unpublished arm64 recipe-11 base above. They establish
# the IDE only: Playwright and the .NET SDK rode along unexercised.
# the arm64 recipe-11 base above, run on the local image before its
# push. They establish the IDE only: Playwright and the .NET SDK rode
# along unexercised.
_VerifiedEdge(
"codium", "1.143.17232", _BASE_FAMILY_UBUNTU_24_04,
"noVNC HTTP/window startup passed natively on the local arm64 recipe-11 base, "
Expand Down
15 changes: 0 additions & 15 deletions devcapsule-src/tests/configuration/test_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
invoke,
replace_answers,
)
from devcapsule.launch.pycharm import DockerMode, PycharmRunOptions, build_run_config
from devcapsule.platforms import Platform
from tests.test_pycharm import base_env

pytestmark = pytest.mark.legacy

Expand Down Expand Up @@ -293,18 +290,6 @@ def test_independent_invalid_values_are_reported_together(checkout, capsys):
assert 'editor.theme' in message and 'service.port' in message


def test_launcher_environment_cannot_override_explicit_sudo_denial(checkout, tmp_path):
project, _, _ = checkout
env = base_env(tmp_path)
env['PYCHARM_ENABLE_SUDO'] = '1'
# ProjectRunCommand passes enable_sudo=False for the persisted denial.
# Check the NEXT boundary, rather than replacing it with a launch mock.
config = build_run_config(
PycharmRunOptions(project=project, capsule_platform=Platform.LINUX_AMD64, docker_mode=DockerMode.none, enable_sudo=False), env,
)
assert config.enable_sudo is False


def test_shipped_cli_recommendation_override_and_omission(checkout, capsys):
project, record, resolution = checkout
declaration = project / '.devcapsule/devcapsule.toml'
Expand Down
34 changes: 0 additions & 34 deletions devcapsule-src/tests/configuration/test_invariants.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
ProvidedAnswer,
initialize_project,
)
from devcapsule.launch.pycharm import DockerMode, PycharmRunOptions, build_run_config
from devcapsule.platforms import Platform
from tests.test_pycharm import base_env
from tests.test_upgrade_recovery import checkout, invoke, install_external_fakes

pytestmark = pytest.mark.legacy
Expand Down Expand Up @@ -222,37 +219,6 @@ def test_a_removed_binding_never_reaches_the_launch(checkout, monkeypatch):
assert 'bindings' not in derived.get('state', {}) and 'secret' not in derived


def test_project_launch_cannot_inherit_unbound_paths_or_credentials(checkout, tmp_path):
project, _, _ = checkout
env = base_env(tmp_path)
unbound = tmp_path / 'unbound'
env.update({
'DEVCAPSULE_HOME_DIR': str(unbound), 'PYCHARM_IDE_CONFIG_DIR': str(unbound),
'PYCHARM_PLUGIN_DIR': str(unbound), 'GITHUB_TOKEN_FILE': str(unbound / 'secret'),
'PYCHARM_GIT_TOKEN_ENV': 'UNBOUND_TOKEN', 'PYCHARM_ENABLE_SUDO': 'invalid',
'DOCKER_MODE': 'invalid',
})
config = build_run_config(PycharmRunOptions(
project=project, capsule_platform=Platform.LINUX_AMD64, inherit_legacy_configuration=False,
docker_mode=DockerMode.none, enable_sudo=False, network_mode='bridge',
), env)
assert config.persistent_home != unbound and config.ide_config != unbound and config.plugins != unbound
assert config.git_token_file is None and config.git_token_env == ''
assert config.enable_sudo is False and config.docker_mode == 'none' and config.network_mode == 'bridge'
assert not unbound.exists()


@pytest.mark.parametrize('value', [False, True, None])
def test_explicit_sudo_decision_overrides_legacy_environment(value, tmp_path):
project = tmp_path / 'project'
project.mkdir()
env = base_env(tmp_path)
env['PYCHARM_ENABLE_SUDO'] = '1'
config = build_run_config(PycharmRunOptions(project=project, capsule_platform=Platform.LINUX_AMD64, docker_mode=DockerMode.none,
enable_sudo=value), env)
assert config.enable_sudo is (True if value is None else value)


@pytest.mark.parametrize('field,value', [('memory-limit-bytes', '8GiB'), ('memory-limit-bytes', True),
('cpus', 0), ('component', []), ('project-mount', 3), ('image', [])])
def test_an_invalid_derived_plan_is_refused_as_a_value(checkout, field, value):
Expand Down
Loading
Loading