Jérôme Benoit [Mon, 11 May 2026 19:20:30 +0000 (21:20 +0200)]
refactor: consolidate object-check utilities to eliminate duplication
Replace type() + isObject with a single isPlainObject helper.
Make isJsonObject and assertIsJsonObject delegate through it
instead of duplicating the check logic independently.
Jérôme Benoit [Mon, 11 May 2026 18:43:22 +0000 (20:43 +0200)]
refactor: remove unnecessary type assertions across monorepo
- Remove all @typescript-eslint/no-unnecessary-type-assertion violations
- Add assertIsJsonObject/isJsonObject utilities for runtime-safe narrowing
- Restructure OCPP16RequestService.buildRequestPayload with proper
runtime validation (assertIsJsonObject + OCPPError) replacing unsafe cast
- Use _syncResult assignment pattern in OCPPResponseService for
no-floating-promises compliance while preserving isAsyncFunction pattern
- Refine AsyncLock.runExclusive fn parameter as union of function types
for proper isAsyncFunction type guard narrowing
- Configure varsIgnorePattern: '^_' for @typescript-eslint/no-unused-vars
- Remove unused type imports in test files
renovate[bot] [Mon, 11 May 2026 13:14:03 +0000 (15:14 +0200)]
chore(deps): update pnpm to v11 (#1850)
* chore(deps): update pnpm to v11
* fix: migrate pnpm settings from package.json to pnpm-workspace.yaml
pnpm 11 no longer reads the 'pnpm' field from package.json.
Move patchedDependencies and allowBuilds to pnpm-workspace.yaml.
Remove dead pnpm field from package.json.
fix: resolve #1244 — add per-connector maximum power support (#1843)
* feat(charging-station): add per-connector maximum power support
Add maximumPower field to ConnectorStatus representing the physical
limitation of each connector cable/plug (thermal current rating).
Per OCPP Device Model, AvailablePowerMaxLimit is defined at the
Connector component level. The connector maximumPower acts as a
hardware cap in the power computation pipeline alongside the station-
level powerDivider sharing mechanism.
- Add ConnectorStatus.maximumPower?: number (in W)
- Initialize at boot via initializeConnectorsMaximumPower(): default
is stationPower / staticConnectorCount (using static count, not
dynamic powerDivider which can be 0 in shared mode at init)
- Clamp in getConnectorMaximumAvailablePower as additional min() term
- Use in getConnectorChargingProfilesLimit as primary cap (falls back
to stationPower/powerDivider for backward compat)
- Update 6 shared-mode templates with explicit maximumPower per
connector (= station power for DC shared-bus stations)
Resolves #1244
* chore(sandcastle): update validation and main scripts
* chore: sync release-please manifests and sandcastle prompt
* fix(charging-station): exclude index 0 from staticCount in getDefaultConnectorMaximumPower
The staticCount calculation included EVSE 0 and connector 0, while runtime
getPowerDivider excludes them. This caused connector hardware caps to be
more restrictive than intended (e.g., stationPower/3 instead of
stationPower/2 on a 2-EVSE station with EVSE 0 defined).
* [autofix.ci] apply automated fixes
* refactor(charging-station): add NaN guard to connectorHardwareMaximumPower in min()
Align the connectorHardwareMaximumPower entry with the same null/NaN guard
pattern used by all other entries in the min() call for consistency and
defensive robustness.
* docs: document per-connector maximumPower in template examples
Add maximumPower field to Connectors and Evses section examples.
Clarify powerSharedByConnectors behavior description.
Jérôme Benoit [Fri, 8 May 2026 18:45:44 +0000 (20:45 +0200)]
fix(ui/web): smooth icon-btn danger hover shadow and remove dead token
- Add box-shadow to .modern-icon-btn transition shorthand so the danger
variant hover glow animates instead of snapping
- Remove --skin-shadow-color (declared line 61 but never consumed)
Jérôme Benoit [Fri, 8 May 2026 18:30:30 +0000 (20:30 +0200)]
fix(ui/web): fix editable pill hover visibility in light themes
Refactor pill background to use scoped --_pill-bg and --_pill-bg-hover
custom properties (MD3 pattern). Each variant co-locates its base and
hover background values, and light-mode overrides reassign both.
The hover rule simply consumes var(--_pill-bg-hover), eliminating the
specificity battle that prevented the hover effect from appearing in
light themes.
Jérôme Benoit [Fri, 8 May 2026 18:00:49 +0000 (20:00 +0200)]
refactor(ui/web): remove redundant connector status column from classic skin
The connector status is now accessible via the Set Status dropdown in
the Actions column, making the dedicated read-only Status column
redundant. Move status/error-code selects to the top of Actions and
style them to fill the column width consistently with buttons.
Jérôme Benoit [Fri, 8 May 2026 15:08:22 +0000 (17:08 +0200)]
fix(sandcastle): patch pi thinking option and replace type indirections
Apply pnpm patch for @ai-hero/sandcastle porting PR #584 (pi --thinking
flag). Wire the thinking option through agentProvider() and replace
Awaited<ReturnType<...>> indirections with direct type imports (Sandbox,
SandboxRunResult, RunResult, PiOptions).
Jérôme Benoit [Fri, 8 May 2026 14:09:44 +0000 (16:09 +0200)]
fix(sandcastle): wire reasoning effort through to agent providers
Pass AGENT_*_EFFORT constants through agentProvider() to the opencode
provider's variant flag. LoopStrategy gains actorEffort/criticEffort
optional overrides following the same pattern as actorModel/criticModel.
- opencode: effort mapped to --variant CLI flag
- pi: no effort support (provider limitation, param silently ignored)
Jérôme Benoit [Thu, 7 May 2026 23:48:28 +0000 (01:48 +0200)]
refactor(sandcastle): remove plannerOutput from TaskSpec
Raw agent stdout will be handled by sandcastle's own debug/logging
mechanism rather than stored in-memory on TaskSpec. Structured fields
(acceptanceCriteria, rootCauseHypothesis, confidence, issueType) remain
as the sole inter-agent communication channel.
Jérôme Benoit [Thu, 7 May 2026 23:33:21 +0000 (01:33 +0200)]
refactor(sandcastle): remove redundant lastFindings from LoopResult
Derive last-round findings from roundHistory.at(-1)?.findings in
finalizer.ts instead of maintaining a separate field. The PR body
now shows all critic findings from the final round (including LOW
confidence) for full transparency.
Jérôme Benoit [Thu, 7 May 2026 23:20:58 +0000 (01:20 +0200)]
fix(sandcastle): assign opus to actor, sonnet to planner, increase planner iterations
Swap model assignments: claude-opus-4.6 (high effort) for the actor,
claude-sonnet-4.6 (medium effort) for the planner. Increase planner
maxIterations from 1 to 5 so it can actually read AGENTS.md and
project context before producing its analysis.
Jérôme Benoit [Thu, 7 May 2026 23:04:27 +0000 (01:04 +0200)]
feat(sandcastle): enrich planner with acceptance criteria and root cause hypothesis
The planner now produces structured analysis per issue: issueType,
confidence, rootCauseHypothesis, and acceptanceCriteria. These flow
into the actor prompt (confidence-gated hypothesis + criteria) and the
critic prompt (criteria as verification checklist).
- Confidence controls plan specificity: high → full context, medium/low → criteria only
- All planner-generated fields are sanitized and length-bounded
- Critic evaluates observable outcomes, never plan adherence
- Backward-compatible: missing fields result in empty template variables
Jérôme Benoit [Thu, 7 May 2026 22:36:27 +0000 (00:36 +0200)]
feat(sandcastle): add roundHistory to LoopResult and plannerOutput to TaskSpec
Replace the unused onRoundComplete callback with a structured
roundHistory array that accumulates RoundSnapshot per round
(including post-loop validation retry). Attach raw planner stdout
to TaskSpec.plannerOutput for downstream verification use.
This enables a future planner-verification step to receive the full
findings history alongside the original plan context.
fix(ui): allow changing status of individual connectors (#1834)
* feat(ui/web): allow changing status of individual connectors
Add a 'Set Status' action to the connector UI in both modern and classic
skins. Users can simulate OCPP connector statuses (e.g. Faulted, Unavailable)
directly from the dashboard.
- UIClient.setConnectorStatus sends STATUS_NOTIFICATION via existing ProcedureName
- useConnectorActions exposes setConnectorStatus with pending.setStatus guard
- Modern skin: SetConnectorStatusDialog presents a status picker in a modal
- Classic skin: inline <select> triggers status change on change event
- Test helpers and composable tests updated accordingly
* fix: correct OCPP version handling for connector status changes
- Add OCPP20ConnectorStatusEnumType enum to ui-common
- Fix UIClient.setConnectorStatus to send version-aware payload:
connectorStatus field for OCPP 2.0.x, status field for OCPP 1.6
- Update useConnectorActions to accept ocppVersion and pass it through;
widen status parameter type to union of 1.6 and 2.0.x enums;
accept optional onSuccess callback per action invocation
- Fix SetConnectorStatusDialog to close only after action resolves
(pass close as onSuccess instead of calling it immediately)
- Show version-appropriate status options in SetConnectorStatusDialog
- Forward ocppVersion and onRefresh from ConnectorRow to dialog
- Propagate need-refresh event through ConnectorRow → StationCard → ModernLayout
- Add tests for new OCPP 2.0.x paths and dialog behaviour
* [autofix.ci] apply automated fixes
* feat(ui): complete connector status change with error simulation and local state update
- Fix classic skin to show version-appropriate status options (OCPP 1.6/2.0.x)
- Pass ocppVersion to useConnectorActions in classic skin
- Replace passthrough STATUS_NOTIFICATION handler with sendAndSetConnectorStatus
to update in-memory connector state and emit connectorStatusChanged event
- Add OCPP 1.6 errorCode support (issue requests error simulation capability)
- Add OCPP16ChargePointErrorCode enum to ui-common
- Add error code selector in both skins (OCPP 1.6 only, hidden for 2.0.x)
- Remove unnecessary re-exports from useConnectorActions composable
- Update tests for new errorCode parameter and passthrough behavior change
Resolves the outstanding HIGH findings from automated review.
* fix(ui): polish connector status — reactivity consistency, JSDoc, tests, init from current status
- Wrap props in computed() in SetConnectorStatusDialog for consistency
- Fix JSDoc on mountDialog test helper to satisfy jsdoc/require-jsdoc
- Initialize selectedStatus from connector.status for OCPP 2.0.x too
- Add 5 unit tests for classic skin CSConnector status change behavior
* refactor(ui): remove redundant onRefresh from connector actions
The server already pushes a REFRESH notification via WebSocket when
connector state changes (connectorStatusChanged → buildUpdatedMessage →
workerEventUpdated → scheduleClientNotification → REFRESH broadcast).
The onRefresh callback in useConnectorActions duplicated this by manually
calling getChargingStations() after each action. Remove it along with
the need-refresh event bubbling chain in the modern skin.
The useAsyncAction onRefresh mechanism remains available for composables
where the server does NOT push updates (e.g., useStationActions).
Factor version-aware StatusNotification payload construction into
ui-common alongside existing buildAuthorize/Start/StopTransactionPayload
builders. Both CLI and Web UI now use the shared builder, eliminating
duplicated OCPP 1.6 vs 2.0.x branching logic.
Remove string fallback from status/errorCode parameters — the builder
accepts only the OCPP enum types. The CLI casts user input at the call
site, keeping the shared API type-safe.
* [autofix.ci] apply automated fixes
* fix(ui-common): remove invalid Occupied from OCPP16ChargePointStatus enum
Occupied is an OCPP 2.0.x-only connector status. It was erroneously
included in the OCPP 1.6 enum, causing the UI dropdown to offer an
invalid status option for OCPP 1.6 stations. Tests referencing it are
updated to use OCPP20ConnectorStatusEnumType.OCCUPIED or a valid 1.6
status as appropriate.
* fix(ui-common): make ChargePointStatus a union of OCPP 1.6 and 2.0.x enums
ChargePointStatus was aliased to OCPP16ChargePointStatus only, which
made ConnectorStatus.status unable to represent OCPP 2.0.x values like
Occupied. Now it is OCPP16ChargePointStatus | OCPP20ConnectorStatusEnumType,
matching the src/ canonical ConnectorStatusEnum pattern.
* refactor(ui-common): use ChargePointStatus type alias instead of inline union
Replace all occurrences of the verbose
'OCPP16ChargePointStatus | OCPP20ConnectorStatusEnumType' inline union
with the existing ChargePointStatus type alias across ui-common, web UI,
and CLI.
* [autofix.ci] apply automated fixes
* fix: add connectorId guard to handleStatusNotification for consistency
Other broadcast channel handlers (handleMeterValues, UNLOCK_CONNECTOR,
LOCK_CONNECTOR) throw BaseError when connectorId is missing. Without
this guard, a malformed request would silently succeed.
* fix(ui): address review feedback — clickable status pill, stale state sync, error-code apply
Modern skin:
- Replace 'Set Status' button with clickable status pill (edit icon on
hover, tooltip with status, aria-haspopup=dialog). More compact UX per
reviewer request (DerGenaue).
- Add .modern-pill--editable CSS with hover border, focus ring, and
fade-in edit icon.
Classic skin:
- Add watch on props.connector.status to sync selectedStatus ref when
server pushes new state (fixes stale dropdown after external changes).
- Add @change handler on error-code select so changing errorCode alone
also triggers a StatusNotification (previously only status change did).
Addresses review feedback from hyperspace-insights, copilot, and
DerGenaue.
Backend:
- Add errorCode field to ConnectorStatus (src/ and ui-common)
- Persist errorCode in sendAndSetConnectorStatus alongside status
- Move errorCode defaulting from buildStatusNotificationRequest to
OCPP16RequestService.buildRequestPayload via spread default pattern:
{ errorCode: NO_ERROR, ...commandParams }
- Remove Partial<> cast and ?? fallback from the builder — it now
simply passes through commandParams.errorCode (always defined by
the time it reaches the builder)
UI:
- Status pill tooltip shows errorCode when present and not NoError
(e.g., 'Faulted (ConnectorLockFailure)'), per DerGenaue's request
- ConnectorStatus.errorCode propagates automatically through existing
buildUpdatedMessage → spread serialization chain
Introduce AGENT_PROVIDER constant to switch between pi and opencode backends.
pi streams JSON output immediately, avoiding the opencode idle timeout bug
where git check-ignore indexing produces zero stdout.
Also removes redundant copyToWorktree since onSandboxReady pnpm install
handles node_modules via the mounted pnpm store.
Jérôme Benoit [Thu, 7 May 2026 18:26:40 +0000 (20:26 +0200)]
fix(sandcastle): revert idle timeout to 300s and remove redundant copyToWorktree
The 600s timeout was a misguided workaround for serena MCP init. The actual
root cause is an opencode bug: zero stdout during its git check-ignore
indexing phase. Removing copyToWorktree since pnpm install in onSandboxReady
already handles node_modules via the mounted pnpm store.
Jérôme Benoit [Thu, 7 May 2026 08:53:45 +0000 (10:53 +0200)]
refactor(sandcastle): add error observability and type-safe sentinels
- Add failureReason to LoopResult for post-mortem debugging
- Replace captureHeadSha sentinel '' with null (type-safe)
- discover() throws on planner failure (no hidden process.exitCode)
- Add console.debug in hashContextLines for dedup diagnostics
Jérôme Benoit [Thu, 7 May 2026 08:43:02 +0000 (10:43 +0200)]
refactor(sandcastle): improve separation of concerns and API clarity
- Extract runValidation into validation.ts
- Encapsulate nonce in loop (remove from strategy interface)
- Delete dead GRACE_TIMEOUT_MS constant
- Reorganize constants into proper domain groups
- Un-export FindingSchema and extractStderr
- Add uv via griffo.io APT (provides uvx for MCP servers in sandbox)
- Eliminate pipe patterns to prevent silent download failures
- Migrate GitHub CLI key to /etc/apt/keyrings/
- Remove gpg from base deps (no longer needed)
Jérôme Benoit [Wed, 6 May 2026 18:47:38 +0000 (20:47 +0200)]
fix(sandcastle): pre-create .local/share dirs in Dockerfile
Docker creates intermediate directories as root:root for bind mounts.
Pre-creating /home/agent/.local/share/pnpm/store and opencode with
correct ownership prevents EACCES when opencode writes to its data dir.
Jérôme Benoit [Wed, 6 May 2026 18:32:12 +0000 (20:32 +0200)]
fix(sandcastle): remove corepack prepare from Dockerfile
Align with the working Dockerfile from sap-ai-provider. The container
does not need explicit pnpm setup — corepack in node:24 handles it
on demand when pnpm is invoked.
Jérôme Benoit [Sun, 3 May 2026 22:16:34 +0000 (00:16 +0200)]
chore: rename webui component to web for naming consistency
Align the web UI package name and identifiers with the directory
structure (ui/web) and the CLI convention (ui/cli → cli). Renames
package.json name, release-please component, Dockerfile pnpm filter,
SonarCloud project key, and screenshot asset filename.
Jérôme Benoit [Sat, 2 May 2026 21:41:49 +0000 (23:41 +0200)]
fix: stop nullifying wsConnection prematurely in close/terminate
closeWSConnection() and terminateWSConnection() set wsConnection to null
immediately after calling close()/terminate(), but the 'close' event
fires asynchronously afterward. The onClose handler then emitted an
'updated' event with wsState undefined (since wsConnection was null),
causing the UI to display 'ws unknown' instead of 'ws closed'.
Remove the null assignments — the stale WebSocket reference is harmless
(overwritten by the next openWSConnection call) and allows onClose to
read the correct readyState (CLOSED=3) when emitting state updates.
Jérôme Benoit [Sat, 2 May 2026 21:21:24 +0000 (23:21 +0200)]
fix: do not nullify wsConnection in onError handler
The ws library guarantees that a 'close' event always follows an 'error'
event. Eagerly setting wsConnection to null in onError caused the
subsequent onClose handler to emit an 'updated' event with wsState
undefined, making the UI display 'unknown' instead of 'closed'.
Jérôme Benoit [Sat, 2 May 2026 21:08:50 +0000 (23:08 +0200)]
refactor(webui): remove redundant optimistic fetch from modern skin
Rely solely on server push (ServerNotification.REFRESH) for data refresh
after user actions, eliminating the duplicate getChargingStations() call
that was triggered via the need-refresh event chain.