Skip to content

Centralize AXIS configuration data and add config-driven blueprints + validators#2

Open
Code-Yves wants to merge 1 commit into
mainfrom
codex/audit-/axis-folder-structure-and-logic
Open

Centralize AXIS configuration data and add config-driven blueprints + validators#2
Code-Yves wants to merge 1 commit into
mainfrom
codex/audit-/axis-folder-structure-and-logic

Conversation

@Code-Yves
Copy link
Copy Markdown
Owner

Motivation

  • Centralize configuration metadata into a canonical AXIS_CONFIGS data layer to remove scattered hardcoded geometry/area values and provide a single source of truth for configs and asset routing.
  • Support future config-driven floor-plan rendering and configuration-aware blueprint/filtering without changing visible behavior by default via feature flags.
  • Make render asset lookup canonical (case and folder) and safer by allowing configurable render stems per config.
  • Add lightweight developer diagnostics to detect mismatches and surfaced conflicts between legacy code, static sheets and the new config model.

Description

  • Added axis/AGENTS.md with standing project instructions and guidelines for incremental changes.
  • Introduced js/config-data.js which defines AXIS_CONFIGS with canonical metadata for single, stacked, bungalow, duplex, and ushape.
  • Added js/config-validator.js that exposes axisValidateConfigs() and axisValidateBlueprintRegistry() and that runs non-blocking diagnostics at load time (throws only if AXIS_CONFIGS is missing).
  • Modified index.html to consume the centralized config layer: included js/config-data.js and js/config-validator.js, made title/subtext SF adjustments, derived CFG_META, BASE_MODULE_*, CFG_GEOMETRY, and render metadata from AXIS_CONFIGS, and replaced hardcoded render folder/name references with configurable Renders/<stem>.* lookup.
  • Implemented config-aware blueprint plumbing: getBlueprintSheetsForConfig, getActiveBlueprintSheets, feature flags ENABLE_CONFIG_BLUEPRINT_FILTERING and ENABLE_CONFIG_DRIVEN_FLOOR_PLANS, and used the active sheet list across the Blueprints Viewer and related navigation.
  • Added config-driven floor-plan preview builders and adapters: buildConfigDrivenFloorPlanHTML, buildCompareFloorPlanHTML, buildFloorPlanDevNoticeHTML, axisGetFloorPlanMetrics, axisBuildPlanModelFromConfig, and axisValidateFloorPlanGeometry to generate or validate schematic floor-plan HTML from AXIS_CONFIGS (development/preview guarded).
  • Reworked render modal logic to probe Renders/<stem>.(jpg|png|webp) using getRenderAssetCandidates, _probeRenderIndex, and _renderModalFindAllImages, and added axisValidateRenderAssets() for static checking.
  • Unified component blueprint registry construction (COMPONENT_BLUEPRINTS) from BP_SHEETS to avoid duplicate sources of truth.
  • Preserved legacy behavior where conflicts exist via fallbacks and explicit feature flags (no visible behavior changes by default).

Testing

  • Executed the runtime validators in a browser/dev console: axisValidateConfigs() and axisValidateBlueprintRegistry() which produced non-fatal warnings and errors where expected but did not block page load.
  • Ran the config/floor-plan diagnostics: axisValidateFloorPlanGeometry() and axisValidateRenderAssets() in the console and received structured reports describing detected mismatches and candidate render paths.
  • Performed a quick smoke load of axis/index.html to confirm Blueprints Viewer, Render modal, and config picker initialize without throwing (feature flags for config-driven rendering remain off by default).

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95c922a4d9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +125 to +126
const bpSheets = global.BP_SHEETS;
if (!Array.isArray(bpSheets)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Read BP_SHEETS from the actual global binding

axisValidateBlueprintRegistry() pulls sheet data from global.BP_SHEETS, but in this app BP_SHEETS is declared as a top-level const in index.html, which does not become a window property. As a result, running this validator reports BP_SHEETS is missing or not an array even when the registry exists, so the new blueprint validator cannot validate real runtime data.

Useful? React with 👍 / 👎.

Comment thread axis/index.html
Comment on lines +8856 to +8857
if (txt && txt.includes('renders/')) {
report.errors.push(`Lowercase "renders/" found in inline script #${idx + 1}.`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Ignore self-matches in render-path lowercase scan

axisValidateRenderAssets() checks every inline script for the literal renders/, but this validator function itself contains that literal in its own scan logic and error message. That means the check can always produce at least one error on this page, forcing report.ok false and making the diagnostic noisy even when no runtime render paths use lowercase.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant