Skip to content

Docker-less development sandbox, current front-end libraries, and the hx-boost lifecycle graph fix - #180

Open
frousselet wants to merge 3 commits into
mainfrom
chore/dev-sandbox-bootstrap
Open

frousselet wants to merge 3 commits into
mainfrom
chore/dev-sandbox-bootstrap

Conversation

@frousselet

@frousselet frousselet commented Sep 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Three tooling and maintenance changes that stand on their own but share one branch: a one-command Docker-less development sandbox, the front-end library pins moved to their current releases (which clears an ECharts advisory), and a fix for lifecycle graphs that stayed blank under in-app navigation.

Related issue

None.

Type of change

  • Bug fix
  • New feature
  • Refactor / tech debt
  • Documentation
  • Build / CI / tooling

Changes

  • scripts/bootstrap_dev.sh provisions a throwaway Debian or Ubuntu machine with the environment the Docker image carries: the apt packages the Dockerfile lists (including the Pango / Cairo stack WeasyPrint dlopens, without which every PDF report dies on a missing libgobject), a .venv from requirements.txt, an .env with a random SECRET_KEY, Redis, the mirrored front-end libraries and the compiled translation catalogs. It ends on a check that WeasyPrint, the Office writers and Redis all answer, so a half-provisioned sandbox fails there rather than three screens into the application. It installs an environment and nothing else: no migration, no data, since the first-run onboarding screen owns database setup. SQLite by default; --with-postgres adds the server, the role and an empty database, --with-chrome the browser the screenshot script drives.
  • DOMPurify moves to 3.4.15 and ECharts to 6.1.0 in core/dependencies.py, with their new Subresource-Integrity digests.
  • Lifecycle graphs (the detail-page stepper and the lifecycle editor) now load their renderer through components/lifecycle_graph_lib.html, which calls back once CairnLifecycleGraph is defined. Both templates previously assumed the external <script> had already run, which only holds on a full page load: under an hx-boost swap htmx appends it asynchronously and runs the inline script immediately, so the inline code hit TypeError: Cannot read properties of undefined (reading 'ensureLibs') and the graph stayed blank until a manual reload.
  • Two stale claims corrected: the core/dependencies.py docstring pointed at vendor_assets --upgrade, a flag the command never had (it is --force), and the sankey loader in templates/home.html still described ECharts as coming from a CDN, untrue since v0.36.0 vendored the libraries in-instance.
  • README.md and docs/technical/installation.md document the sandbox script.

Screenshots

No visual change: the lifecycle fix restores rendering that was already specified, and the ECharts major bump was checked to leave the dashboard sankey drawing identically in both themes. Nothing in the diff touches layout, palette or typography.

Checklist

  • Tests added or updated, and pytest passes
  • ruff check passes
  • New feature exposed as MCP tools in mcp/tools.py (accurate docstrings and parameter descriptions)
  • New feature has REST API endpoints under the app's api/ (serializers, viewsets, routes under /api/v1/)
  • UI renders correctly in light and dark mode
  • UI renders correctly on mobile (multi-selects, sticky bars, form layouts)
  • User-facing strings use _() / {% trans %} with French translations in locale/fr/LC_MESSAGES/django.po (no duplicate msgid; compilemessages passes)
  • Lifecycle / workflow respected (state metadata and generic stepper UI; no hardcoded status values)
  • README.md updated (features, MCP tools, tech stack, install) when behaviour changed
  • CHANGELOG.md updated under ## [Unreleased]
  • Brand guidelines respected (docs/brand/brand-guidelines.md); no em dash characters
  • Relevant spec under docs/specs/ updated in the same PR
  • Project / documentation screenshots captured at 2560x1440 (16:9, 1440p)
  • Audit-grade rigor preserved (approval workflows, versioning, history, permission checks not bypassed)

Unticked items and why: no test was added, since the branch is a shell script plus two template script-loading fixes, and the suite is unchanged (it runs green on this PR: Tests in 3m48s, Documentation in 35s). No MCP tool or REST endpoint, no new domain behaviour to expose. No mobile check, as no layout changed. No spec under docs/specs/ applies: the sandbox is documented in docs/technical/installation.md, and the lifecycle fix restores behaviour the spec already describes. No screenshot was captured, since no surface changed appearance.

🤖 Generated with Claude Code

https://claude.ai/code/session_012AkKwXgtDpRAq55kvzU1Dc

scripts/bootstrap_dev.sh gives a throwaway Debian/Ubuntu machine the
environment the Docker image carries : the apt packages the Dockerfile lists
(gettext, libpq, and the Pango / Cairo stack WeasyPrint dlopens, without which
every PDF report dies on a missing libgobject), a .venv with requirements.txt,
an .env carrying a random SECRET_KEY, Redis, the mirrored front-end libraries
and the compiled translation catalogs. It ends on a check that WeasyPrint, the
Office writers and Redis all answer, so a half-provisioned sandbox fails here
rather than three screens into the application.

It installs an environment and nothing else : no migration, no data. The
first-run onboarding screen owns database setup, and still does. SQLite
(core.settings_local) by default; --with-postgres adds the server, the role and
an empty database for full parity, and --with-chrome the browser the screenshot
script drives.

Outside compose nothing reads .env, so the script exports it for its own steps
and overrides the "db" and "redis" host names, which resolve to nothing on a
single machine.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ECharts 6.1.0 clears GHSA-fgmj-fm8m-jvvx, an XSS in the `lines` series
tooltip. The dashboard only draws a sankey, so the sink was never reached,
but the pin carried the advisory. Verified the chart still renders in both
themes after the major bump.

Two stale claims about the vendoring, both wrong since v0.36.0 moved the
libraries in-instance: the registry docstring pointed at `vendor_assets
--upgrade`, a flag the command never had (it is `--force`), and the sankey
loader still said echarts came from a CDN.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both templates loaded the renderer as `<script src=lifecycle_graph.js>` and
then used `CairnLifecycleGraph.ensureLibs` from the inline script right after.
That ordering only holds on a full page load, where the parser blocks on the
external file. Under an hx-boost swap htmx appends the external script
asynchronously and runs the inline one immediately, so the inline code hit an
undefined `CairnLifecycleGraph` :

  TypeError: Cannot read properties of undefined (reading 'ensureLibs')

The detail page's stepper stayed blank and the lifecycle editor lost its graph
and its steps/transitions tables until the user reloaded by hand.

Both now go through `components/lifecycle_graph_lib.html`, which loads the
renderer on demand and calls back once it is defined, the pattern the sankey
and dependency graphs already use for their own libraries.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@frousselet

Copy link
Copy Markdown
Owner Author

Verification status for the branch as opened, no code change since:

  • Tests workflow green in 3m48s: ruff check, compilemessages, then pytest -x -v --cov.
  • Documentation workflow green in 35s: manage.py generate_docs --check and scripts/build_wiki.py --check, so the generated reference is current despite the core/dependencies.py pin changes and every internal link still resolves.
  • ruff check also run locally on the branch before opening: clean.

Covers the ruff check checklist item. The test item stays unticked because no test was added, not because the suite fails: the diff is a shell script plus two template script-loading fixes.

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