The method behind the system

How we use AI to work on BlueShop

This page describes how AI agents work on BlueShop: the tools they use, the access they receive, and the checks applied to their changes.

1. The Experiment

The project explores how agents can work on the same system over time, including the bugs, maintenance and deployment work that follow the first version.

How much of that work can agents complete when the task, permissions and expected results are clearly defined?

The shop gives us concrete problems to work on: prices, accounts, stock reservations, orders, search and reporting.

Test environment: BlueShop uses test customers and orders. It does not establish whether the shop would succeed as a business.

2. What Autonomy Means

An agent can investigate a defined task, make changes and check the result. People still set the goal, review the work and decide whether to accept it.

Agents are expected to

  • inspect current code before proposing a change;
  • trace callers, contracts and cross-service impact;
  • write regression and acceptance criteria;
  • make the smallest root-cause correction;
  • run the relevant quality gates;
  • read failure evidence and iterate;
  • leave source, tests and documentation coherent.

People remain responsible for

  • defining the objective and useful outcome;
  • rejecting weak design, misleading claims or poor storytelling;
  • setting security and delivery constraints;
  • deciding trade-offs when business ownership is ambiguous;
  • accepting or redirecting the final result.

Authority follows the task

Engineering agent
Local user identity→Repository and worktree→GitLab token and API→K3s CI compute
Business persona
Keycloak identity→Role-specific OAuth scopes→MCP capability allowlist→Business API
Runtime workload
Service identity→Vault lease or workload token→Database, Kafka and service boundary
Each role has its own identity and permissions. Repository access does not automatically grant access to business data or running services.
In practice: agents can carry out delegated tasks, while people remain responsible for the project.

3. Agent Orchestration

The main agent owns the task and integration. When delegation is authorized and useful, each specialist receives a bounded assignment. Read-only reviews stay read-only unless the user requests changes; access to editing or deployment tools does not expand that scope.

Coordinated engineering work

Human intentGoal, constraints, feedback and acceptance
→
CoordinatorAssigns work, combines changes and checks the results
→
SpecialistsExplore, implement, review, test, observe or act as a business persona
→
Tools and checksCode intelligence, tests, security, CI and runtime observation
→
Verified changeOr a concrete failure that drives the next correction
Parallel work needs clear assignments. The main agent integrates the changes and resolves conflicting findings.
Explore agentsLocate code, explain flows and identify impact without editing.

Exploration is delegated when the question spans several modules or naming conventions. Exact file and symbol work stays in the coordinator when delegation would add more context transfer than value.

Implementation agentsOwn a bounded change with tests and verification.

Independent workstreams use separate repository worktrees when they could collide. A specialist does not silently broaden scope into adjacent systems.

Review agentsChallenge correctness, architecture, security, evidence or unnecessary complexity.

Review is intentionally separated from authorship for large changes. Findings are resolved against source rather than accepted by authority.

Watcher and operational agentsWait for a build or deployment to finish, then report the result.

Long-running waits are moved out of the main reasoning loop. Watchers report terminal status, failed gates and relevant logs instead of encouraging manual polling.

4. Models, Context and Token Efficiency

Different tasks need different amounts of investigation. The active task settings and delegation rules determine which model and tools are used. The roles below describe useful ways to divide work, not an automatic provider-routing system.

Role in the environment When it is used Required checks
Coordination and implementation Cross-service change, long diagnosis and delivery loops Ownership, acceptance criteria and CI/deploy evidence
Exploration and specialist review Ambiguous boundaries, security, architecture and evidence challenges Findings resolved against source, not model authority
Other providers using the same tools Compatibility checks and real project exposure beyond one vendor Identical tools, rules and gates, within the same process
Fast or lightweight variants Focused reads, classification, simple checks and watcher-style waits Relevant checks still apply to small tasks

Historical token activity: April to July 2026

Value Metric Meaning
273,673 / 275,914 Metered assistant messages (99.2%) Messages with non-zero local token telemetry
1,588,401,797 Uncached input tokens Prompt input processed outside provider cache reads
35,470,031,235 Cache-read tokens Stable prompt content reused from provider caches
247,004,119 Cache-write tokens Prompt content written into provider caches
74,475,565 Model-output tokens Generated output, including delegated work
20,121,640 Reasoning-output tokens Separately reported internal reasoning tokens
95.7% Prompt-token cache-read share cache reads / (cache reads + uncached input)
~50,862 Estimated unretained input tokens Uncached prompt input extrapolated from a comparable period
~5,138,760,832 Estimated unretained cache-read tokens Reused prompt content in the estimated period
~226,579,700 Estimated unretained cache-write tokens Prompt content cached during the estimated period
~17,032,794 Estimated unretained output tokens Generated output in the estimated period

Source: local OpenCode telemetry for BlueShop project worktrees, 2026-04-09 through 2026-07-22. The 95.7% figure is a reuse ratio, not a claim that caching reduced cost or work by 95.7%. Earlier local history is unavailable; its activity is an approximate extrapolation from a comparable retained month, not a measured total.

Cost limits: local telemetry records $80.51 of provider cost, but subscription-backed and zero-cost records make that total incomplete. No financial return or productivity percentage is claimed without complete cost and human-effort baselines.

Keep the relevant information in view

Choosing what to read

Retrieve by intentSemantic search finds the likely boundary
→
Inspect exact symbolsRead the implementation, callers and tests
→
Reuse stable contextProvider caches avoid reprocessing stable prefixes
→
Remove old tool outputKeep the useful findings from large reads
→
Save useful findingsMemory keeps the rule without keeping every log line
Keep the current question, relevant source and unresolved findings in view. Search project notes when earlier decisions matter, then verify details that may have changed. This process does not require a separate dynamic-pruning system.
Check the search results: semantic search can find relevant code even when the wording differs. Reading the implementation, callers and tests is still necessary to understand it.

THE ENGINEERING ENVIRONMENT

The tools around the model

The following sections describe the tools, project notes and checks available to agents.

5. Tools, Context and Memory

Agents use code search, editing tools, project notes and scripts to understand and change the project.

Keeping useful project history

Active context
System constraints+Project architecture+User preferences+Current task evidence
Durable context
Compacted session history→Project memories and notes→Source-backed documentation
Targeted recall
Search prior decisions→Expand only the relevant exchange→Return the learning to active work
Read the workspace rules and repository map first. Look up earlier decisions only when relevant, and compare old notes with current source. Memory updates follow the active environment’s rules and user authorization.

Summarize completed work

A handoff should record the changed files, reason for the change, tests, integration status and remaining gaps. Save durable notes only when authorized; a task summary is not automatically permission to edit memory.

Review past work when useful

When the user asks for a retrospective or documentation review, compare earlier claims with current code and results. Separate historical observations from current behavior.

Design principle: powerful tools are separated by purpose. Code navigation, editing, business actions, runtime diagnosis and recovery do not share one unconstrained interface.

6. Getting Useful Feedback

Small checks help catch problems while editing. Broader changes also need integration, security and runtime checks.

Start with focused checks

While editing
AFT diagnostics→Focused unit or behavior check→Correct immediately
At a coherent checkpoint
Types and architecture→Wider affected tests→Review the complete diff
On cluster compute
Parallel GitLab jobs→SonarQube, security and integration gates→Build and deploy
Against the running system
Browser and API behavior→SigNoz, data and event evidence→Check the expected result
Start by testing the changed component. If a change affects a shared contract, permissions or several services, also test those interactions.

Match the checks to the change

Fast checks stay close to the edit. Expensive integration, mutation, load and live acceptance checks are reserved for the boundaries they can actually protect.

Check related changes together

Related changes are checked together. Heavy jobs run in parallel on K3s runners. Watchers report completion or failure, so the agent does not need to keep polling.

Tooling rule: each check should have a clear purpose. Review overlapping checks to understand what failures each can catch.

7. Working Rules for Agents

Method How it constrains agent behavior Failure it reduces
Domain-Driven Design Use business language, explicit ownership, aggregates and state transitions Putting a business rule in the wrong service or bypassing its domain model
TDD Write a test that exposes the defect before fixing it Symptom patches and regressions without a durable check
BDD Express acceptance as visible Given/When/Then behavior Implementation passing while the stakeholder journey is still wrong
Root-cause-first diagnosis Trace every shared caller and collect runtime evidence Retries, longer waits or local guards hiding a distributed defect
Keep changes focused Reuse existing patterns and write the smallest correct diff Speculative abstractions and AI-generated boilerplate
Architecture fitness functions Make package, reactive and dependency rules executable Slow architectural drift invisible in one review

8. Role-Scoped Business Personas

The July workflow described five business personas using role-specific MCP tools. The roles below explain that setup; this editorial update did not reauthenticate every persona or verify its current tool allowlist.

Observe, decide, act once, verify

ObserveUse only role-specific read tools
→
DecideChoose one useful business action or stop
→
Mutate onceRespect risk and action budgets
→
VerifyRead after write; report exact result or gap
Customer, catalog manager, marketing manager, logistician and support manager agents cannot access unrelated business tools, shell, source files or databases through those role-specific tools.
Persona Useful autonomy Boundary
Customer Browse, manage cart, place orders and interact with owned commerce state Customer identity and customer-safe MCP capabilities
Catalog manager Inspect and govern products, categories and merchandising relations Catalog-manager OAuth scope and role
Marketing manager Observe campaigns and perform bounded campaign actions Marketing capability allowlist and mutation budget
Logistician Observe shipment work and advance legal delivery transitions Logistics lifecycle and role scope
Support manager Inspect queues, claim work and progress support cases Support role, customer privacy and ticket state machine

9. From Local Checks to Deployment

Agents run focused checks locally, wider tests in CI and acceptance scenarios after deployment. A failure at any stage sends the work back for investigation.

Checks before and after deployment

Intent and specificationWhat behavior matters and why
→
Fast local loopInspect, change and run focused checks
→
CI checksParallel CI, SonarQube, integration and security
→
Runtime checksDeployment, browser, API, traces, events and data
→
Save the lessonRegression, architecture rule and durable memory
The agent checks what the application actually did and saves the relevant query, trace or report so someone else can inspect it.

Catch simple mistakes early.

Semantic code search, diagnostics and focused behavior checks keep the edit loop short. The agent does not wait for a remote pipeline to discover a type error or a broken invariant it could prove locally.

Check how the parts work together.

K3s runners provide parallel compute for wider gates. The deployed system then exposes identity, event, persistence, scheduling and observability behavior that a local test cannot reproduce.

10. Reusable Foundations

Consistent code gives agents examples to compare before making a change. Reusing a tested pattern can reduce the amount of new code and the number of decisions needed.

An existing implementation is often the best place to start.

DDD and ubiquitous language remove competing names. Repeated structure, typed contracts, semantic search and architecture checks reveal the current path directly. Documentation keeps the map, rationale and non-discoverable constraints; it does not duplicate the implementation in a giant agent prompt.

Finding and adapting an existing pattern

Repeat a clear patternOne recognizable shape per concern
→
Retrieve an equivalentSemantic search finds a proven example
→
Adapt the building blockLess invention and less context
→
Enforce the boundaryTests and architecture rules reject drift
→
Strengthen the next exampleKeep the corrected example for later work
Backend service layers, aggregate transitions, outbox/inbox flows, frontend state boundaries, Kustomize overlays and shared CI gates give agents examples at every level.

Patterns make extension predictable.

The agent can compare several existing implementations, identify the stable shape and spend its reasoning budget on the new domain behavior instead of rediscovering project conventions.

Different approaches need an explanation.

When every module solves the same concern differently, retrieval returns contradictory examples. Work slows down until the shared pattern is recovered and the exceptional code is refactored.

Engineering learning: clear patterns help agents choose where and how to make a change. When a pattern causes a bug, correct it and add a test before reusing it.

11. Helping Agents Work Safely

Agents need to understand the code. The system also needs checks that can catch or limit a mistake when they get it wrong.

Help agents understand the code

  • stable repository ownership and naming;
  • concise architecture and structure maps;
  • explicit domain state transitions;
  • typed API and event contracts;
  • repeatable package patterns;
  • searchable logs, traces and correlation IDs;
  • small commands with machine-readable output.

Limit the damage from mistakes

  • least privilege and role-scoped tools;
  • default-deny security boundaries;
  • database constraints and RLS;
  • idempotent events and transactional outbox/inbox;
  • immutable migrations and Git history;
  • tests and architecture rules that reject drift;
  • reconciliation and recovery paths after failure.
Risk objective: these controls aim to prevent mistakes, limit damage and help diagnose failures. They do not guarantee correct changes.

12. Failures We Learned From

These five historical cases describe what went wrong, how it was diagnosed and what changed afterward. Their timings and recovery checks have not been rerun for this update.

Tests interfering with each otherConcurrent journeys exposed campaign bleed, unsafe cleanup and shared identities.

What we found. Traces, artifacts and database timestamps showed active products and customer profiles being changed or deleted by another run.

The fix. Active-run protection, owned fixtures and serialization only around truly global campaign mutations kept the remaining suites parallel.

CI jobs waiting despite free memoryJobs waited even though the machine still showed 28 GiB free.

What we found. Kubernetes had already reserved nearly all allocatable memory and CPU through requests, while actual usage remained much lower.

The fix. Requests and quota were right-sized while burst limits remained available; concurrent pipelines then used the reclaimed capacity without becoming unschedulable.

A Vault file damaged during shutdownA host power-off left an all-NUL lease file on persistent storage.

What we found. The shutdown script stopped containers before Kubernetes could terminate stateful workloads in order, interrupting a Vault file write.

The fix. Vault, PostgreSQL, Kafka, ClickHouse, Elasticsearch and their volumes now drain before K3s stops. Recovery succeeded in two complete power-cycle checks.

A dashboard query using too much memoryOne product-performance card exceeded the 3 GiB query limit.

What we found. The exact dashboard SQL scanned the deduplicated stream twice, joined served and clicked tuples and aggregated the result again.

The fix. Raw-fact aggregation reduced the same query to 394 ms and 68.97 MiB while preserving the product-level answer.

Documentation describing a system that did not existAn abandoned agent-platform idea had drifted into the current story.

What we found. Source validation found no current Argo Workflows/Events agent platform or matching manifests.

The fix. The incorrect documentation and presentation references were deleted. Current AI documentation now describes only the local agent, MCP, context and engineering systems that actually exist.

13. Limitations

Result

What we are learning

Working on BlueShop lets us try different ways of giving agents context, tools and feedback. The useful result is a change that works and an explanation that can be checked.

Continue to the technical architecture · Watch the demos · Return to the site map

Current rules and historical tooling

Reviewed on 12 September 2026 against the workspace AGENTS.md and STRUCTURE.md, with AFT available for source navigation and Context7 for library documentation. Repository ownership, task scope, testing and delivery requirements come from those rules.

The July guide named Magic Context, Historian, Dreamer, Exa and dynamic pruning. Their current configuration was not established in this review, so they are retained here as history rather than prerequisites for today’s workflow. The April-July token sample is unchanged and is not a current usage total.