Skip to content

1.11.3: a foreign image's kernel runs in the contract's working directory - #44

Merged
echarles merged 1 commit into
mainfrom
fix/foreign-kernel-root
Nov 1, 2026
Merged

echarles merged 1 commit into
mainfrom
fix/foreign-kernel-root

Conversation

@echarles

@echarles echarles commented Nov 1, 2026

Copy link
Copy Markdown
Member

A foreign image copies jupyter_config.py from the approved base, and the 2026.09 channel's starts a kernel in /home/datalayer/content. A real build then failed conformance:2: cwd is '/home/datalayer/content', not '/home/datalayer', with every other gating check passing. The contract layer now pins MappingKernelManager.root_dir as the current base's Dockerfile does.

Copilot AI balanced review requested due to automatic review settings November 1, 2026 09:56
@echarles
echarles merged commit caf9ed7 into main Nov 1, 2026
6 checks passed
@echarles
echarles deleted the fix/foreign-kernel-root branch November 1, 2026 09:57

Copilot AI 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.

🟡 Changes recommended

The regression assertion still accepts /home/datalayer/content, the path that caused the conformance failure, so it must check the complete assignment to distinguish the required working directory from its subdirectories.

1 open issue
What changed in this PR

This PR makes foreign-image kernels use the contract’s working directory rather than a directory inherited from the base channel’s Jupyter configuration.

Changes:

  • Pins MappingKernelManager.root_dir in the contract layer.
  • Adds a regression test for the generated configuration.
  • Bumps the package version to 1.11.3.
File Description
tests/​test_environment_foreign_contract_layer.py Adds a check for the kernel working-directory override.
code_sandboxes/​environments/​adapters/​datalayer.py Appends the contract’s kernel root directory to Jupyter configuration.
code_sandboxes/​__version__.py Updates the version to 1.11.3.

Review effort: Balanced

from code_sandboxes.environments.adapters.datalayer import _contract_user

pinned = next(line for line in _contract_user() if "MappingKernelManager.root_dir" in line)
assert "/home/datalayer" in pinned and "/usr/local/share/jupyter_config.py" in pinned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants