diff --git a/.kilocode/rules/specify-rules.md b/.kilocode/rules/specify-rules.md index 67d96d9..0dfa8b4 100644 --- a/.kilocode/rules/specify-rules.md +++ b/.kilocode/rules/specify-rules.md @@ -29,9 +29,9 @@ cd src; pytest; ruff check . Python 3.9+ (Backend), Node.js 18+ (Frontend Build): Follow standard conventions ## Recent Changes +- 006-configurable-belief-logs: Added Python 3.9+ + FastAPI (Backend), Pydantic (Config), Svelte (Frontend) - 005-fix-ui-ws-validation: Added Python 3.9+ (Backend), Node.js 18+ (Frontend Build) - 005-fix-ui-ws-validation: Added Python 3.9+, Node.js 18+ + FastAPI, SvelteKit, Tailwind CSS, Pydantic -- 005-fix-ui-ws-validation: Added Python 3.9+, Node.js 18+ + FastAPI, SvelteKit, Tailwind CSS, Pydantic diff --git a/.specify/memory/constitution.md b/.specify/memory/constitution.md index 185414e..4145211 100644 --- a/.specify/memory/constitution.md +++ b/.specify/memory/constitution.md @@ -1,29 +1,68 @@ -# ss-tools Constitution + +# Semantic Code Generation Constitution ## Core Principles -### I. SPA-First Architecture -The frontend MUST be a Static Single Page Application (SPA) served by the Python backend. No Node.js server is permitted in production. The backend serves the `index.html` entry point for all non-API routes. +### I. Causal Validity (Contracts First) +Semantic definitions (Contracts) must ALWAYS precede implementation code. Logic is downstream of definition. We define the structure and constraints (`[DEF]`, `@PRE`, `@POST`) before writing the executable logic. This ensures that the "what" and "why" govern the "how". -### II. API-Driven Communication -All data retrieval and state changes MUST be performed via the backend REST API or WebSockets. The frontend should not access the database or filesystem directly. +### II. Immutability of Architecture +Once defined, architectural decisions in the Module Header (`@LAYER`, `@INVARIANT`, `@CONSTRAINT`) are treated as immutable constraints for that module. Changes to these require an explicit refactoring step, not ad-hoc modification during implementation. -### III. Modern Stack Consistency -The project strictly uses SvelteKit (Frontend), FastAPI (Backend), and Tailwind CSS (Styling). New dependencies must be justified and approved. +### III. Semantic Format Compliance +All output must strictly follow the `[DEF]` / `[/DEF]` anchor syntax with specific Metadata Tags (`@KEY`) and Graph Relations (`@RELATION`). This structure is non-negotiable as it ensures the codebase remains machine-readable, fractal-structured, and optimized for Sparse Attention navigation by AI agents. -### IV. Semantic Protocol Adherence (GRACE-Poly) -All code generation and modification MUST adhere to the Semantic Protocol defined in `semantic_protocol.md`. -- **Anchors**: Use `[DEF:id:Type]` and `[/DEF:id]` to define semantic boundaries. -- **Contracts**: Define `@PRE` and `@POST` conditions in headers. -- **Logging**: Use structured logging with `[AnchorID][State]` format. -- **Immutability**: Respect architectural decisions in headers. +### IV. Design by Contract (DbC) +Contracts are the Source of Truth. Functions and Classes must define their purpose, specifications, and constraints (`@PRE`, `@POST`, `@THROW`) in the metadata block before implementation. Implementation must strictly satisfy these contracts. + +### V. Belief State Logging +Logs must define the agent's internal state for debugging and coherence checks. We use a strict format: `logger.level(f"[{ANCHOR_ID}][{STATE}] {MESSAGE} context={...}")` to track transitions between `Entry`, `Validation`, `Action`, and `Coherence` states. + +## File Structure Standards + +### Python Modules +Every `.py` file must start with a Module definition header (`[DEF:module_name:Module]`) containing: +- `@SEMANTICS`: Keywords for vector search. +- `@PURPOSE`: Primary responsibility of the module. +- `@LAYER`: Architecture layer (Domain/Infra/UI). +- `@RELATION`: Dependencies. +- `@INVARIANT` & `@CONSTRAINT`: Immutable rules. +- `@PUBLIC_API`: Exported symbols. + +### Svelte Components +Every `.svelte` file must start with a Component definition header (`[DEF:ComponentName:Component]`) wrapped in an HTML comment `` containing: +- `@SEMANTICS`: Keywords for vector search. +- `@PURPOSE`: Primary responsibility of the component. +- `@LAYER`: Architecture layer (UI/State/Layout). +- `@RELATION`: Child components, Stores used, API calls. +- `@PROPS`: Input properties. +- `@EVENTS`: Emitted events. +- `@INVARIANT`: Immutable UI/State rules. + +## Generation Workflow +The development process follows a strict sequence: +1. **Analyze Request**: Identify target module and graph position. +2. **Define Structure**: Generate `[DEF]` anchors and Contracts FIRST. +3. **Implement Logic**: Write code satisfying Contracts. +4. **Validate**: If logic conflicts with Contract -> Stop -> Report Error. ## Governance +This Constitution establishes the "Semantic Code Generation Protocol" as the supreme law of this repository. -### Compliance -All Pull Requests and code modifications must be verified against this Constitution. Violations of Core Principles are considered critical defects. +- **Automated Enforcement**: All code generation tools and agents must parse and validate adherence to the `[DEF]` syntax and Contract requirements. +- **Amendments**: Changes to the syntax or core principles require a formal amendment to this Constitution and a corresponding update to the constitution +- **Review**: Code reviews must verify that implementation matches the preceding contracts and that no "naked code" exists outside of semantic anchors. +- **Compliance**: Failure to adhere to the `[DEF]` / `[/DEF]` structure constitutes a build failure. -### Amendments -Changes to this Constitution require a formal RFC process and approval from the project lead. - -**Version**: 1.0.0 | **Ratified**: 2025-12-20 +**Version**: 1.1.0 | **Ratified**: 2025-12-19 | **Last Amended**: 2025-12-19 diff --git a/frontend/.svelte-kit/ambient.d.ts b/frontend/.svelte-kit/ambient.d.ts index 743d147..18881f9 100644 --- a/frontend/.svelte-kit/ambient.d.ts +++ b/frontend/.svelte-kit/ambient.d.ts @@ -26,57 +26,85 @@ * ``` */ declare module '$env/static/private' { - export const LESSOPEN: string; export const USER: string; export const npm_config_user_agent: string; + export const XDG_SESSION_TYPE: string; export const npm_node_execpath: string; export const SHLVL: string; export const npm_config_noproxy: string; + export const LESS: string; export const HOME: string; export const OLDPWD: string; + export const DESKTOP_SESSION: string; export const npm_package_json: string; + export const LSCOLORS: string; + export const ZSH: string; + export const GNOME_SHELL_SESSION_MODE: string; + export const GTK_MODULES: string; + export const PAGER: string; export const PS1: string; export const npm_config_userconfig: string; export const npm_config_local_prefix: string; + export const SYSTEMD_EXEC_PID: string; export const DBUS_SESSION_BUS_ADDRESS: string; - export const WSL_DISTRO_NAME: string; + export const COLORTERM: string; export const COLOR: string; + export const npm_config_metrics_registry: string; export const WAYLAND_DISPLAY: string; export const LOGNAME: string; - export const NAME: string; - export const WSL_INTEROP: string; - export const PULSE_SERVER: string; + export const SDKMAN_CANDIDATES_API: string; export const _: string; export const npm_config_prefix: string; - export const npm_config_npm_version: string; + export const MEMORY_PRESSURE_WATCH: string; + export const XDG_SESSION_CLASS: string; + export const USERNAME: string; export const TERM: string; export const npm_config_cache: string; + export const GNOME_DESKTOP_SESSION_ID: string; export const npm_config_node_gyp: string; export const PATH: string; + export const SDKMAN_CANDIDATES_DIR: string; export const NODE: string; export const npm_package_name: string; + export const XDG_MENU_PREFIX: string; + export const SDKMAN_BROKER_API: string; + export const GNOME_TERMINAL_SCREEN: string; + export const GNOME_SETUP_DISPLAY: string; export const XDG_RUNTIME_DIR: string; export const DISPLAY: string; export const LANG: string; + export const XDG_CURRENT_DESKTOP: string; export const VIRTUAL_ENV_PROMPT: string; + export const XMODIFIERS: string; + export const XDG_SESSION_DESKTOP: string; + export const XAUTHORITY: string; export const LS_COLORS: string; + export const GNOME_TERMINAL_SERVICE: string; + export const SDKMAN_DIR: string; + export const SDKMAN_PLATFORM: string; export const npm_lifecycle_script: string; + export const SSH_AUTH_SOCK: string; export const SHELL: string; export const npm_package_version: string; export const npm_lifecycle_event: string; + export const QT_ACCESSIBILITY: string; + export const GDMSESSION: string; export const GOOGLE_CLOUD_PROJECT: string; - export const LESSCLOSE: string; + export const GPG_AGENT_INFO: string; export const VIRTUAL_ENV: string; + export const QT_IM_MODULE: string; export const npm_config_globalconfig: string; export const npm_config_init_module: string; + export const JAVA_HOME: string; export const PWD: string; + export const npm_config_globalignorefile: string; export const npm_execpath: string; export const XDG_DATA_DIRS: string; export const npm_config_global_prefix: string; export const npm_command: string; - export const WSL2_GUI_APPS_ENABLED: string; - export const HOSTTYPE: string; - export const WSLENV: string; + export const QT_IM_MODULES: string; + export const MEMORY_PRESSURE_WRITE: string; + export const VTE_VERSION: string; export const INIT_CWD: string; export const EDITOR: string; export const NODE_ENV: string; @@ -109,57 +137,85 @@ declare module '$env/static/public' { */ declare module '$env/dynamic/private' { export const env: { - LESSOPEN: string; USER: string; npm_config_user_agent: string; + XDG_SESSION_TYPE: string; npm_node_execpath: string; SHLVL: string; npm_config_noproxy: string; + LESS: string; HOME: string; OLDPWD: string; + DESKTOP_SESSION: string; npm_package_json: string; + LSCOLORS: string; + ZSH: string; + GNOME_SHELL_SESSION_MODE: string; + GTK_MODULES: string; + PAGER: string; PS1: string; npm_config_userconfig: string; npm_config_local_prefix: string; + SYSTEMD_EXEC_PID: string; DBUS_SESSION_BUS_ADDRESS: string; - WSL_DISTRO_NAME: string; + COLORTERM: string; COLOR: string; + npm_config_metrics_registry: string; WAYLAND_DISPLAY: string; LOGNAME: string; - NAME: string; - WSL_INTEROP: string; - PULSE_SERVER: string; + SDKMAN_CANDIDATES_API: string; _: string; npm_config_prefix: string; - npm_config_npm_version: string; + MEMORY_PRESSURE_WATCH: string; + XDG_SESSION_CLASS: string; + USERNAME: string; TERM: string; npm_config_cache: string; + GNOME_DESKTOP_SESSION_ID: string; npm_config_node_gyp: string; PATH: string; + SDKMAN_CANDIDATES_DIR: string; NODE: string; npm_package_name: string; + XDG_MENU_PREFIX: string; + SDKMAN_BROKER_API: string; + GNOME_TERMINAL_SCREEN: string; + GNOME_SETUP_DISPLAY: string; XDG_RUNTIME_DIR: string; DISPLAY: string; LANG: string; + XDG_CURRENT_DESKTOP: string; VIRTUAL_ENV_PROMPT: string; + XMODIFIERS: string; + XDG_SESSION_DESKTOP: string; + XAUTHORITY: string; LS_COLORS: string; + GNOME_TERMINAL_SERVICE: string; + SDKMAN_DIR: string; + SDKMAN_PLATFORM: string; npm_lifecycle_script: string; + SSH_AUTH_SOCK: string; SHELL: string; npm_package_version: string; npm_lifecycle_event: string; + QT_ACCESSIBILITY: string; + GDMSESSION: string; GOOGLE_CLOUD_PROJECT: string; - LESSCLOSE: string; + GPG_AGENT_INFO: string; VIRTUAL_ENV: string; + QT_IM_MODULE: string; npm_config_globalconfig: string; npm_config_init_module: string; + JAVA_HOME: string; PWD: string; + npm_config_globalignorefile: string; npm_execpath: string; XDG_DATA_DIRS: string; npm_config_global_prefix: string; npm_command: string; - WSL2_GUI_APPS_ENABLED: string; - HOSTTYPE: string; - WSLENV: string; + QT_IM_MODULES: string; + MEMORY_PRESSURE_WRITE: string; + VTE_VERSION: string; INIT_CWD: string; EDITOR: string; NODE_ENV: string; diff --git a/frontend/.svelte-kit/generated/server/internal.js b/frontend/.svelte-kit/generated/server/internal.js index 8802244..c273114 100644 --- a/frontend/.svelte-kit/generated/server/internal.js +++ b/frontend/.svelte-kit/generated/server/internal.js @@ -24,7 +24,7 @@ export const options = { app: ({ head, body, assets, nonce, env }) => "\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t" + head + "\n\t\n\t\n\t\t
" + body + "
\n\t\n\n", error: ({ status, message }) => "\n\n\t\n\t\t\n\t\t" + message + "\n\n\t\t\n\t\n\t\n\t\t
\n\t\t\t" + status + "\n\t\t\t
\n\t\t\t\t

" + message + "

\n\t\t\t
\n\t\t
\n\t\n\n" }, - version_hash: "1pvaiah" + version_hash: "uq8l2w" }; export async function get_hooks() { diff --git a/frontend/src/components/Navbar.svelte b/frontend/src/components/Navbar.svelte index 64fde12..2f9e80e 100644 --- a/frontend/src/components/Navbar.svelte +++ b/frontend/src/components/Navbar.svelte @@ -16,6 +16,12 @@ > Dashboard + + Migration + Regular expression to filter dashboards to migrate.

-
- - +
+
+ + +
+ +
+ Manage Mappings → +