Skip to content

feat(node): add scheduled inbound mirror worker - #347

Draft
gnanam1990 wants to merge 9 commits into
Gitlawb:mainfrom
gnanam1990:codex/b1b-inbound-mirror-worker-v2
Draft

feat(node): add scheduled inbound mirror worker#347
gnanam1990 wants to merge 9 commits into
Gitlawb:mainfrom
gnanam1990:codex/b1b-inbound-mirror-worker-v2

Conversation

@gnanam1990

Copy link
Copy Markdown

Dependency

This is a stacked follow-up to #333.

Summary

  • Add a default-off scheduled worker for stable INBOUND mirror rows.
  • Keyset-page all eligible repositories and isolate a failure to its repository.
  • Serialize updates with the existing process-local lease, global Git semaphore, and PostgreSQL advisory write lock.
  • Recheck mirror authority under the write locks before fetching.
  • Fetch external HTTPS upstreams atomically into branches and tags while preserving Gitlawb internal and review refs.
  • Bound and reap Git child processes.

Network and credential safety

  • Require owner-only push enforcement before the worker can start.
  • Validate and pin every DNS answer used by Git.
  • Reject private, local, special-purpose, translated-private, and documentation address ranges.
  • Disable redirects, proxies, ambient credentials, cookies, extra headers, submodules, and alternate protocols.
  • Reject repository-local URL rewrites and network or credential configuration.
  • Keep valid upstream paths containing an equals sign intact at the Git configuration boundary.

Scope

This PR covers the scheduled-fetch portion of Track B1.

Not included here:

  • webhook-triggered fetches
  • inbound-to-outbound transition execution
  • upstream writeback
  • a public API or CLI that activates inbound state

Verification

Passed locally:

  • cargo build --locked -p gitlawb-node
  • cargo clippy --locked -p gitlawb-node --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • 12 upstream worker and configuration tests
  • 41 peer address-policy tests
  • 12 mirror-state tests
  • real Git HTTPS transport regression for equals-sign paths

The complete local node test binary finished with 842 of 849 passing. The seven failures are the same host-load-sensitive object-count, deadline, process-watchdog, and IPFS timing names already observed on the B1a baseline; all changed-path tests passed.

A multi-lens internal review reproduced and fixed three blocking defects before this draft was opened: broken HTTPS startup from empty client-certificate settings, incomplete special-purpose address rejection, and invalid Git configuration parsing for equals-sign paths.

Origin-Session: local-d6a143 | Codex | 12 prompts
Origin-Session: local-d6a143 | Codex | 14 prompts
Origin-Session: local-d6a143 | Codex | 16 prompts
Origin-Session: local-d6a143 | Codex | 20 prompts
Origin-Session: local-d6a143 | Codex | 20 prompts
Origin-Session: local-d6a143 | Codex | 21 prompts
Origin-Session: local-d6a143 | Codex | 18 prompts
Origin-Session: local-d6a143 | Codex | 24 prompts
Origin-Session: local-d6a143 | Codex | 24 prompts
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 03ab2892-3180-4b4b-87e2-b3fe3619cc1b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@beardthelion beardthelion added crate:node gitlawb-node — the serving node and REST API kind:feature New capability or surface subsystem:peers Peer announce, discovery, and registry subsystem:visibility Path-scoped visibility and content withholding labels Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crate:node gitlawb-node — the serving node and REST API kind:feature New capability or surface subsystem:peers Peer announce, discovery, and registry subsystem:visibility Path-scoped visibility and content withholding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants