Skip to content

Protect transferred environment files from Git staging - #706

Merged
sambitcreate merged 7 commits into
mainfrom
feature/remote-environment-ignore
Nov 6, 2026
Merged

sambitcreate merged 7 commits into
mainfrom
feature/remote-environment-ignore

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

A source-only Git ignore rule can make an environment file eligible for transfer even though the cloned destination would stage it. Before writing selected files, the receiving host requires each name to be ignored by repository rules in both Git case-matching modes. The clone is rejected if either check fails, and user-level excludes alone do not satisfy admission.

A real-clone regression reads an environment file ignored only by the source and verifies the unprotected destination is rejected. A follow-up regression covers .env* followed by !.ENV.local with case-insensitive staging. Before the follow-up, transfer succeeded and ordinary git add -A -- . staged the synthetic secret. It is now rejected before publication. A destination with a committed .env* rule still accepts the file and ordinary staging leaves it out. Another regression verifies that a global exclude alone cannot satisfy the check.

Validation

  • Focused workspace intake, Remote workspace and peer-project suites: 43 passed, 1 platform skip.
  • Focused ESLint and git diff --check passed.
  • On the initial change, TypeScript passed, Android AidenRemoteClientTest passed, and iOS AidenRemoteClientTests passed on an iPhone 17 Pro iOS 26.2 simulator. The follow-up changes only the server Git checks and fixtures.
  • Independent security review identified the original mixed-case negation bypass. Both case modes are now checked before transfer. The policy intentionally rejects transfers protected only by global Git excludes.

CI execution-budget interruption

Electron E2E (3/3) exceeded the existing 20-minute job budget after starting 110/117 tests; the last started case was tests/e2e/workspace-panel.spec.ts:306. No failed assertion or flaky-test result was reported before cancellation in the inspected log. Run/job, exact head 03d02eb3a248201f1618a9f835828ebf46840512.

The workflow subsequently completed. After verifying the PR remained open at the exact job/run head, one job recovery was accepted on 2026-11-03. This spends the single recovery budget; no additional manual recovery will be requested for this job. Timeouts, retries and fail-on-flaky policy remain unchanged.

Single recovery outcome

The one permitted recovery job also exceeded the fixed 20-minute job budget. All 117 cases had started; the last was tests/e2e/workspace-panel.spec.ts:525 (browser superseded create), four seconds before cancellation. No assertion failure or flaky-test result was reported before cancellation in the inspected log. This is not a completed passing shard. The recovery budget is spent: no further manual rerun, no timeout/retry/gate weakening and no no-op CI reset. Exact-head hosted validation remains blocked while independent work continues.

Scheduling correction and fresh validation

PR #719 refreshes the Electron file weights using the observed shard windows and adds an independent completed-run comparison. This PR now targets that dependency, which is stacked on the separate UUID correction in #718. The environment-ignore diff remains scoped to this finding. The previous cancelled job and single recovery above remain part of the record; no further rerun was requested. The dependency merge creates a new exact head for fresh CI with the original shard count, worker count, timeouts and flake policy unchanged.

After merging the dependencies, the focused workspace-intake, Remote workspace and peer-project-source tests passed (42 tests), as did CI policy (67 tests), CI registry (15 tests), targeted ESLint and git diff --check.

@pullfrog pullfrog Bot 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.

Caution

The new admission check still allows transferred secrets to be staged by ordinary Git operations when a case-insensitive destination has a differently cased negation rule.

Reviewed changes Reviewed destination environment-file admission, the shared Git helper, clone regression coverage, and the corresponding documentation.

  • Destination admission: Selected environment files must pass a case-sensitive, repository-only ignore check before creation in the private clone.
  • Git helper reuse: The destination uses the existing bounded Git subprocess helper exported from the source-transfer service.
  • Tests and documentation: Added source-only-exclude and case-matching regressions, updated security fixtures, and documented the destination requirements. All 44 focused tests passed on Linux; a separate reproduction confirmed the remaining staging gap described inline.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

@pullfrog pullfrog Bot 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.

✅ No new issues found.

Reviewed changes Reviewed the changes since 7c60fdf, covering the dual-case Git admission check, regression coverage, and updated documentation.

  • Required both case modes: Environment filenames must pass repository-only ignore checks with both core.ignoreCase=false and core.ignoreCase=true, closing the mixed-case negation bypass.
  • Extended behavioral coverage: Added rejection tests for mixed-case negations and global-exclude-only protection, and verified ordinary staging leaves an accepted environment file out of the index.
  • Updated the documented policy: Clarified both case-matching requirements in the Remote guides and project memory.

Validation: all 46 focused clone, workspace, source-transfer, and handler tests passed on Linux; focused ESLint passed. macOS-specific filesystem behavior was not rerun.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@sambitcreate
sambitcreate changed the base branch from main to feature/ci-e2e-rebalance November 3, 2026 01:47
Base automatically changed from feature/ci-e2e-rebalance to main November 3, 2026 20:06
Main's four-shard E2E layout replaces this branch's CI weight changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sambitcreate
sambitcreate merged commit 06454cf into main Nov 6, 2026
29 checks passed
@sambitcreate
sambitcreate deleted the feature/remote-environment-ignore branch November 6, 2026 14:56
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