Skip to content

feat(setup-repo): offer a repo-specific env-file over the shared one#311

Draft
tildesrc wants to merge 3 commits into
mainfrom
panopticon/setup-repo-choose-env-file
Draft

feat(setup-repo): offer a repo-specific env-file over the shared one#311
tildesrc wants to merge 3 commits into
mainfrom
panopticon/setup-repo-choose-env-file

Conversation

@tildesrc

@tildesrc tildesrc commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

When panopticon quickstart opens a setup-repo task, it now asks whether to keep using the shared secrets file (shared.env) or give this repo its own <repo>.env credentials file — before setting up credentials.

The repo begins on the shared file (quickstart already registers it that way) and only switches when the operator picks the repo-specific option. On that choice the script:

  • creates the private <repo>.env first (the task service won't point a repo at a missing file),
  • repoints the repo record via PATCH /repos/<id> so future task containers source it, and
  • retargets the rest of the flow (PANOPTICON_ENV_FILE/env_file) so the credential lands in the new file and the "what's configured" checks reflect it.

The choice is offered only while the repo is still on the shared file, and skipped when <repo>.env would just equal shared.env (a repo literally named "shared").

This branch also renames the shared credentials file from panopticon.env to shared.env — it's the file every repo starts on, so a generic name reads better than the project's own (and the panopticon repo's own <repo>.env no longer collides with the shared file).

To let the script act on the repo record, ShellRunner.spawn gains a repo_id it exports as PANOPTICON_REPO_ID; two new shell helpers (ensure_private_env_file, set_repo_env_file) live in setup_repo_lib.sh.

Merged latest main (incl. #310's setup-repo rewrite: repo-aware summaries, adopt/paste/mint credential flows, and the new-session imsg-cap minify fix); the env-file choice is integrated into that flow as its first step.

Plan: plan.md artifact on the task.

panopticon-agent and others added 3 commits July 13, 2026 18:56
The setup-repo task (opened by `quickstart`) now asks whether to keep the
shared secrets file (panopticon.env) or give the repo its own <repo>.env,
before minting a token. The repo begins on the shared file — quickstart
registers it that way — and only switches when the operator picks the
repo-specific option: the script creates the private <repo>.env, repoints
the repo record via PATCH /repos/<id> (so future task containers source it),
retargets the flow so the minted credential lands there, and forgets the
shared file's already-sourced creds so the credential check reflects the new
file. The choice is offered only while the repo is still on the shared file
(and skipped when <repo>.env would equal panopticon.env).

ShellRunner.spawn gains a repo_id it exports as PANOPTICON_REPO_ID so the
script can act on the repo record over REST.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rename the shared credentials file from panopticon.env to shared.env — it's
the file every repo starts on, so a generic name reads better than the
project's own. Renames the packaged template (shared.env.template) and the
setup-repo choice step's shared-file constant. As a bonus the repo-specific
<repo>.env no longer collides with the shared file for the panopticon repo
itself (its <repo>.env is now panopticon.env, distinct from shared.env).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-choose-env-file

# Conflicts:
#	src/panopticon/sessionservice/shell_runner.py
#	src/panopticon/sessionservice/spawner.py
#	src/panopticon/workflows/setup_repo.sh
#	src/panopticon/workflows/setup_repo_lib.sh
#	tests/sessionservice/test_shell_runner.py
#	tests/sessionservice/test_spawner.py
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.

1 participant