-
Notifications
You must be signed in to change notification settings - Fork 0
feat(g01): connect paired terminal execution to bounded broker handoff #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jjangg96
wants to merge
39
commits into
main
Choose a base branch
from
orca/g01-paired-broker
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
3acd5ab
test(g01): preserve paired handoff red cases
jjangg96 507850c
feat(g01): wire paired terminal through bounded broker
jjangg96 ad7c2cf
fix(g01): complete paired broker handoff
jjangg96 a5fcffd
Merge remote-tracking branch 'origin/main' into orca/g01-paired-broker
jjangg96 a0df276
test(g01): capture paired prerequisite history contract
jjangg96 278d8e9
test(g01): cover paired admission history and bounds
jjangg96 419f9cd
fix(g01): preserve paired prerequisites and bound terminal authority
jjangg96 413f2fa
test(g01): stamp bridge binary from clean checkout
jjangg96 9b4f86c
test(g01): retain safe bridge failure category
jjangg96 45c8447
test(g01): expose bridge protocol counters on failure
jjangg96 c440f0e
test(g01): probe paired preparation bridge
jjangg96 b5a5a1b
test(g01): classify offline paired bridge failure
jjangg96 48f95e2
test(g01): trace offline paired bridge stages
jjangg96 1ad9aec
test(g01): isolate worker fixture admission root
jjangg96 6ef7f33
test(g01): diagnose worker fixture journal opening
jjangg96 8c298d0
test(g01): trace worker fixture admission failure
jjangg96 a9f2c43
test(g01): preserve worker journal failure stage
jjangg96 0276d2d
test(g01): trace worker admission fixture failure
jjangg96 0585f52
test(g01): retain detailed worker admission stage
jjangg96 aa99d5f
test(g01): canonicalize worker fixture admission path
jjangg96 898c7c1
test(g01): record bounded bridge route sequence
jjangg96 12ae09c
test(g01): align bridge session statistics
jjangg96 aac1127
test(g01): identify unexpected bridge route
jjangg96 cca479a
test(g01): accept queue authority for job acquisition
jjangg96 c61dc22
test(g01): finalize private paired bridge fixture
jjangg96 caa29f7
test(g02): retain failed paired claim before inspect
jjangg96 895a478
test(g02): fence paired mint on short parent authority
jjangg96 811e6bc
docs(g01): record paired broker second-fix evidence
jjangg96 0ecb06c
docs(g01): record full root check result
jjangg96 74efbde
Merge remote-tracking branch 'origin/main' into orca/g01-paired-broker
jjangg96 6a35fe7
fix(g01): gate paired worker preparation before mint
jjangg96 9df5d42
fix(g01): canonicalize fixture worker admission root
jjangg96 8c59523
test(g01): exercise real paired cadence bridge
jjangg96 4aab247
fix(g02): bind worker receipt and finite ledger capacity
jjangg96 1748279
docs(g01): record third paired broker evidence
jjangg96 1ebf0b1
docs(g01): refresh final cadence timing
jjangg96 bf27872
fix(ci): split G02 offline deadline gate
jjangg96 92632dd
fix(g02): revalidate worker claim and split G02 remainder
jjangg96 773cccc
fix(g02): pin worker claim path to preparation contract
jjangg96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| //go:build g01_live && g01_pair_fixture | ||
|
|
||
| package main | ||
|
|
||
| import ( | ||
| "context" | ||
| "io" | ||
| "os" | ||
| "path/filepath" | ||
| "syscall" | ||
|
|
||
| "github.com/1XP-AI/gh-runnerd/experiments/g01-scaleset/livecanary" | ||
| "github.com/1XP-AI/gh-runnerd/experiments/g01-scaleset/liveworker" | ||
| ) | ||
|
|
||
| type fixtureEndpointConfig struct { | ||
| BaseURL string `json:"base_url"` | ||
| CAPEM string `json:"ca_pem"` | ||
| AdmissionDirectory string `json:"admission_directory"` | ||
| } | ||
|
|
||
| func readFixtureEndpointConfig(stateDirectory string) (fixtureEndpointConfig, error) { | ||
| var config fixtureEndpointConfig | ||
| path := filepath.Join(stateDirectory, "paired-fixture.json") | ||
| file, err := os.OpenFile(path, os.O_RDONLY|syscall.O_NOFOLLOW, 0) | ||
| if err != nil { | ||
| return config, livecanary.ErrApproval | ||
| } | ||
| defer file.Close() | ||
| info, err := file.Stat() | ||
| stat, ok := info.Sys().(*syscall.Stat_t) | ||
| if err != nil || !ok || int(stat.Uid) != os.Geteuid() || info.Mode().Perm() != 0600 || !info.Mode().IsRegular() || stat.Nlink != 1 || info.Size() > 8192 { | ||
| return config, livecanary.ErrApproval | ||
| } | ||
| data, err := io.ReadAll(io.LimitReader(file, 8193)) | ||
| if err != nil || len(data) > 8192 || livecanary.DecodeStrict(data, &config) != nil || config.BaseURL == "" || config.CAPEM == "" || config.AdmissionDirectory == "" || !filepath.IsAbs(config.AdmissionDirectory) || filepath.Clean(config.AdmissionDirectory) != config.AdmissionDirectory { | ||
| return fixtureEndpointConfig{}, livecanary.ErrApproval | ||
| } | ||
| return config, nil | ||
| } | ||
|
|
||
| func init() { | ||
| openJournalForCommand = func(stateDirectory string, a livecanary.Approval) (*livecanary.FileJournal, error) { | ||
| config, err := readFixtureEndpointConfig(stateDirectory) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return livecanary.OpenJournalForPairedFixtureAt(stateDirectory, a, config.AdmissionDirectory) | ||
| } | ||
| pairedPrepareJournalForCommand = func(stateDirectory string, a livecanary.Approval) (livecanary.PreparationReceipt, error) { | ||
| config, err := readFixtureEndpointConfig(stateDirectory) | ||
| if err != nil { | ||
| return livecanary.PreparationReceipt{}, err | ||
| } | ||
| return livecanary.PreparePairedJournalForFixtureAt(stateDirectory, a, config.AdmissionDirectory) | ||
| } | ||
| prepareWorkerJournalForCommand = func(stateDirectory string, a liveworker.Approval) (liveworker.PreparationReceipt, error) { | ||
| // Worker admission is a distinct disposable fixture root. It is derived | ||
| // from the worker state identity, never supplied by production approval | ||
| // or the broker's controller admission root. | ||
| workerStateReal, err := filepath.EvalSymlinks(stateDirectory) | ||
| if err != nil || !filepath.IsAbs(workerStateReal) || filepath.Clean(workerStateReal) != workerStateReal { | ||
| return liveworker.PreparationReceipt{}, liveworker.ErrState | ||
| } | ||
| admissionDirectory := filepath.Join(filepath.Dir(workerStateReal), "worker-admission") | ||
| if err := os.Mkdir(admissionDirectory, 0700); err != nil && !os.IsExist(err) { | ||
| return liveworker.PreparationReceipt{}, liveworker.ErrState | ||
| } | ||
| return livecanary.PrepareWorkerJournalForPairedFixtureAt(stateDirectory, a, admissionDirectory) | ||
| } | ||
| newSDKAPIForCommand = func(a livecanary.Approval, c livecanary.Credentials, stateDirectory string) (*livecanary.SDKAPI, error) { | ||
| config, err := readFixtureEndpointConfig(stateDirectory) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return livecanary.NewSDKAPIForPairedFixture(a, c, config.BaseURL, []byte(config.CAPEM)) | ||
| } | ||
| runPairedTerminalForCommand = func(ctx context.Context, files livecanary.PairedTerminalFiles, c livecanary.Credentials) error { | ||
| config, err := readFixtureEndpointConfig(files.ControllerStateDirectory) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| return livecanary.RunPairedTerminalForFixture(ctx, files, c, config.BaseURL, []byte(config.CAPEM), config.AdmissionDirectory) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
g01-liveis built withg01_pair_fixture, this override sends the broker-issued installation token to the loopback URL and CA selected bypaired-fixture.json, yetvalidBrokerBuildrejects onlyosusergoand therefore accepts a clean, correctly stamped fixture-enabled binary. Such a binary can satisfy the approved hash/build checks while replacing the production GitHub transport (for both ordinary controller execution and paired execution) with a test endpoint that can capture the credential. Make the broker reject theg01_pair_fixturebuild tag.Useful? React with 👍 / 👎.