Skip to content

Updated Auth to include Windows Compatibility using DPAPI files for o… - #4

Merged
lg2m merged 1 commit into
mainfrom
Akio-test
Aug 1, 2026
Merged

lg2m merged 1 commit into
mainfrom
Akio-test

Conversation

@lg2m

@lg2m lg2m commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

…versized secrets for WCM

@lg2m
lg2m merged commit 8ec2b57 into main Aug 1, 2026
1 of 2 checks passed
@lg2m
lg2m deleted the Akio-test branch August 1, 2026 05:26
lg2m added a commit that referenced this pull request Sep 12, 2026
Mark the four HC1 gap rows Shipped with their commits, move the plan's Now
row to HC1-in-review / HC3-next, record PROTOCOL_VERSION 18, close
decision #4 (HC1 bumps alone; HC3 will bump to 19), and add the ledger
entry with per-commit verification.
lg2m added a commit that referenced this pull request Sep 12, 2026
* feat(config): validate a document without a model in config check (HC1)

`config check` with `(version: 1)` failed with "model must be configured"
before any other rule ran. Document finalization now checks every rule
(providers, policy, profiles, packs, MCP, delegation, audit) first and
raises ModelRequired last, so ConfigLoader::check can treat that single
error as "valid apart from the selection" and return Ok(None).
ConfigSnapshot::model() stays non-optional; every run-time consumer is
unchanged and load() still requires a model.

enforce_policy takes Option<&ModelRoute>: provider-level rules (custom
endpoints, literal secrets, HTTPS, the output cap) apply without a route,
the allow/deny provider lists only with one.

Slice: speed-first HC1 (minimal configuration check)

* feat(cli): stamp --correlation labels on the headless session and run (HC1)

qq run passed Correlation::default() to both CreateSession and SubmitPrompt,
so a supervisor had no way to attribute a run without parsing its own
stdout. `--correlation KEY=VALUE` (repeatable) is split on the first `=`
at parse time, validated as one set through Correlation::new before any
configuration is loaded (protocol bounds; a repeated key is rejected rather
than last-wins), and carried on both commands. The trial record gains an
optional `correlation` field that is omitted when empty, so the default
JSONL payload is unchanged; session snapshots already echo it.

Slice: speed-first HC1 (correlation from the CLI)

* feat(protocol)!: widen model-turn limits and ordinals to u32 (HC1)

RunLimits.max_model_turns, every turn_ordinal on events, snapshots, and
store rows, the core turn loop bound, the budget meter's counter, and the
CLI's --max-turns were u16, so a supervisor could not request more than
65 535 turns and the loop failed with "exhausted the durable u16 ordinal
space". All of them are u32 now. SQLite INTEGER is 64-bit, so no store
migration is needed.

PROTOCOL_VERSION 17 -> 18. The accepted wire range grew; no field was
renamed or removed, so every version-17 record still decodes. The fixture
harness reads tests/fixtures/v<PROTOCOL_VERSION>/ for the byte-exact
goldens and keeps v17 decode-only under a new historical_fixtures_still_
decode test. Boundary tests pin 65 536 and u32::MAX on the wire and drive
the budget meter past 65 535 without a provider.

BREAKING: a version-17 client rejects a max_model_turns or turn_ordinal
above 65 535; clients and servers must agree on version 18.

Slice: speed-first HC1 (--max-turns width)

* feat(runtime): one owner per session store, locked before open and recovery (HC1)

SessionRuntime::open ran recover_interrupted_runs unconditionally against a
store nothing prevented a second process from also opening. Two qq processes
on one file (a TUI beside qq serve, two runs sharing XDG_DATA_HOME, a
supervisor retrying before its previous attempt exited) would each recover,
cancel, and settle runs the other was executing; ADR-0012 made settlement
idempotent in-process but not across processes. HC1's `qq run --session`
makes that case routine.

The store worker now takes an OS advisory lock on a sibling <store>.lock
(std::fs::File::try_lock) before SQLite is opened. A held lock is reported as
the typed SessionRuntimeError::StoreBusy after a bounded 1.5 s handoff grace;
the loser performs no database I/O. The lock is released after the connection
drops, so a successor never sees a live WAL writer, and process death
releases it with no cleanup. ADR-0022 (proposed).

Tests that held a live subscription across a "restart" drop it first (a
subscription clones the store handle); tests that simulated death while a
task still owned the runtime stop the worker directly; tests that opened a
second Store on a live runtime's file read through the runtime's store.

Slice: speed-first HC1 (resume into an existing session, part i)

* feat(cli): resume an idle session with qq run --session ID (HC1)

qq run always created a session; SubmitPrompt on an existing one existed
only through the server. `--session ID` submits into an existing idle root
session of the workspace. Unknown ids and sessions of other workspaces are
one invalid_configuration refusal (the id's existence elsewhere is not
disclosed); spawned sub-agent sessions and busy sessions are refused by
name. The invocation decides the run exactly as for a new session: the
model selection, --profile, and --approval are written to the session
before the prompt is submitted, and the event stream starts at the new
prompt rather than at the session's history or those writes.

Store ownership and the recovery sweep precede all of this, so a run the
previous process left executing is already settled as interrupted when the
resume is examined; the regression test kills a process mid-turn (the new
SessionRuntime::abandon_for_test stops the store worker as a crash would),
resumes, and checks that the interrupted turn was not re-executed and that
the resumed request carries the runtime's do-not-retry notice.

Slice: speed-first HC1 (resume into an existing session, part ii)

* docs(plans): record HC1 in the headless gap table, plan, and ledger

Mark the four HC1 gap rows Shipped with their commits, move the plan's Now
row to HC1-in-review / HC3-next, record PROTOCOL_VERSION 18, close
decision #4 (HC1 bumps alone; HC3 will bump to 19), and add the ledger
entry with per-commit verification.

* feat(cli): print a resume hint naming the session after qq run and TUI /quit

qq run --session ID was only usable by a supervisor reading session_id from
the JSONL trial record; a person running text mode, or leaving the TUI, was
never shown an id. Both surfaces now end with the same lines on stderr:

  To continue this session:
    qq run --session <id> "<prompt>"

qq run prints it in text format when stderr is a terminal, after any
outcome (an interrupted or exhausted run is exactly when someone wants to
continue). JSONL output never carries it, and a piped stderr receives
nothing, so scripted consumers and the Harbor adapter are unaffected. The
TUI's run loop already returned the App; terminal::run now returns
app.focused() after the terminal guard is dropped, and main prints the hint
on the normal screen.

Slice: speed-first HC1 follow-up (session id visibility)

* feat(tui): start a new session on bare qq and open an existing one with --session

The interactive surface had no way to open a specific session: bare `qq`
focused the newest one and the only path to another was the in-TUI list. The
entry points now share one shape with `qq run`: bare `qq` starts a new
session, `qq --session ID` opens that one.

qq-client's `create_initial_session: bool` plus an optional model becomes
`InitialSession::{New(model), Open(id), Existing}`. `New` creates before the
first snapshot; `Open` focuses the named root session and fails bootstrap
with a typed `SessionNotInWorkspace` or `SessionIsChild` before anything
paints (unknown and foreign ids read the same, so an id's existence
elsewhere is not disclosed); `Existing` is what a client attaching to a
server it does not own gets, and what every reconnect uses, so a reconnect
never creates a second session or fails on an id deleted since launch.
`TuiError::ClientStopped` now carries the last client-reported failure so a
refused `--session` is explained on the restored terminal.

Slice: speed-first HC1 follow-up (interactive session entry points)
lg2m added a commit that referenced this pull request Sep 16, 2026
* docs: close Phase 6 and reconcile every plan with what shipped

Phase 6 closed with #46/#47 but the docs still said "in review" in
fourteen places, the tool-layer plan still said "proposed" with eight of
fourteen slices shipped, three ADRs said Proposed for merged work, and the
priority table listed only shipped items. This pass makes the docs match
main at 7956e8e:

- speed-first plan: status block closed; Phases 5b and 6 collapsed to
  Completed Phases rows per the plan's own rule; D5/D8/D9/D10 as-built
  blocks reduced to ADR pointers; § Bundled Fixes keeps only the seven
  deferrals; version row points at protocol.md. 865 -> 742 lines.
  Gate files g-phase-5b.md and g-phase-6.md written.
- tool-layer plan: status block added (T1-T8, T12 shipped); D1-D5 and D8
  replaced by pointers to tools.md plus the recorded departures (rule
  count, PolicyDecision::Forbidden shape, runtime/spill.rs, Launch in
  shell.rs, LineRange, qq-tui -> qq-core edge); dependency table and
  owned paths corrected; § Docs marked done. 601 -> 317 lines.
- ADR-0019/0020/0022 -> Accepted; adr/README.md and root.md agree with the
  files; root.md requests table resolved; ADR-0027 records that qq-core
  is a public embedding API (the audit's "unused exports" are the
  contract).
- plans/README.md priority table rewritten to open work only; readiness
  plan's Phase 6 candidates replaced by pointers to T2/T5/T10 and its
  delivery table annotated; R6-search/patch ledger rows Superseded;
  supervised-delegation status and its applied Amendments collapsed;
  multi-surface status, shipped gaps, and W2 ledger row.
- Design docs: tools.md forward references to plan slices removed
  (list_dir, T6/T7 capture cap, T11); architecture.md records the
  qq-tui -> qq-core edge, the built-in tool set, and tool_spills/schema
  28; product.md and architecture.md point web/mobile at the approved
  multi-surface plan; headless-contract.md musl row and v21 note;
  release.md example numbers; README approval modes describe the
  classifier tiers, supervised, and full.
- decisions-needed #2 stays dropped, #3 carried to Phase 7, #4 and #6
  resolution text updated.

Every relative link and anchor under docs/** resolves (checked with
GitHub's slug rule); the as-built ADRs now point at design docs, not at
the plan sections that were collapsed.

* docs(ledger): link the cleanup stack (#51, #52)
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.

2 participants