Commit Graph
100 Commits
Author SHA1 Message Date
retoor 1076696dec chore: replace python -m agents.validator with hawk in all agent mode instructions 2026-06-14 00:36:10 +00:00
retoor 64c8c967e5 fix: add random client IP spoofing to seed data and user sessions for realistic load testing 2026-06-14 00:18:06 +00:00
retoor 45b2b07038 chore: add locust-maintainer agent spec and expand locustfile seed data with polls, reactions, and docs slugs 2026-06-13 23:31:28 +00:00
retoor 1b89f7c49f feat: add seo diagnostics tool with cli commands, config paths, and static versioning
Add SEO_REPORTS_DIR to config, STATIC_VERSION for cache-busting, seo prune/clear CLI subcommands, tools router with seo job endpoints, and boot-versioned static URLs in Dockerfile and Makefile
2026-06-14 00:16:22 +00:00
retoor 61c1ae8c5d feat: add multi-channel Devii sessions with docs search mode and channel-aware conversation persistence 2026-06-13 21:37:13 +00:00
retoor 873186b274 feat: move ctx.base assignment outside fallback object in ApiDocs constructor
The fallback object for window.DEVPLACE_DOCS previously included a `base` property set to `location.origin`, which would override the actual base URL when the global config was present. This change separates the `base` assignment to always use `location.origin` regardless of whether the config object exists, ensuring the API base URL is consistently derived from the current page origin rather than being conditionally set from a potentially missing config property.
2026-06-13 19:56:44 +00:00
retoor fb6961b5e4 chore: add overflow-managed profile tabs with JS layout and responsive CSS 2026-06-13 19:47:50 +00:00
retoor 98f005342d feat: add claude-manual docs page with task-oriented guide and cross-links
Add a new "Manual" documentation page under the Claude section that provides a hands-on, task-oriented guide for using the Claude Code setup. The page covers the mental model of commands, workflows, and subagents, the core five-beat development loop, and practical workflows for adding features, changing code, fixing bugs, and testing. Also update the existing claude.html page to link to the new manual page as the primary entry point for new users, replacing the generic reference to "next pages."
2026-06-13 18:41:20 +00:00
retoor 5c199474f3 fix: switch blob sharding from uuid7 leading hex to random tail in attachments, project_files, and zip_service 2026-06-13 19:12:54 +00:00
retoor 1294c95bed chore: consolidate runtime data layout under single data/ root directory
Migrate all runtime artifacts (database, uploads, VAPID keys, locks, bot state, container workspaces, zip staging) from scattered locations (`var/`, `devplacepy/static/uploads/`) into a unified `data/` directory. Update `config.py` as single source of truth with `DATA_PATHS` registry and `ensure_data_dirs()`, add `devplace migrate-data` CLI command with CRC verification and idempotent relocation, adjust `.dockerignore`, `.env.example`, `.gitignore`, `Dockerfile`, `Makefile`, `README.md`, `AGENTS.md`, `CLAUDE.md`, and all import paths in `attachments.py` to reference `config.UPLOADS_DIR`/`ATTACHMENTS_DIR` instead of computing from `STATIC_DIR`.
2026-06-13 19:06:43 +00:00
retoor de745f7a75 feat: add six specialized Claude agent definitions under .claude/agents for audit, devii, docs, dry, fanout, and frontend maintenance 2026-06-13 18:34:47 +00:00
retoor ede7a863b7 chore: remove stale agent reports and add PYTHONDONTWRITEBYTECODE export to Makefile
Delete four stale SEO and style agent report JSON/MD files from agents/reports/ that had zero findings or were superseded. Export PYTHONDONTWRITEBYTECODE=1 in the Makefile so all make targets suppress bytecode generation, and add a `tree` target that lists the repository file tree via git ls-tree. Update AGENTS.md and CLAUDE.md documentation to reflect that routers now form a directory tree mirroring URL paths and that bytecode writing is disabled project-wide.
2026-06-13 16:27:41 +00:00
retoor 271c84fc06 fix: clean up test fixtures and remove stale .bak test files
- Reset gitea settings after bug tests to prevent cross-test contamination
- Add deleted_at and deleted_by fields to ingress proxy test instance creation
- Call refresh_snapshot after ingress proxy test setup and teardown
- Remove orphaned .bak test files (test_attachments.py.bak, test_demo.py.bak) that were left behind from a previous refactor
2026-06-13 15:14:52 +00:00
retoor 43f4011005 chore: reorganize test files into domain-specific subdirectories under tests/
Split the monolithic test directory into three tiers (unit, api, e2e) with a path-mirroring directory structure. Added corresponding Makefile targets (test-unit, test-api, test-e2e) and updated all documentation references (CLAUDE.md, README.md, testing-cicd.html, testing-framework.html, testing-make.html) to reflect the new layout and naming conventions.
2026-06-13 14:32:33 +00:00
retoor 014c4c6bb3 feat: add search input field with placeholder text to main header component
Introduce a new sidebar search template that renders a filter form with a hidden input loop and a text input bound to the `_placeholder` variable, supporting GET requests and a maxlength of 100 characters.
2026-06-13 13:25:27 +00:00
retoor 7985336934 docs: document shared search pattern for feed, gists, and project listings
Add a reusable `text_search_clause` helper in `database.py` that builds a SQLAlchemy `or_` of `ilike` clauses over specified columns, returning `None` when search is blank or the table lacks the columns. Wire it into `get_feed_posts`, `get_gists_list`, and the projects listing so all three public index pages support free-text search via a `search` query parameter. Introduce `_sidebar_search.html` as the single search-box partial, included at the top of each listing's left filter panel with `_action`, `_placeholder`, and `_hidden` locals to preserve active category/tab filters on submit. Expose the `search` field on `FeedOut`, `GistsOut`, and `ProjectsOut` API schemas with corresponding OpenAPI documentation. Update `CLAUDE.md` to note the rate-limiter exemption for `GET`/`HEAD` and the `/openai` gateway, and refresh `README.md` route tables to mention the new search capability on `/feed`, `/gists`, and `/projects`.
2026-06-13 13:24:48 +00:00
retoor 6756c980cf fix: correct spelling of "Update" in commit message to "Update" 2026-06-13 12:56:35 +00:00
retoor aa1598009e fix: prevent titlebar dblclick maximize when target is a button in FloatingWindow and DeviiTerminal 2026-06-13 11:54:35 +00:00
retoor 0e0f18724a feat: add hidden button support and syncControls for window state consistency across terminal components 2026-06-13 11:42:40 +00:00
retoor c1f314f2c6 chore: add pretty_json utility and sibling comment awareness to bot realism mechanics 2026-06-12 06:30:17 +00:00
retoor ce3cae1433 feat: add startup jitter, randomized browser fingerprints, and comment style variants to bot fleet
Introduce `startup_jitter_seconds` config field so each bot delays its first session by a random amount up to the configured maximum, spreading fleet activity on service start. Persist a randomly chosen user-agent and viewport per bot in `BotState` and pass them to `BotBrowser` constructor, replacing the hardcoded defaults with a varied pool defined in `config.py`. Add `HANDLE_SUFFIX_WORDS` list and remove numeric suffixes from handle generation to avoid bot-farm appearance. Implement `pick_comment_style` and `is_short_comment_style` static methods in `LLMClient`, extend `generate_comment` with a `style` parameter that produces one-liner or question variants using `MIN_SHORT_COMMENT_LEN`, and wire session comment caps (`SESSION_COMMENT_CAP_MIN/MAX`) with cooldown intervals (`COMMENT_COOLDOWN_MIN/MAX_SECONDS`) into the bot loop. Update `BotRuntimeConfig`, `BotsService` config field registration, and architecture docs to reflect the new identity and pacing logic.
2026-06-13 11:19:32 +00:00
retoor 89635dd7e1 feat: remove PwaInstaller class and its import from Application.js and template button
The diff removes the entire PwaInstaller.js module (51 lines) along with its import and instantiation in Application.js, and deletes the associated data-pwa-install button from the base.html template. This eliminates the progressive web app installation prompt functionality from the frontend, including the beforeinstallprompt event listener, deferred prompt handling, trigger visibility toggling, and the install method that invoked the browser's native install dialog.
2026-06-13 10:43:46 +00:00
retoor 90a3c593bb fix: restrict devii user access to audit logs with read-only permissions 2026-06-13 10:32:03 +00:00
retoor 5e4f0b1f3f feat: add notification preference system with per-type per-channel toggles and admin defaults
Implement configurable notification preferences across in-app and push channels, including a new `notification_preferences` table with soft-delete support, per-user toggle endpoints, admin defaults management, and canonical type definitions. The change introduces `NOTIFICATION_TYPES` and `NOTIFICATION_CHANNELS` constants, `NotificationPrefForm`/`NotificationDefaultForm` models, `notification_enabled` resolution logic, and UI integration via the profile notifications tab and admin panel.
2026-06-13 10:09:48 +00:00
retoor 1a26428952 fix: add DEVPLACE_DISABLE_RATE_LIMIT env var to bypass middleware in tests
Add a RATE_LIMIT_DISABLED flag read from DEVPLACE_DISABLE_RATE_LIMIT env var that short-circuits the rate_limit_middleware when set, allowing test suites to disable per-IP throttling globally in conftest while individual rate-limit tests re-enable it via monkeypatch.
2026-06-13 09:19:46 +00:00
retoor 5ffd3d14ee fix: pin single web worker and use set_setting upsert to prevent spurious 429s in rate-limit tests
Force DEVPLACE_WEB_WORKERS to 1 in test conftest so the per-worker rate-limit divisor is always 1, and replace raw table inserts with set_setting calls that upsert and bump the cache version, ensuring the test server picks up the high rate limit instead of inheriting a stale default that throttles dense request bursts.
2026-06-13 08:17:45 +00:00
retoor 207bbcd9ef test: add deleted_at filter to count assertions across 12 test files for soft-delete consistency 2026-06-13 07:40:08 +00:00
retoor 79900bfaf6 fix: rename bug card anchor to div with _card_link include and add admin role tests
The bug list template wraps each bug in a `<div class="bug-card card-link-host">` instead of a bare `<a>`, pulling in `_card_link.html` for proper link semantics. Two new integration tests (`test_bug_detail_renders_for_member` and `test_bug_detail_renders_for_admin`) verify that the `/bugs/{number}` endpoint returns 200 for both roles, that the "Close ticket" button is absent for members and present for admins, and that the JSON response exposes `viewer_is_admin` as a boolean. Supporting helpers `_role_user` and `_open_ticket` create users with a specific role and open a Gitea-backed ticket.
2026-06-12 20:50:27 +00:00
retoor f486778884 chore: rename is_admin to viewer_is_admin in bug detail template and schema 2026-06-12 20:29:02 +00:00
retoor 92784d8882 fix: add _tracker_unavailable helper and handle Gitea 404/503 in bug detail route 2026-06-12 20:19:26 +00:00
retoor ea715d7885 docs: update Gitea default repository name from pydevplace to devplacepy in config and docs 2026-06-12 20:06:58 +00:00
retoor 42f5fccd9b chore: remove trailing whitespace from blank lines in source files 2026-06-12 19:55:20 +00:00
retoor 7fb027968d feat: add cache-control headers for admin routes in security middleware
Add Cache-Control, Pragma, and Expires headers to responses for paths
starting with "/admin" to prevent caching of sensitive admin pages.
2026-06-12 19:42:32 +00:00
retoor 370f833d09 fix: reorder validation check and add saved fields to service config response
The validation error check was placed before the config save operation, causing early returns that skipped persisting valid fields. This moves the error check after saving valid values and adds a "saved" key to the response listing which fields were successfully stored. Also adds autocomplete and password manager attributes to the password input field in the service config form to prevent browser autofill interference.
2026-06-12 19:28:54 +00:00
retoor 9003cf6570 feat: replace local bug store with Gitea-backed issue tracker and add AI-enhanced filing 2026-06-12 18:31:40 +00:00
retoor 3ef1d02265 feat: add --changed fast mode to maintenance agents restricting scope to git-modified files under devplacepy/ and tests/
Implement a new `--changed` flag for the maintenance agent fleet that limits checking and fixing to only files git reports as modified or new (untracked) under `devplacepy/` and `tests/`. The change introduces `agents/changed.py` with `changed_paths()` parsing `git status --porcelain`, adds `_WRITE_ALLOWLIST` guard logic in `agents/agent.py` (`set_write_allowlist`, `clear_write_allowlist`, `_allowlist_guard`) wired into `_mutation_guard` and `create_file`, threads the file list through `orchestrator.run_fleet` -> `agent.run` -> `_execute` -> `task_prompt` with a dedicated "CHANGED-FILES RUN" prompt branch, and exposes `make maintenance` (read-only) and `make maintenance-fix` (fix mode) targets in the Makefile. Documentation is updated in `AGENTS.md`, `CLAUDE.md`, and `README.md`.
2026-06-12 06:15:19 +00:00
retoor 425e9bdca1 chore: remove pytest-xdist parallel test infrastructure and switch to serial execution 2026-06-12 05:43:33 +00:00
retoor 1e2f304935 fix: extend content delete authorization to allow administrators alongside owners across all endpoints 2026-06-11 22:40:27 +00:00
retoor 9a93debfc9 chore: document project-wide soft delete pattern and add deleted_by column to all tables 2026-06-11 20:36:47 +00:00
retoor d0e2075e6d feat: increase agent iteration limits and add stdin cleanup to maestro interactive loop 2026-06-12 05:19:26 +00:00
retoor acb3fb43ee fix: correct typo in user authentication error message for invalid credentials 2026-06-12 04:55:10 +00:00
retoor d1dde73877 docs: document agent isolation and result caching in maintenance docs
- Add explanation that each agent runs in isolation, preventing accidental cascading triggers
- Clarify that Maestro runs each agent once and caches results for follow-up questions
- Update style agent description to note context-aware application of project rules
- Wrap leaderboard test page/browser context in try/finally to ensure cleanup on failure
2026-06-12 04:37:12 +00:00
retoor 5e6b1c09df feat: add tool scoping and orchestration markers to agent tool registry
Introduce `mark_orchestration_tools`, `set_tool_scope`, and `reset_tool_scope` in `agents/agent.py` to allow runtime filtering of tool payloads by scope and orchestration flag. Refactor `get_tool_payloads` to respect the active scope and exclude orchestration-only tools. Update `agents/core/__init__.py` with `worker_tool_names` helper that returns read/reasoning tools plus conditional write/verify tools per mode, replacing the old `payloads_for` exclusion logic. Modify `agents/maestro.py` to call `mark_orchestration_tools` and wire per-agent result recording via `on_result` callback in `run_fleet`. Extend `agents/orchestrator.py` `run_fleet` signature to accept an optional `on_result` callable and invoke it after each agent run. Revise `agents/style.py` em-dash rule to distinguish prose from data occurrences, and add repository layout guidance to `agents/base.py` MAINT_HEADER.
2026-06-12 04:30:08 +00:00
retoor 31841fece4 chore: add agents/reports to gitignore and update agent infrastructure with timestamp streaming, write budget, and codename generation
- Add `agents/reports/` to `.gitignore` to prevent generated agent report files from being tracked
- Implement `_TimestampStream` class and `install_timestamps()` function in `agents/agent.py` for prefixing stdout/stderr with timestamps and elapsed time
- Export `install_timestamps`, `set_write_budget`, `clear_write_budget`, and `set_shell_restricted` from `agents/base.py`; add `_RUN_LOCK`, `AGENT_ICONS` dictionary, and `WRITE_BUDGET = 20` constant
- Add `report_codename()` function and `CODENAME_ADJECTIVES`/`CODENAME_ANIMALS` tuples to `agents/core/__init__.py` for generating random agent report codenames
- Expand `WRITE_TOOLS` tuple in `agents/core/__init__.py` to include `replace_lines`, `insert_lines`, and `delete_lines`; remove `SWARM_TOOLS` from `payloads_for` exclusion list
- Update `CLAUDE.md` and `AGENTS.md` documentation with dataset column initialization rules and new agent infrastructure details
- Reorder route table in `README.md` to list `/uploads` before `/messages` and document Swagger/ReDoc/OpenAPI schema endpoints
2026-06-12 03:37:12 +00:00
retoor 7fc9b0f715 chore: add retoor header to all devplacepy source files and update style agent header rule
The diff adds the mandatory `retoor <retoor@molodetz.nl>` header comment to every `.py` file under `devplacepy/` (including `__init__.py` and `routers/__init__.py`), and updates the `StyleAgent` in `agents/style.py` to instruct agents to only add the header on created or already-edited files rather than sweeping the entire repo. The `agents/base.py` operating protocol is also revised to reorder and clarify tool discipline rules.
2026-06-11 23:58:46 +00:00
retoor fd64a6f1a7 feat: increase default max iterations and add seed-finding fix pipeline to maintenance agents
- Bump DEFAULT_MAX_ITER from 40 to 60 in agents/base.py for longer agent runs
- Add seed_findings parameter to MaintenanceAgent.task_prompt() enabling targeted fix mode from prior check results
- Extend write_reports() with incomplete flag to track partial completion
- Introduce _LAST_CHECK cache in maestro.py to store check findings for subsequent fix runs
- Modify _dispatch() to pass seed findings to fix mode and include seeded_from_check in response
- Add incomplete field to orchestrator.py fleet results for consistency across agent outputs
2026-06-11 23:52:32 +00:00
retoor c38e9c8bfa feat: add autonomous maintenance agent fleet with shared engine and validator
Add the `agents/` directory containing a fleet of autonomous AI maintenance agents for codebase consistency, including a shared async engine (`agent.py`), a dependency-free validator (`validator.py`), and specialized agents for security, audit, docs, style, frontend, SEO, test coverage, and more. Wire the fleet into the Makefile with `--fix`/`--check` modes, document the architecture in `AGENTS.md`, `CLAUDE.md`, and `README.md`, and enforce a hard rule that the `agents/` directory itself is off-limits to any code modification to preserve detection data.
2026-06-11 23:35:31 +00:00
retoor 045c36bd38 fix: resolve merge conflict artifacts in docs_api and pagination templates by removing leftover conflict markers and aligning pagination_base usage 2026-06-11 20:36:04 +00:00
retoor 78d70d9b08 feat: add audit log tables, indexes, and CLI/content recording hooks 2026-06-11 20:28:17 +00:00
retoor 3862958fae feat: add soft delete and media tab for user attachments with admin restore 2026-06-11 18:52:56 +00:00
retoor c74228bc6c feat: make dp-upload label optional and hide label element when empty
The label attribute on the dp-upload component previously defaulted to "Attach files" and always displayed. This change makes the label optional by defaulting to an empty string, hiding the label element when no label is provided, and updating the documentation to reflect the new behavior. The feed template also removes the now-redundant explicit label attribute.
2026-06-11 13:04:01 +00:00
retoor 306fae4937 feat: add MessagesLayout class and replace inline scroll/focus script in messages template 2026-06-11 13:14:13 +00:00
retoor cad78d9313 fix: correct messages layout height units and remove autofocus scroll
- Replace `100vh` with `100dvh` in messages-layout height and min-height to properly account for mobile browser dynamic toolbar heights, adjusting offset from 2rem to 3.5rem for consistent spacing
- Remove `autofocus` attribute from message input field to prevent automatic keyboard popup on page load
- Remove `footer` block override that was incorrectly suppressing the site footer on messages page
- Change `input.focus()` to `input.focus({ preventScroll: true })` in the scroll-to-bottom script to avoid unwanted page jumps when focusing the input after sending a message
2026-06-11 13:03:16 +00:00
retoor f611185ac9 fix: reduce comment indentation multipliers for tighter nested display
The comment depth multiplier was reduced from 0.25rem to 0.0625rem for main layout, and from 0.1rem to 0.025rem for mobile breakpoints, with corresponding padding-left reductions in .comment-replies from 0.25rem to 0.0625rem and 0.1rem to 0.025rem respectively. This tightens the visual nesting of threaded comments to prevent excessive horizontal drift in deeply nested reply chains.
2026-06-11 12:25:24 +00:00
retoor 85cc812893 fix: reduce comment indentation multipliers for mobile and desktop layouts
Adjust margin-left and padding-left values in .comment and .comment-replies
selectors to use smaller multipliers (0.25rem, 0.1rem) instead of previous
larger values (1.5rem, 0.5rem, 0.25rem) for tighter nested comment display.
2026-06-11 12:14:23 +00:00
retoor 5488008216 feat: add /stop and /reset chat commands and bots internals docs section
Add two new chat commands (`/stop` and `/reset`) to the Devii WebSocket handler, enabling users to stop or reset a session via text input. Introduce a new "Bots internals" documentation section with six prose pages covering architecture, personas, content generation, engagement, realism, and configuration for the autonomous bot fleet. Extend the bot service with article scoring, category picking, configurable pause/break timing, and a `gist_min_lines` parameter for LLM client initialization.
2026-06-11 12:06:17 +00:00
retoor 3540bc8fa6 feat: add remote URL attachment support and project editing endpoint 2026-06-10 22:17:25 +00:00
retoor 9b425b33a5 feat: add h2 database dependency and configure in-memory datasource for dev profile 2026-06-10 07:21:05 +00:00
retoor 0dbe1def97 feat: switch ingress proxy to direct container IP routing and capture network metadata on launch
Refactor proxy target resolution to connect straight to the container's bridge IP and container port, bypassing the host port-publishing layer entirely. Introduce `container_ip`/`container_gateway` fields captured from Docker inspect on each running instance, stored alongside status updates. Update the fake backend to emit realistic `NetworkSettings` with per-container IPs. Remove the now-unused `CONTAINER_PROXY_HOST` config default and the old `ports_json`-based host port lookup in the proxy router.
2026-06-10 07:11:56 +00:00
retoor 5ae2f58aa0 feat: add port-in-use check and seed role overrides in test conftest, fix admin pagination assertion, and harden avatar fallback tests 2026-06-10 03:22:44 +00:00
retoor a0cb4ce7f2 feat: add CustomizationToggle class to handle enable/disable toggling via AJAX forms 2026-06-09 21:12:22 +00:00
retoor 49d4f50f32 feat: enable parallel pytest-xdist test execution with isolated per-worker databases and data directories 2026-06-09 21:11:37 +00:00
retoor a3f9b949ca feat: add per-user customization suppression toggles and API endpoints for profile 2026-06-09 20:52:51 +00:00
retoor c2c5166720 fix: remove project_set_private from confirm list and fix async test helpers for event loop safety 2026-06-09 19:16:47 +00:00
retoor 19795c6a0a refactor: remove unused imports and reorganize module-level constants across multiple routers 2026-06-09 18:02:50 +00:00
retoor d95541f3c1 feat: add click-to-open profile dropdown with z-index fix and mobile JS handler
Add JavaScript click handler for profile dropdown toggle in MobileNav, replace anchor with button in base template, add explicit profile link to dropdown menu, and apply z-index to nav-badge for proper stacking.
2026-06-09 17:38:44 +00:00
retoor c89dbaf41e style: add responsive CSS tweaks for very narrow screens, mobile fullscreen windows, and safe-area toast positioning 2026-06-09 17:26:34 +00:00
retoor 671c42316b fix: replace hardcoded pixel values with CSS custom properties and rem units across multiple stylesheets 2026-06-09 17:03:16 +00:00
retoor c4f2937415 fix: normalize unicode escape sequences and reformat multi-line expressions across codebase 2026-06-09 16:48:08 +00:00
retoor 66dfda88bc feat: replace raw setInterval polling with shared Poller utility across six frontend modules 2026-06-09 16:37:49 +00:00
retoor 1ec011ecb2 chore: consolidate per-extension upload ignores into single directory rule in .gitignore
Replace five separate file-extension patterns for devplacepy/static/uploads/ with a single directory-level ignore, and add a clarifying comment that uploaded/downloaded files must never be tracked in git.
2026-06-09 14:11:13 +00:00
retoor 05c6fa7f3b feat: add project fork async job service with cli prune/clear commands and shared container image build target 2026-06-09 14:06:02 +00:00
retoor c565e3b55c feat: add container manager CLI commands and docker-compose overlay for admin container lifecycle 2026-06-09 04:41:27 +00:00
retoor 317126efc2 feat: add zip file extraction support with error handling for invalid archives 2026-06-08 23:32:57 +00:00
retoor 547e4eda8c docs: add CLAUDE.md with project guidelines and conventions, document new devii admin quota reset endpoints and CLI commands, update README with coverage CI and devii_admin_daily_usd config, add European date normalization to ProjectForm model 2026-06-08 22:30:25 +00:00
retoor 841c1c7417 docs: add mistune dependency to pyproject.toml for Markdown parsing support 2026-06-08 20:56:59 +00:00
retoor 97eb58fc19 feat: add project file system with CRUD, upload, inline editing, and video attachment support
- Add new `/projects/{slug}/files` endpoint group for per-project filesystem operations including directory and file CRUD, upload, and inline editing with public read and owner write access
- Extend attachment system to support video formats (webm, ogv, mov, m4v) with proper file icons and MIME types
- Implement configurable allowed file types via `allowed_file_types` site setting, replacing hardcoded `ALLOWED_UPLOAD_TYPES` with dynamic `allowed_extensions()` and `is_extension_allowed()` functions
- Add `delete_all_project_files()` call in `delete_content_item()` to clean up project files when a project is deleted
- Create database indexes on `project_files` table for `(project_uid, path)` and `(project_uid, parent_path)` to optimize file lookups
- Introduce `docs_prose.py` module with `render_prose()` function that renders Markdown content inside `data-render` divs using mistune, enabling dynamic prose rendering in documentation pages
- Enhance docs search with Markdown-aware text stripping (`_demarkdown()`) and improved HTML/script/style sanitization for better search indexing
- Update documentation API samples to reflect new attachment response fields (`is_image`, `is_video`, `mime_type`) and note video format support
- Update README to document the new project files endpoint and clarify AI gateway attribution for guest Devii sessions
2026-06-08 20:51:09 +00:00
retoor e0535bb7c5 feat: add api key auth, devii agent, openai gateway, and admin service management
This commit introduces a comprehensive set of new features including API key authentication with CLI management commands (get, reset, backfill), a Devii agentic assistant with WebSocket terminal and session bootstrap, an OpenAI-compatible LLM gateway service, and an admin service management panel. It also adds Playwright browser automation for bot support, configures internal gateway URLs, refactors content editing/deletion to support JSON API responses, and updates documentation across AGENTS.md, README.md, and the developer docs site.
2026-06-08 15:38:33 +00:00
retoor 921e382cbc feat: add reactions, bookmarks, polls modules with session remember config
Add three new feature modules (reactions, bookmarks, polls) with corresponding database tables, indexes, and router registrations. Introduce `SESSION_MAX_AGE_REMEMBER` config for extended session duration, add `get_unread_messages` template global, and include operational defaults for rate limiting and session settings in `site_settings`.
2026-06-06 14:31:42 +00:00
retoor b4e09f4b37 chore: downgrade upload-artifact action from v4 to v3 in CI workflow 2026-06-05 19:51:36 +00:00
retoor 04dc26d850 chore: add .coveragerc config and sitecustomize.py for coverage subprocess support 2026-06-05 18:35:02 +00:00
retoor f4abd2ff3c feat: add comprehensive test suite for cache, cli, content, db helpers, follow api, and news service 2026-06-05 18:34:03 +00:00
retoor 1eeb789e9c fix: add coverage configuration and test infrastructure for push and utils modules
Add coverage tooling to CI workflow, Makefile, and pyproject.toml dependencies.
Introduce new test suites for push notification helpers (base64 encoding, HKDF,
authorization JWT) and utility functions (safe_next, strip_html, mention extraction,
badge/xp awarding, milestone checks) with a session-scoped local_db fixture.
2026-06-05 18:33:35 +00:00
retoor f05b6a4faf feat: add canonical redirect, og_image, next_page_url, and sitemap caching across content routers
Implement canonical_redirect helper in content.py to enforce slug-based 301 redirects for gist, news, post, and project detail pages. Add first_image_url helper to extract primary image from item or attachments for Open Graph meta tags. Inject next_page_url into feed, gists, news, and projects list page SEO contexts for pagination link rel. Extend seo.py with SITEMAP_URL_LIMIT, SITEMAP_TTL constants and _sitemap cache variable for future sitemap generation optimization. Update profile page to raise 404 via not_found instead of 302 redirect, and include og_image from avatar_url.
2026-06-05 18:05:07 +00:00
retoor 9a24a90ec5 fix: iterate over all post UIDs in seed comment creation and post retrieval loops 2026-06-05 17:32:46 +00:00
retoor 8cb08c84cc fix: scope reply form locators and add login next redirect tests
- Fix test_bug_comment_reply and test_project_comment_reply to scope fill/click to .comment-reply-form instead of using generic textarea/button selectors
- Add test_login_next_redirects_to_target verifying ?next=/gists redirects after login
- Add test_login_next_rejects_external ensuring external ?next= URL falls back to /feed
- Add test_comment_reply_inline_form, test_comment_reply_toggle_and_cancel, test_comment_create_scrolls_to_anchor for post comment reply UX
- Add _seed_post_with_comments and _create_post_ui helpers in test_feed.py
- Fix test_news_comment URL assertion to use wildcard pattern for slug matching
2026-06-05 17:22:29 +00:00
retoor 66d91407f5 feat: add next parameter to login flow and redirect unauthenticated users to login page
- Add `next` field to LoginForm model for preserving post-login redirect target
- Implement `safe_next` utility to validate redirect URLs and prevent open redirect vulnerabilities
- Update login page handler to accept and pass `next` query parameter
- Add hidden `next` input to login form template for POST submission
- Modify `require_user` to redirect to `/auth/login` instead of root
- Add `Http.toLogin()` static method in JS for client-side redirect with current URL encoded
- Update CommentManager to redirect unauthenticated reply attempts to login
- Fix comment creation redirect to use `comment_url` instead of generic `redirect_url`
2026-06-05 17:02:30 +00:00
retoor 4ad9334be6 feat: add user_id B-tree index to profiles table for faster user lookup queries 2026-06-05 16:43:12 +00:00
retoor 5a263cfebe feat: add inline recent comments and reply forms to post cards on feed page
Extract comment item building into `_build_comment_items` helper in database.py, import `get_recent_comments_by_post_uids` in feed router to attach up to 3 recent comments per post, add `post-card-comments` CSS class and `.comment-reply-form` margin rule, refactor `CommentManager` to use event delegation and toggle reply forms via a hidden template, move comment rendering into a reusable `_comment.html` macro, and include recent comments in `_post_card.html` with inline reply capability.
2026-06-05 16:42:43 +00:00
retoor 7d4612b2eb style: add touch-friendly min-heights, responsive comment form, and mobile layout refinements across CSS 2026-06-05 16:18:11 +00:00
retoor 790f6c8a67 fix: add port cleanup and server health checks to locust make targets and seed script
Add `fuser -k` to kill stale processes on the locust port before starting the uvicorn server, and improve the server readiness loop to detect startup failures early. In the locustfile seed function, cap user creation attempts at 25 and log a clear error if fewer than 5 seed users are created, preventing silent hangs or partial test data.
2026-06-05 15:44:12 +00:00
retoor ffcd6d2863 fix: replace uuid4 with uuid7 via uuid_utils in push and utils modules 2026-06-05 08:14:40 +00:00
retoor 9f4bead896 feat: add generic paginate helper and cursor-based load-more across feed, gists, news, and projects
Extract shared PAGE_SIZE constant and paginate() function into database.py, replacing inline cursor logic in feed, gists, news, and projects routers. Introduce `_load_more.html` partial template to unify "Load More" button rendering. Update all affected route handlers to accept `before` query parameter and return `next_cursor` for seamless infinite scroll. Adjust projects count display to use filtered length instead of total. Add test helper `_seed_posts` for pagination coverage.
2026-06-05 03:36:18 +00:00
retoor 02b07dce8e feat: add thumbnail_name field to attachment storage and refactor link/delete to batch SQL queries 2026-06-05 02:43:06 +00:00
retoor 13870d3219 feat: add service lock file and multi-worker startup guard with session cache clear 2026-06-02 21:17:51 +00:00
retoor a136287d36 feat: add leaderboard router, gamification backfill, and shared content creation helpers
Introduce a new `/leaderboard` endpoint ranking top 50 members by total stars, wire it into the app router and documentation. Implement `_backfill_gamification()` in `database.py` to compute XP/levels for existing accounts from prior posts, comments, votes, and follows. Extract `is_owner()`, `create_content_item()`, and `detail_context()` into `content.py` to centralize content creation, reward awarding, mention notifications, and attachment linking. Update comment creation/deletion in `comments.py` to use `award_rewards()` with `XP_COMMENT` and the new `is_owner()` helper. Add shared template partials documentation for vote bars, star buttons, post headers, and topic selectors to `AGENTS.md`.
2026-05-30 18:16:39 +00:00
retoor ab4861562b fix: change push.register return type to tuple and only send welcome notification on new registration 2026-05-28 22:49:37 +00:00
retoor 4cdf49cf8f chore: remove deprecated demo make target and update attachment thumbnail resolution
- Remove `make demo` target from Makefile, AGENTS.md, and README.md
- Improve `_row_to_attachment` to glob for thumbnail files with any extension instead of hardcoding `.jpg`
- Rewrite `cmd_attachments_prune` to use time-based cutoff and `delete_attachment` helper instead of orphan detection
- Add cursor-based pagination to feed and notifications endpoints with `before` parameter
- Track `did_upvote` flag in vote handler to only notify on new upvotes, not vote changes
- Add `PAGE_SIZE` constant and `next_cursor` template variable to notifications page
- Implement Playwright tests for notification pagination with 30 seeded notifications
2026-05-28 22:45:07 +00:00
retoor a8466da5b2 feat: replace JS card-link data-href with CSS overlay and add DOMPurify sanitizer 2026-05-27 20:03:12 +00:00
retoor f0c4feb167 feat: add DOMPurify XSS sanitization pipeline to client-side markdown renderer
- Vendored DOMPurify at static/vendor/purify.min.js, loaded with defer in base.html
- ContentRenderer.js now sanitizes marked output via DOMPurify.sanitize before processMedia
- Fail-closed: render() throws if DOMPurify is undefined instead of emitting unsanitized HTML
- Added _json_ld_dumps helper in seo.py to escape <>&\u2028\u2029 in JSON-LD output
- Updated combine() to use the new safe dumper for all schema.org payloads
2026-05-23 07:10:31 +00:00