Skip to content

Commit 17a14e6

Browse files
Merge pull request #248 from engineeredsoftware/v48/gate-1-identity-auth-interactive-qa
V48 Gate 1: Identity and authentication interactive QA
2 parents 09289d9 + 630ee98 commit 17a14e6

86 files changed

Lines changed: 9068 additions & 227 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BITCODE_SPEC_V48_NOTES.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
- Prior generated proof appendix: `BITCODE_SPEC_V46_PROVEN.md`
1212
- V48 state: notes-only draft opening
1313
- Scope: V48 starts as the interactive local experiential QA target over promoted V47 commercial website testnet launch canon.
14+
- QA findings ledger: `BITCODE_V48_QA.md` (the running record of accepted V48 findings and repairs)
15+
- Gate 1 (in progress): identity and authentication interactive QA on branch `v48/gate-1-identity-auth-interactive-qa`
16+
- Full draft family (`BITCODE_SPEC_V48.md`, `BITCODE_SPEC_V48_DELTA.md`, `BITCODE_SPEC_V48_PARITY_MATRIX.md`) opens in a dedicated specification-authoring gate once the interactive QA tracks have accumulated the specification intent; Gate 1 closed as the identity/authentication QA-and-repairs gate
1417

1518
## Notes-only draft rule
1619

@@ -53,6 +56,39 @@ deployed staging-testnet system end to end, step by step, and fix what breaks.
5356
- Ledgerized journaling: replayability, auditability, `/packs` page UX/UI, and
5457
the personal (Auxillaries) history of work.
5558

59+
## V48 Gate 1 in progress: identity and authentication interactive QA
60+
61+
Gate 1 exercises the live commercial testnet experience exactly as the
62+
notes-only rule directs: interactively, recording accepted findings in
63+
`BITCODE_V48_QA.md` (F1-F10 so far), and landing fail-closed repairs on the
64+
gate branch. The full draft family is authored at Gate 1 closure from this
65+
QA-driven specification intent.
66+
67+
Accepted findings converted to repairs so far:
68+
69+
- Supabase `redirect_to` law: GoTrue validates the Auth redirect allow-list by
70+
exact string match, so `redirect_to` must stay query-free. The post-auth
71+
destination travels through origin-local storage
72+
(`uapi/lib/supabase-auth-redirect.ts`) and is consumed once by the callback.
73+
This repaired wallet sign-in from both localhost and production www, which
74+
previously stranded the PKCE verifier and never minted a session.
75+
- Identity-derived wallet binding: the canonical wallet sign-up signs on the
76+
OAuth provider authorize page, so nothing is staged client-side to replay.
77+
`/api/wallet/authenticate` now derives the binding server-side from the
78+
session's GoTrue-verified `custom:bitcode-bitcoin` identity
79+
(`source: 'oauth-identity'`), and `WalletSessionPersistenceBridge` triggers
80+
it whenever a wallet-backed session has no replayable local proof.
81+
- Post-auth landing is `/packs`, not the legacy `/terminal` overlay route.
82+
83+
Specification intent surfaced for the eventual V48 family (decisions, not yet
84+
law): eradicate legacy email/phone authentication residue (`/login`,
85+
`LoginForm`, PhoneSSO) and the legacy `/terminal` route after verifying its
86+
capabilities ported to `/packs`, `/read`, and `/deposit`; decide the
87+
solo-operator organization-authority posture (personal-organization bootstrap
88+
at wallet sign-up versus a neutral unconfigured state); complete the GitHub
89+
App sessionless install staging path, whose pending-installation cookie
90+
currently has no consumer.
91+
5692
## Non-goals during V48 opening
5793

5894
- Do not implement V48 product behavior from this notes-only opening.

BITCODE_V48_QA.md

Lines changed: 168 additions & 0 deletions
Large diffs are not rendered by default.

packages/agent-generics/src/agents/factories.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* purpose: Create type-safe agent executors
1010
* pattern: factory-functions
1111
*/
12-
import { Executor } from '@bitcode/execution-generics';
13-
import { Execution } from '@bitcode/execution-generics/Execution';
12+
import type { Executor } from '@bitcode/execution-generics';
13+
import type { Execution } from '@bitcode/execution-generics/Execution';
1414
import { Agent, AgentStep } from '../types';
1515
import { z } from 'zod';
1616
export type BitcodePTRRStepName = 'plan' | 'try' | 'refine' | 'retry';
@@ -120,7 +120,6 @@ export declare function factoryAgentWithPTRRGenerations<TInput, TOutput>(config:
120120
backoff?: number;
121121
};
122122
}): Agent<TInput, TOutput>;
123-
export {};
124123
/**
125124
* factoryQuickAgent - Preferred minimal agent for simple, single-step behaviors.
126125
*
@@ -136,3 +135,4 @@ export declare function factoryQuickAgent<TInput, TOutput>(config: {
136135
description?: string;
137136
execute: (input: TInput, execution: Execution) => Promise<TOutput>;
138137
}): Executor<TInput, TOutput>;
138+
export {};

packages/agent-generics/src/diagnostics/instrumentation.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Execution } from '@bitcode/execution-generics/Execution';
1+
import type { Execution } from '@bitcode/execution-generics/Execution';
22
export declare function logLLMSubstepStart(execution: Execution, sequence: string, systemPrompt: string, userPrompt: string, combinedPrompt: string, llmConfig?: {
33
model?: string;
44
provider?: string;

packages/agent-generics/src/diagnostics/trace.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Execution } from '@bitcode/execution-generics/Execution';
1+
import type { Execution } from '@bitcode/execution-generics/Execution';
22
export interface ExecutionTraceNode {
33
id: string;
44
type: 'agent' | 'step' | 'substep' | 'execution';

packages/agent-generics/src/steps/factories.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* The 7-substep sequence:
99
* 1. PrepareConciseContext (CONTEXT SIGNAL/NOISE) → Reason→Judge→StructuredOutput
1010
* 2. ChunkThenSum (BIG INPUT) → Reason→Judge→StructuredOutput
11-
* 3. StitchUntilComplete (CONVERSATIONSUTPUT) → Reason→Judge→StructuredOutput
11+
* 3. StitchUntilComplete (large output handling) → Reason→Judge→StructuredOutput
1212
* 4. Tool execution (AFTER all failsafes, conditional on reasoning + judgment output)
1313
*/
1414
import { Executor } from '@bitcode/execution-generics';

packages/agent-generics/src/substeps/factories.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Executor } from '@bitcode/execution-generics';
2-
import { Execution } from '@bitcode/execution-generics/Execution';
1+
import type { Executor } from '@bitcode/execution-generics';
2+
import type { Execution } from '@bitcode/execution-generics/Execution';
33
import { SubStepExecution } from '../execution';
44
import { z } from 'zod';
55
import { PreparedContext, Reasoning, UseTool, Judgment, UsedTool } from '../types';

packages/agent-generics/src/types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Agents organize Actions, Actions sequence Steps, Steps sequence GenerationSteps.
66
*/
77
export type { PreparedContext } from '@bitcode/context';
8-
import { Executor } from '@bitcode/execution-generics';
8+
import type { Executor } from '@bitcode/execution-generics';
99
import { Tool } from '@bitcode/tools-generics';
1010
/**
1111
* Agent Variation Steps - The four fundamental steps
@@ -111,7 +111,7 @@ export type StepExecutor<TInput = any, TOutput = any> = Executor<TInput, TOutput
111111
/**
112112
* AgentGeneration - Preferred alias for AgentStep. A Generation is a typed
113113
* executor (input → output) that may be composed by PTRR failsafes and tools
114-
* postprocess. AgentStep remains the concrete execution shape.
114+
* postprocess. AgentStep remains the concrete execution shape.
115115
*/
116116
export type AgentGeneration<TInput = any, TOutput = any> = AgentStep<TInput, TOutput>;
117117
/**

packages/api/src/routes/auxillaries-contract.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,7 @@ export function buildOrganizationPolicyAuthority(input: {
14651465
readString(profile?.multiSigPolicyRoot) ??
14661466
null,
14671467
},
1468-
recoveryRoute: '/terminal?auxillary-open-to=profile',
1468+
recoveryRoute: '/packs?auxillary-open-to=profile',
14691469
});
14701470
}
14711471

@@ -1498,7 +1498,7 @@ export function buildAuxillariesReadinessDiagnostics(input: {
14981498
severity: readiness.connected ? 'warning' : 'blocking',
14991499
summary: `${readiness.provider} provider readiness requires repair.`,
15001500
requiredAction: readiness.requiredRepairAction,
1501-
repairRoute: '/terminal?auxillary-open-to=externals',
1501+
repairRoute: '/packs?auxillary-open-to=externals',
15021502
retryPolicy: 'after_repair',
15031503
}));
15041504
}
@@ -1511,7 +1511,7 @@ export function buildAuxillariesReadinessDiagnostics(input: {
15111511
severity: 'blocking',
15121512
summary: 'Wallet binding is missing for settlement-adjacent support actions.',
15131513
requiredAction: 'Connect and verify a Bitcoin wallet.',
1514-
repairRoute: '/terminal?auxillary-open-to=wallet',
1514+
repairRoute: '/packs?auxillary-open-to=wallet',
15151515
retryPolicy: 'after_repair',
15161516
}));
15171517
} else if (!input.walletBtdPaneState.signerPosture.ready) {
@@ -1521,7 +1521,7 @@ export function buildAuxillariesReadinessDiagnostics(input: {
15211521
severity: 'warning',
15221522
summary: 'Wallet binding exists but signer posture is not verified.',
15231523
requiredAction: input.walletBtdPaneState.signerPosture.requiredAction,
1524-
repairRoute: '/terminal?auxillary-open-to=wallet',
1524+
repairRoute: '/packs?auxillary-open-to=wallet',
15251525
retryPolicy: 'after_repair',
15261526
}));
15271527
}
@@ -1534,7 +1534,7 @@ export function buildAuxillariesReadinessDiagnostics(input: {
15341534
severity: 'warning',
15351535
summary: `${blockedInterface.interfaceId} is not admitted for the requested support surface.`,
15361536
requiredAction: blockedInterface.blockers.join(', ') || 'Review interface policy.',
1537-
repairRoute: '/terminal?auxillary-open-to=interfaces',
1537+
repairRoute: '/packs?auxillary-open-to=interfaces',
15381538
retryPolicy: 'after_repair',
15391539
}));
15401540
}
@@ -1546,7 +1546,7 @@ export function buildAuxillariesReadinessDiagnostics(input: {
15461546
severity: 'warning',
15471547
summary: 'Organization authority is not admitted for settlement-adjacent actions.',
15481548
requiredAction: 'Review organization role, grants, and wallet binding.',
1549-
repairRoute: '/terminal?auxillary-open-to=profile',
1549+
repairRoute: '/packs?auxillary-open-to=profile',
15501550
retryPolicy: 'after_repair',
15511551
}));
15521552
}
@@ -2048,7 +2048,7 @@ function buildProfileCompletenessIssue(input: {
20482048
const repairRoute: AuxillariesProfileRepairRoute = {
20492049
issueId: input.id,
20502050
pane: input.pane,
2051-
route: `/terminal?auxillary-open-to=${input.pane}`,
2051+
route: `/packs?auxillary-open-to=${input.pane}`,
20522052
label: input.label,
20532053
retryPolicy: 'after_repair',
20542054
};

packages/context/src/context.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ export declare function prepareContextForPrompt(context?: GlobalContext): {
2525
branch: string;
2626
commit: string;
2727
task: string;
28-
otfInstructions: any[] | undefined;
28+
otfInstructions: any[];
2929
};

0 commit comments

Comments
 (0)