oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package claude
2
3import (
4 "amadan.net/oficina/equipo/internal/runner/provider"
5 "context"
6 "crypto/rand"
7 "testing"
8)
9
10// Test-only constructor keeps fake executable digests out of production APIs.
11func CoordinatorContinuityFixture(t *testing.T, wrap func(provider.ProcessHost) provider.ProcessHost, captures provider.CaptureFactory, source provider.Binding) (provider.Launcher, provider.Launch, func() error, func()) {
12 f := fixtureFor(t, "Engineering")
13 if source.ID != "" {
14 if err := f.lease.Close(); err != nil {
15 t.Fatal(err)
16 }
17 var err error
18 f.lease, err = provider.OpenAccount(context.Background(), source)
19 if err != nil {
20 t.Fatal(err)
21 }
22 }
23 f.launch.Binding = f.lease.Binding()
24 profile, _ := provider.Profile("coordinate")
25 in := f.inputs
26 in.Action = "coordinate"
27 in.Tools = profile.MCPTools()
28 var err error
29 in, err = PolicyInputs(f.lease.Binding(), in, profile.Specialist, f.launch.Selection.Model)
30 if err != nil {
31 t.Fatal(err)
32 }
33 f.launch.Policy, err = provider.BuildPolicy(f.lease.Binding(), in)
34 if err != nil {
35 t.Fatal(err)
36 }
37 f.launch.AttemptKey = rand.Text()
38 f.l.host = wrap(f.host)
39 f.l.captures = captures
40 _ = rand.Text()
41 return f.l, f.launch, f.lease.Close, func() {
42 f.host.mu.Lock()
43 defer f.host.mu.Unlock()
44 found := false
45 for _, args := range f.host.argv {
46 for _, arg := range args {
47 if arg == "--resume" {
48 t.Fatal("coordinator resumed Claude history")
49 }
50 if arg == "--session-id" {
51 found = true
52 }
53 }
54 }
55 if !found {
56 t.Fatal("missing fresh session-id")
57 }
58 }
59}
60