PAA Repo Updates

We are revisiting the PAA repo this week and getting everything up to date with all our latest progress so starting a thread here for discussions.

@djjones, here is the handoff from today’s call: all 17 decisions, and for each one what changes in the-architecture, in the contracts, and what to check in BrainDrive.

Scoreboard

17 decisions made. 2 items still open (S5, S8). Spec PRs: 0 of 6 drafted. Contract changes: 0 of 8 done (Dave J; decision 10 only if policy.json has a default). BrainDrive checks: 0 of 9 done (Dave J).

How this works

  • the-architecture, spec text: Claude drafts each change as a PR, and Dave J reviews it. Nothing merges without his review.
  • the-architecture, contracts and schemas (specs/openapi/*.yaml, specs/schemas/*.json, the blueprint contracts/): Dave J makes these changes in one contract revision. The Engine to Agent Loop path rename goes into the same revision.
  • BrainDrive: Dave J checks each item against the BrainDrive code and fixes whatever isn’t fixed already. Claude can’t see the BrainDrive code repo from this project, so the BrainDrive column says what to check, not where the code is.

The decisions, by repo

# Decision the-architecture spec text (Claude PR, Dave J reviews) Contracts and schemas (Dave J) Check in BrainDrive (Dave J)
1 No automatic re-grant after a move. A re-created identity has no access until the owner turns it back on. How the owner does that is up to each product. auth-spec “Stale Permissions After Export/Import”: remove “existing policies apply automatically” identity.json: pick the status a re-created identity starts in (for example suspended) After an import, re-created identities don’t silently get their old access. A one-click restore is fine.
2 The owner has the last word on their own hardware. No product rule beats the owner locally. configuration-spec :110-114: remove “environment safety constraints always win” none No setting is locked against the owner on a local install
3 Secrets live outside Your Memory and are never tracked by git. Environment variables, an untracked config file or a secret store all qualify. security-spec Secrets Management: add secret stores. AC-10.5 gets reworded in the PAA spec. none Already uses secret storage. Confirm no keys sit in memory files or tracked config.
4 Docker is not the default. Containers are one supported option. deployment-spec :89 and D14: make this BrainDrive’s packaging choice, not a PAA rule none none (Docker stays fine for BrainDrive)
5 Retire Customization stories CS-1 to CS-6. US-17 covers them. customization-spec: remove the stories, point to US-17, keep the coaching example as an illustration none none
6 No UI-timing or hosting rules in the specs. Keep each requirement and drop “during first-run setup” and similar. security-spec :124, :219, :237; customization-spec :395 none none (BrainDrive’s screens are its own call)
7 The PAA spec moves to the-architecture. Both Daves approve it there by PR and it gets a tag (for example paa-spec/2026-10-20). Move the spec and its gaps file. Add a “Serves stories” line to each spec. none none
8 The model travels with each request. The Gateway reads the owner’s current choice on every message, so the next message uses the new model. agent-loop-spec :96-101, configuration-spec :166-170, adapter-spec :102, SWAP-1 (no restart) Add a model field to the Gateway–Agent Loop request (gateway-engine.yaml, contract :70-73) Switching models applies to the next message with no restart. Dave J thinks this is already fixed and will confirm.
9 Auth is a check the Gateway calls on every request. The Agent Loop also asks Auth before each tool call. Permissions live only in Auth. gateway-spec :16, auth-spec :239, agent-loop-spec :33, configuration-spec (permissions out), overview request diagram gateway-api.yaml :14, contract :163 Every request and every tool call goes through Auth, and permissions aren’t stored anywhere else
10 The default is “the owner can do everything”. Approval prompts are a product choice. tools-spec :171, :181; security-spec :145-181, :326, :416; auth-spec default policy.json default, if it has one none (BrainDrive already dropped the prompts)
11 One message shape, used by all three contracts, with tool calls and results saved in history. gateway-spec, gateway-agent-loop-contract message.json as the single shape; gateway-api.yaml :388-392, gateway-engine.yaml :155-176, model-api.yaml; align finish_reason and tool-result Tool calls and results are saved in conversation history and survive export
12 Message content is a list of parts, text first, with room for images and files. gateway-spec, memory-spec message.json content becomes an array of parts Content shape is ready for parts
13 Version history and restore are required for Your Memory. How they’re built is up to each implementation. security-spec :228 (no longer optional), memory-spec (add restore) memory tool contract: add a restore operation. Conformance ARCH-1 and ARCH-9 stop hard-coding SQLite, Git and memory_history. Owner can restore an earlier version
14 Engine becomes Agent Loop in contract paths (/engine/chat, gateway-engine.yaml, schema names). Docs are already done. done (PR #6) Rename in the next contract revision Whatever consumes /engine/chat follows the rename
15 Claude drafts the Auth, Tools and Configuration rewrites. Dave J reviews them. 3 rewrite PRs that apply decisions 1, 2, 8, 9 and 10 none none
16 The factory builds from the PAA repo, not the template. Its input is the stories, the specs and an evaluation, in any language. none none none
17 Conformance kit (US-16) moves forward. It is the set of language-neutral tests every implementation and template must pass. First factory test: a small PAA implementation (one chat turn plus one MCP tool) built from the repo alone. The TypeScript template is built by AI directly, then ported. Evaluation plan draft becomes the start of the kit none none

Spec PRs coming to Dave J (the-architecture)

  1. Move the PAA spec into the repo, with a “Serves stories” line on each spec (decision 7)
  2. Auth rewrite (decisions 1, 9, 10)
  3. Tools rewrite (decision 10, plus S8: the owner chooses tool visibility, and the “not permitted” and parallel-call stories)
  4. Configuration rewrite (decisions 2, 8, 9)
  5. Light edits: Agent Loop, Gateway, Adapters, Memory, Security, Deployment, Customization (decisions 3, 4, 5, 6, 8, 11, 12, 13)
  6. Overview request diagram (decision 9)

Also for Dave J

  • Factory Stage 4: the project profile and technical spec. After decision 16, these cover the first factory test (a small PAA implementation built from the repo), not the template. A first look is on tomorrow’s factory call.
  • Still open from the handoff: S5 (identity sent in X-Actor-* headers, which is lost if the transport is swapped) and S8 (tool-definition.json: visibility, source, no adapter-config schema) aren’t decided yet. Claude will propose fixes in the Tools rewrite PR.
  • Machines to test on, and who builds the test fixtures: carried to tomorrow’s call.

@DJJones also CC is still working on the PR we talked about with the spec changes from the call etc. should be submitted shortly.

Thanks
Dave W.

@djjones, thanks for merging PR #7. This post covers only what isn’t in my handoff post above or in the PR: proposals for S5 and S8, and the gaps that are still open. On our side, Dave W only has to tag the accepted spec. The items below are yours, and we won’t touch them so we don’t cross each other up.

The contract changes and BrainDrive checks are the same as in the handoff post, and each affected doc ends with a “Contract alignment” note. That note adds two small things beyond the handoff list: the system message is Agent Loop configuration, not something the Gateway packages, and every error carries a request timestamp and a correlation ID.

Proposals for the two open items

S5: how identity travels from the Gateway to the Agent Loop

Problem: identity rides in X-Actor-ID and X-Actor-Permissions headers, so it is lost if the transport is swapped (AC-7.2, AC-10.3). The permissions header copies rules out of Auth in a format that matches nothing in policy.json.

Proposal:

  1. Move identity into the request body as an actor object in the request metadata, next to correlation_id.
  2. Drop X-Actor-Permissions. The Agent Loop asks Auth before each tool call instead.
  3. Put no credential in the body, only the identity Auth confirmed.
  4. Optionally keep X-Actor-ID as a mirror during a transition, with the body winning.
  5. Add a conformance test that swaps the transport.
S8: tool definitions and adapter config
  1. The owner owns visibility: take category (always-send or discoverable) out of tool-definition.json. It becomes an owner preference.
  2. Make source required and carry it to the Model API, so two tools named search never collide.
  3. “Exists but not permitted” (AC-8.3): give the Model API a way to show tools the model can’t call, plus a standard “not permitted” result.
  4. Parallel calls (AC-8.4): state in model-api.yaml and the internal contract that several tool calls plus text can be in one message, run at the same time, with results matched by call ID.
  5. Adapter config: add specs/schemas/adapter-config.json, with secrets by reference only.
  6. Example wording: change “user’s library” to “owner’s library”, and drop the approval-gate example.

Gaps still open

See the gaps file. Still open: GAP-PAA-1, 2, 4, 6, 8, 9, 10, 11 and 12, plus the leftover parts of 5, 7 and 16. The rest are decided and covered by PR #7.

For tomorrow’s call

Besides machines to test on and who builds the test fixtures: which language the first factory test uses, and who owns the conformance kit.

@djjones, here’s the file-by-file map for the repo restructure we agreed on today’s call (D185, in PR #10), so your AI can move from it directly.

Each top-level folder is named for one visitor’s job (understand, build by hand, build with an AI agent, verify) and marked binding or derived.

README.md              start here
AGENT.md               start here if you're an AI agent
CONTRIBUTING.md  LICENSE

spec/                  WHAT every system must promise           (binding)
  personal-ai-architecture-spec.md
  gaps.md

architecture/          HOW it works                             (binding)
  overview.md            ← foundation-spec.md ("The Architecture")
  principles.md
  decisions.md
  memory-spec.md  agent-loop-spec.md  auth-spec.md  gateway-spec.md
  tools-spec.md  models-spec.md  adapter-spec.md  configuration-spec.md
  deployment-spec.md  security-spec.md  customization-spec.md
  communication-principles.md  gateway-agent-loop-contract.md
  background/            why it's built this way              (explanatory only)
    about.md  memory-as-platform.md  memory-tool-completeness.md  lock-in-analysis.md

contracts/             EXACT shapes code must match             (binding)   ← specs/
  openapi/  schemas/
  examples/              ← ai-agent-docs/examples + validate-manifest.py

conformance/           PROVE a system conforms                  (binding)
  README.md  fs-tests.md  arch-tests.md  deploy-tests.md  swap-tests.md
  lockin-gate.md  lockin-audit.md  zero-lockin-checklist.md  foundation-verification.md
  review-checklists/     ← ai-agent-docs/review-checklists
  (the language-neutral conformance kit, US-16, lands here)

build/                 HELP to build one          (derived; architecture/ and contracts/ win on conflict)
  primers/               ← ai-agent-docs (the condensed per-component docs)
  blueprints/<component>/   blueprint.md  prompt.md  tests.md  drift-guard.md  contract-pack.json
  implementers-reference.md

maintainers/           how this repo is kept healthy
  doc-maintenance-spec.md  guides-spec.md  doc-registry.json
  primer-*.md  traceability-map.md  change-log.md  accepted-mvp-limits.md

assets/                images used by the README

Still open for you:

  • Blueprint contract packs: the 14 packs duplicate contracts/ (that duplication caused GAP-PAA-3). The map parks them inside each blueprint folder. Delete them or generate them from contracts/; your call during the contract work.
  • Link sweep before the move merges: GitHub doesn’t redirect moved files, so links from the website (about 9), the course lessons and the forum will break. That one is yours.
  • Wording: the note under conformance/ still says “conformance kit”; per D183 it’s the PAA conformance validator.

I’ve already did that part but will use this to verify once I have wrapped up all of the above issues you posted from yesterday which are currently in progress

@DJJones its find if you found a better way to do it I was just looking for the map in the library and couldn’t find it so I posted it here for you in case you were looking for it.

Thanks
Dave W.

The PAA has been merged and Library/Docs has PRs to keep things in sync:

  • BrainDrive-Docs PR #166
    Commit 90eb4b5, targeting the current proposal branch. Approval check is queued.
  • BrainDrive-Library PR #29
    Commit 9ad824ac6, targeting main.

@djjones, thanks for landing the restructure and the contract work in PR #11. Two PRs are now ready for you on top of it.

PR #10: decisions D183–D186. Rebased onto your layout, so the four rows now go into architecture/decisions.md. No other changes.

PR #12: the four component specs (Memory, Agent Loop, Gateway, Auth). Each spec now opens with a plain-language “what it is” and “how it works”, for people who just want to understand PAA. Below that is the binding specification, reorganized so each rule appears once, with one checklist per component. All your PR #11 edits to these files are carried over.

Please check the binding wording changes. The PR description lists each one. They align the specs with rules stated elsewhere in the repo. The main ones:

  • The Agent Loop is four steps, with streaming throughout.
  • Only permitted tool calls run.
  • A tool call Auth can’t check isn’t run.
  • The Gateway generates the correlation ID before calling Auth.

Nine new gaps (GAP-PAA-17 to 25) came out of reading the specs closely. Five need a decision from us both:

  • 18: two messages to the same conversation at once
  • 19: whether the Agent Loop falls back to another provider or reports and stops
  • 20: who keeps a request inside the model’s context window
  • 23: what the Gateway saves when a reply fails partway
  • 24: whose identity the AI acts under when it works for the owner in conversation

Of the rest, 21 (revocation can’t stop a running loop) and 25 (audit record format) are technical work for you. 22 is a one-line defect: the security spec still lets sessions continue when Auth is down. 17 is a wording fix.

Next, Dave W and I go through Models and Tools, then the rest of architecture/.

@Dave W, I resolved the remaining three gaps and pushed the updates to PR #13:

Completed:

  • GAP-PAA-17: clarified that collaborators and external agents may use the Agent Loop under their own authenticated identity and owner-granted permissions.
  • GAP-PAA-21: added POST /agent-loop/cancel, targeted by correlation ID, for revocation cancellation. The Agent Loop stops further work, emits auth_error, and records the cancellation.
  • GAP-PAA-25: added the portable audit-record.json schema, canonical example, manifest validation, and conformance coverage.

Also updated the related specs, contracts, primers, decisions D192–D193, and conformance tests.

Validation passes:

  • Documentation freshness: 0 stale
  • Contract examples: 18 validated
  • Executable conformance: 8/8
  • JSON/OpenAPI parsing
  • Diff checks

The PR remains open for your review. The mirror check is currently queued.

@davewaring I investigated GAP-PAA-20 in BrainDrive’s current Gateway and opened a PAA proposal for your review: PR #15.

BrainDrive already shortens the conversation sent to a model while retaining the saved history. Two details should stay product-specific: its 128,000-token default and its 4,000-character cap on replayed tool results. Neither is a safe universal PAA rule, especially when the owner switches models.

The proposed PAA rule is:

  • Gateway keeps the full conversation in Your Memory and selects a working context sized for the model the owner chose. It reserves room for instructions, tool definitions, and the reply. If it leaves out or summarizes older turns, the owner can see that. The current message and selected content stay intact.
  • Agent Loop checks every actual model call, including the next call after a live tool result. If the call cannot fit, it reports context_overflow instead of silently shortening the result.
  • Both use a known model limit or a verified conservative ceiling. If no safe limit is known, the system reports the problem instead of assuming every model has the same window.

This is a proposal, not an accepted PAA decision. Please review the ownership split, the owner notice, and the unknown-limit rule in PR #15. PR #14 also touches the Models and Gateway–Agent Loop docs, so the overlapping wording needs reconciliation before merge.

@DJJones66 PR #14 is ready for your review: Visitor read-through: models, tools, adapters, communication, contract, configuration + D188/D193/D194 by davewaring ¡ Pull Request #14 ¡ Personal-AI-Architecture/the-architecture ¡ GitHub

It’s rebased on #13 and now writes in today’s three decisions:

  • GAP-PAA-19 (D188): a provider failure stops the turn with provider_error; no fallback model.
  • GAP-PAA-26 (D193): provider profiles in the adapter config, the active profile sent as a required provider on every request, so switching a listed profile needs no restart. This follows what you did in BrainDrive.
  • GAP-PAA-28 (D194): every saved assistant reply records model and provider.

The contract examples and conformance runner pass. The doc checker flags only auth-spec.md as stale, which we’re leaving for the auth-spec review. The PR description lists the binding changes for you to approve or reject, plus a few follow-ups (blueprint regeneration, validator design, one primer wording fix).

GAP-PAA-20 (context window) stays with you.

@DJJones66 Thanks for digging into GAP-PAA-20. I reviewed PR #15 and agree with the rule: the Gateway picks the working context and the Agent Loop checks every call.

Four fixes before merge, all in the review:

  1. Say who writes the summary. It has to be built without a model, as BrainDrive’s is, or come from a tool.
  2. Add an optional context_notice to the Gateway response so any client can show the owner what was left out.
  3. Look up model limits by provider and model in each provider profile (D193), and name the errors for an unknown limit and an overflow the Gateway catches.
  4. Record BrainDrive’s 4,000-character tool-result cut as a gap in the test plan.

Suggest merging #14 first and rebasing #15 onto it, since they overlap in 17 files.

Dave W — I reviewed PR #14 and agree with D188, D193, and D194. I pushed a small follow-up commit (d59d49e) that updates the Auth spec for saved reply provenance, corrects the trigger description, and clears the whitespace issues.

The documentation gate now passes, along with the contract examples, conformance runner, and GitHub check. Please review my commit and merge when you’re satisfied. After merge, I’ll update the five templates and validator for the new contracts. GAP-PAA-20 remains with me.

Thanks, Dave. I agree with your four PR #15 review points. I’ll specify how a summary is produced without a Gateway model call and give it an explicit representation distinct from the startup instruction and the owner’s messages. I’ll add an optional context_notice to the Gateway response, key model limits by provider and model using the D193 profiles, name the unknown-limit and Gateway overflow errors, and record BrainDrive’s 4,000-character tool-result cut as a conformance gap.

I also pushed a small follow-up to PR #14 (d59d49e) that cleared its Tier 2 documentation gate and corrected the trigger description. Its checks pass. Please review and merge #14 when you’re satisfied; I’ll then rebase #15 onto it, make the four changes, and rerun the checks.

@DJJones66 Thanks, d59d49e looks good, and PR #14 is merged so you can rebase #15 onto it.

One heads-up: after your review I added the configuration and deployment read-through to #14. Those are binding changes 21–30 in the PR description. Most are consistency fixes. Four are new rows in decisions.md for decisions the contracts and specs already cite but the log was missing: D29, D144, D145 and D146. If any of 21–30 doesn’t sit right, say so and I’ll follow up in the next PR.

Also for you: conformance/deploy-tests.md needs tests for the three new deployment checklist items. DEPLOY-4 should allow traffic to destinations the owner configured, like a remote backup, rather than banning all background connections.

Next in the read-through is security-spec, in a new PR.

@davewaring Thanks. I reviewed binding changes 21–30 and have no objections. I rebased PR #15 onto merged #14 and updated it to preserve the provider-profile decisions.

I also added conformance tests for the three new deployment checklist items. DEPLOY-4 now allows background connections to owner-configured destinations, including remote backup. The examples, conformance runner, documentation check, and PR check pass. PR #15 is ready for your review of the GAP-PAA-20 rule.

@DJJones66 Thanks for reviewing 21–30 and adding the deployment tests.

PR #16 is ready for review: the read-through of security-spec and customization-spec. Binding changes are listed 1–14 in the description. The main ones: provider and tool-trust wording now matches models-spec and tools-spec, TLS is required only off-machine, owners decide the always-send tool set, and D51 in customization now matches the log. check-docs passes.

Correction to my last post: older decisions live in each spec’s Decisions table, not only decisions.md. So D145 and D29 were already recorded, and copying them into the log in #14 was harmless but not needed. Eleven cited numbers have no row anywhere (D1, D27, D32, D52, D54, D122, D131, D149, D151, D154, D159). That’s low priority, for whenever you next touch the log.

@djjones Reviewed PR #15. All four fixes are in and the checks pass. I left three small fixes in the review: the bootstrap prompt is still described as part of messages in gateway-engine.yaml, the Gateway summary needs to be stated as a narrow D59 exception, and “tool results reach the model unmodified” needs “or not at all, reported as context_overflow”. After those, I’m happy to merge #15 first and I’ll rebase #16 onto it.

@davewaring Thanks for the #15 review and the decisions-log correction. I pushed the three requested fixes: the bootstrap prompt is no longer described as part of the Gateway request, the deterministic summary is stated as a narrow D59 exception, and tool results either reach the model unchanged or trigger context_overflow. I also clarified that the summary is marked as derived data and that clients display context_notice. The checks pass, so #15 is ready for your merge and #16 rebase.

I reviewed #16’s binding changes 1–14. I have no objection to the customization changes 9–14. Before approving the security portion, I’d like to settle three points:

A readable cloud-provider default may not tell an owner about data transfer before their first message is sent. I’d retain that advance disclosure requirement without prescribing a popup.

Skills and bootstrap instructions can live in Your Memory. Please distinguish those trusted instructions from ordinary retrieved Memory data in the content-separation wording.

The existing promise to audit every tool call conflicts with continuing work when the audit log is full. Please clarify the guarantee in that failure case.

One consistency fix: D29’s rationale still names containers although the revised isolation rule also permits a process or sandbox. When rebasing #16, please preserve #15’s complete-turn context selection and overflow wording in the shared security text.

I’ve also run a focused BrainDrive Evaluation probe for the 4,000-character replay cut. The evaluator completed and recorded a product FAIL; the product fix is separate work after we settle the PAA rule.