Made-up example. Cinco Chaminés is an invented company: the homes, prices, availability and bookings are simulated, and the pictures are AI-generated. The weather, sea, UV and events are real, read live from data.promptugal.news. What is this site?

Cinco Chaminésholiday homes in the Algarve (a made-up example)

Round 3 build notes, instance C: the simulation core

Rendered at build time from team/rounds/3/build/NOTES-C.md. Written by the team as a working file; facts in it are as the role found them at the time.

Written by developer.algarve-holiday-homes@AgentiCCells.dinis (instance C), sub-agent of the conductor, on 18 November 2026. Files only: no commit, no push, nobody contacted.

Brief (conductor, round 3): build the simulation core as plain ES modules under src/assets/js/sim/, with node tests, following the architecture in team/rounds/3.md. Sources used: team/rounds/2.md (Dinis's words of about 17:20, 17:25 and 17:40 UTC), team/rounds/3.md, team/rounds/2/research/REAL-DATES.md, LEGAL-PT.md, SYNTHETIC-USERS.md, cast.json, the ABP JSON in team/developer/POLICY.md, src/assets/js/data.js, availability.js, src/data/homes.json.

What exists now

FileWhat it is
src/assets/js/sim/util.jsdate and time helpers (Portugal local times as YYYY-MM-DDTHH:MM strings), seeded rng(key), hid(), esc()
src/assets/js/sim/store.jsthe state document in localStorage["cc.sim.v1"], the event log, the reducer, tab and iframe sync
src/assets/js/sim/clock.jsthe simulated now, bounded by the real-data window; play at any speed
src/assets/js/sim/booking.jsinvented rates, quotes, availability, the booking lifecycle, channels, calendar feed (iCal) import
src/assets/js/sim/legal.jsthe LEGAL-PT.md formulas: tourist tax, VAT and article 53, IRS simplified regime, guest registration, the legality checklist
src/assets/js/sim/money.jsP&L per home and total for any period, tourist tax by municipality
src/assets/js/sim/abp.jsthe browser Agent Behaviour Policy engine, the policies, detectInjection()
src/assets/js/sim/policies.jsonthe same policies as data (a test checks it equals abp.js)
src/assets/js/sim/personas.jsthe seeded synthetic world: visitors, stays, reviews, issues, admins
src/assets/js/sim/cast.jsoncopy of team/rounds/2/research/cast.json; at the conductor's request (relaying Dinis) its what line no longer names any real person or agent: fictional characters only
src/assets/js/sim/figure.jsfigure(look, opts) -> SVG string, plain-SVG reimplementation of the storyboard kit's character
src/assets/js/sim/agents.jsthe scripted "Agents on both sides" scenarios
tests/sim.test.mjs, sim-money.test.mjs, sim-abp.test.mjs, sim-world.test.mjs32 tests; node --test passes all 48 tests in the repository (measured 18 November 2026, about 18:00 UTC)

No module sends anything. The only network read is loadCast() (a GET of sim/cast.json from the site itself) and clock.loadBounds() (through data.js, data.promptugal.news only). No POST, no beacon. Leak scan: OK (measured). No em dash, hype word or booking-platform brand name in these files (checked with the validator's own patterns by grep).

API

All modules are ES modules with no dependencies; they run in the browser and in Node 22. Every amount is EUR, rounded to cents; every result the pages show carries simulated: true and, for money and law, advice: 'not legal or tax advice' and sources: [urls].

store.js

import { createStore, memoryStorage, channelHub } from '/assets/js/sim/store.js';
const store = createStore({ homes });   // browser: localStorage + BroadcastChannel('cc-sim'); Node: pass { storage: memoryStorage(), channel: null }
store.load();                           // reads cc.sim.v1, or reset(DEFAULT_SEED) when absent or invalid
store.dispatch(event | [events]);       // { type, at?, actor?, data, ledger? } -> appended (seq stamped), folded, saved, broadcast
store.subscribe((state, info) => ...);  // info.kind: event | clock | reset | import | sync | compact | error; returns unsubscribe
store.reset(seed, { now, settings });   // new document: { schema: 1, created, seed, clock, events: [sim.created] }
store.exportJSON(); store.importJSON(text);   // import returns { ok, error? }
store.getState(); store.clock(); store.setClock({ now, speed, playing }); store.compact(); store.sync(); store.close();

clock.js

import { createClock, loadBounds, SPEEDS, realDataFor } from '/assets/js/sim/clock.js';
const clock = createClock({ store, bounds: await loadBounds() });
clock.setDay('2026-11-20'); clock.setTime('2026-11-20T15:00'); clock.advance(90);
clock.play(SPEEDS.day);     // simulated seconds per real second: real 1, minute 60, hour 3600, day 86400, superFast 604800
clock.pause(); clock.tick(realMs); clock.onAdvance((from, to) => ...); clock.days(); clock.realDataFor('2026-11-20');
// -> { date, weather: 'issued' | 'none', events: true | false, sea: bool, how: [...], message }

Bounds (computeBounds): weather is a list of ranges, the vault copy of 17 November 19:29 UTC (17 to 21 November) plus the live forecast file's dates; sea from the live sea file; events from max(18 November, the file's read date) to the latest event start in the live events file. Fallback constants from REAL-DATES.md: weather 17 to 22 November, events 18 November to 31 December 2026, so the clock runs 17 November to 31 December. A day in a gap says "No real forecast for this day yet: IPMA publishes five days ahead, and nothing is invented." Only the tab that called play() drives the clock; the others follow through the store.

booking.js

import { createBooking, quoteFor, availability, calendar, occupancy, SAMPLE_ICAL } from '/assets/js/sim/booking.js';
const bk = createBooking({ store, guard: createGuard({ store }) });
bk.quote('salt', '2026-11-20', '2026-11-23', { adults: 2, children: [7] }, { channel: 'platform' });
bk.book({ homeId, from, to, guests, guest: { name, country, typedHere: true }, channel: 'direct' }, { actor: 'visitor' });
bk.enquire(o, ctx); bk.hold(id, ctx); bk.pay(id, ctx); bk.checkIn(id, ctx); bk.checkOut(id, ctx);
bk.cancel(id, ctx); bk.changeDates(id, from, to, ctx); bk.importICal(homeId, text, { actor: 'owner' }); bk.expireHolds();
bk.availability(homeId, from, to); bk.calendar(homeId, from, to);
touristTax({ municipality, from, to, guests }) ; vat(price, { exempt53 }) ; vat53Check(turnoverYear)
irs({ gross, coef, startYear, expenses, marginalRate }) ; registrationDuty(booking, guest) ; addWorkingDays(day, n)
checklist(home, { bookings, guests, now }) ; TOURIST_TAX ; NO_TAX ; SOURCES
pnl(state, { from, to, homeId }) ; ledgerRows(state, opts) ; touristTaxByMunicipality(state, { from, to })

abp.js and policies.json

import { createGuard, decide, detectInjection, untrusted, trusted, POLICIES } from '/assets/js/sim/abp.js';
const guard = createGuard({ store });
guard('host-assistant', 'refund.issue', { target, amount: 400, provenance: [untrusted('review', text)], approvedBy });
// -> { decision: 'allow' | 'ask' | 'deny', rule, reason, actor, policy, action, flagged, provenance, ... }  (also logged)

personas.js

import { createWorld, step, castFrom, loadCast, PROFILES, INJECTIONS } from '/assets/js/sim/personas.js';
const world = createWorld({ store, clock, cast: await loadCast(), weatherFor }).attach();  // runs every hour the clock passes
world.onEvents(evs => animate(evs));       // the events of one batch, for the world page
step(state, '2026-11-20T14:00', { cast, weatherFor, bounds }) -> events   // pure, deterministic

figure.js

figure(look, { pose, mood, scale, prop, hat: 'sun', outfit: 'holiday', flip, kind, label }) and figureFor(castCharacter, opts) return an SVG string (viewBox -175 -640 350 660, 70 x 132 px at scale 1). Poses: stand, point, wave, arms-up, shrug, think, sit, walk, hold. Moods: the kit's ten. Props: suitcase, surfboard, laptop, binoculars, broom, mop, ledger, keys, phone, receipt, ticket, balloon, calculator, dog, wheelchair. Agents (look.colour) are drawn as the kit's screen-faced robot. Colours are checked (unsafe values fall back to the defaults) and labels escaped. Credit in the header: "Figure design after the storyboard kit of storyboards.sgit.ai, Apache-2.0"; no kit code copied. Rendered and looked at in headless Chrome (all 16 cast members plus variants).

agents.js

scenarioList() and runScenario(id, { store, guard, booking }) -> { title, steps: [{ who, name, text } | { who, tool, args, decision }], events }. Scenarios: late-arrival, early-check-in, broken-boiler, pet-request, discount-request (ask, then the owner approves 10 percent), injection-message (refund, data sharing and network all denied), refund-above-limit (guest's assistant denied, host's assistant asks a person), other-guest-details (both sides refuse). With a store, allowed calls change the state (arrival note, issue, pretend refund) and every call is logged; without an active booking a stand-in is used and nothing is written.

Requests for the conductor (existing files I did not touch)

  1. README.md / REALITY.md: add the simulation core once it is wired into pages (REALITY.md: "a thing not written there does not exist").
  2. The visitor pages (src/assets/js/house.js, home.js, houses.js) use availability.isTaken(home, day, realToday) and availability.price(). For the visitor site and the admin to agree, they should read availability and quotes from sim/booking.js (createBooking(...).calendar() / .quote()) with the store's clock. Until then the two calendars differ.
  3. Behind the scenes (scripts/behind.mjs): credit "figure design after the storyboard kit of storyboards.sgit.ai, Apache-2.0" on the page, as SYNTHETIC-USERS.md 3.4 recommends.
  4. scripts/validate.mjs checks only _site/; the sim files pass its patterns today. If the pages import sim/*.js, nothing else is needed: the build copies src/ as is.
  5. team/scopes.json / scripts/role-scope.mjs: no change needed (all files are under src/ and tests/).
  6. Open points for Dinis or the conductor: the Faro 7-night cap (low confidence) is applied; the invented rates, refund rule, commission (15 percent) and costs are proposals; the host's assistant's refund limit (EUR 100) and spend limit (EUR 200) are proposals.

Limits

Ask the agent (a simulation: pre-written answers, no live model)