Update replit.md to document new stress test scripts and reorganize test descriptions.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: dfcb132d-cfe2-469f-8659-b15111592030
Replit-Helium-Checkpoint-Created: true
Updates package.json to include `test:stress` scripts and adds an optional `stress-tests` job to the GitHub Actions CI workflow for concurrent write tests.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: fde695de-720c-4bfb-b5f1-ea6710172a09
Replit-Helium-Checkpoint-Created: true
Update tests in `tests/reports.test.js` to assert the presence of specific fill colors for chart elements rather than exact positional coordinates, improving test robustness against minor rendering variations.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 293138b2-b045-4ead-a559-d330e00bdd95
Replit-Helium-Checkpoint-Created: true
Fix logic in delay list initialization to correctly handle zero-value settings for authorization failure delays, and update test configurations to leverage this fix.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 605cec52-e52a-4520-8af0-466d9c971344
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: ee25d747-8c3a-444e-8dbf-e0229eee7d31
Replit-Helium-Checkpoint-Created: true
Adds new npm scripts for unit and integration tests with CI-specific environment configurations, updates the GitHub Actions workflow to use these scripts, and documents the new test organization and environment file usage in replit.md.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 21cb119b-47e0-4582-a80d-cddb4a3bfea7
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: b072dbe3-29e5-41cf-86a1-00bea798d0e3
Replit-Helium-Checkpoint-Created: true
Refactors test scripts in package.json to separate unit and integration tests, updates CI environment variables for MongoDB, and modifies GitHub Actions workflow to run unit and integration tests in parallel and serially, respectively, optimizing test execution and resource utilization.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 21cb119b-47e0-4582-a80d-cddb4a3bfea7
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 8ffc8696-fdef-4ddf-960a-54d03ad00107
Replit-Helium-Checkpoint-Created: true
Updated test execution scripts in package.json to include parallel and fast test options. Converted several `beforeEach` hooks to `before` in test files for more efficient application setup. Added documentation for test optimizations.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 271f3cac-bab1-4e81-9982-f31b3b030aab
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: ac6eb857-be5a-454b-96cf-b9c4c57f058b
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ea4278b-5c6c-4065-9cb8-f1013771318d/271f3cac-bab1-4e81-9982-f31b3b030aab/69H2O1r
Replit-Helium-Checkpoint-Created: true
Update implementation plan and test cases to reflect that `ok` and `n` fields are optional in the response, aligning with Loop client behavior and clarifying middleware's legacy status.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: e27dc73c-5668-4ca3-89c0-23127c7a1ac7
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: b6ab13d1-cae7-4d9d-9b92-bf3b582272ad
Replit-Helium-Checkpoint-Created: true
Update env.js to correctly parse PREDICTIONS_MAX_SIZE, allowing a value of 0 to disable truncation. Modify tests and documentation to reflect this change.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 81a6141f-c27c-4178-8cf3-6474e7b82918
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 92d3ef13-9728-43c6-8e8b-d435184fec07
Replit-Helium-Checkpoint-Created: true
Add a new test file `tests/flakiness-control.test.js` that allows configuring flakiness percentage via an environment variable `FLAKINESS_LEVEL`, supporting seeded randomness, logging, and timeout configurations for reproducible testing and validation of flakiness detection tools.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9d8f1c8c-dc6e-4e36-8757-3a13be266d60
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: c03b84ea-7ae9-4081-b484-6f10b690796e
Replit-Helium-Checkpoint-Created: true
Update test environment to use MONGO_POOL_SIZE=2 in my.test.env. This is the minimum pool size that handles concurrent operations without timeouts, improving test determinism. Production default remains 5.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cf276ff5-4001-4b44-93fe-7c9786ee4327
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: ccad3408-03dd-4bf8-9acb-b1d67ab9adcc
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ea4278b-5c6c-4065-9cb8-f1013771318d/cf276ff5-4001-4b44-93fe-7c9786ee4327/MVHBPJ5
Replit-Helium-Checkpoint-Created: true
Add details about a floating-point precision fix for boluswizardpreview.test.js and note an infrastructure issue with test process hangs during server teardown in replit.md.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cf276ff5-4001-4b44-93fe-7c9786ee4327
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 0e1264f9-9ae7-4b11-a0e7-658fe3d1f1ac
Replit-Helium-Checkpoint-Created: true
Update rounding logic in `lib/sandbox.js` to incorporate an epsilon value for enhanced precision, addressing potential floating-point errors in insulin calculations.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: cf276ff5-4001-4b44-93fe-7c9786ee4327
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: f10d2278-3392-4fd0-ad73-36beee7aadb9
Replit-Helium-Checkpoint-Created: true
Refactor tests/api.shape-handling.test.js to use `before()` for server boot instead of `beforeEach()`, reducing boot overhead and improving test stability. Update docs/test-specs/flaky-tests.md and replit.md to reflect the fix and progress tracker.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: dd54303b-52a7-4c5b-9110-6cd8643ee3bb
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: fa6ecd04-4886-43f8-b6ed-5ca9e21eb746
Replit-Helium-Checkpoint-Created: true
Update docs/test-specs/flaky-tests.md and replit.md to accurately reflect the results of recent stress tests, noting that all completed runs passed and identifying a single slow test file that requires a longer timeout.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 400e0b24-3794-40cb-83de-0cc142f986c0
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: bfab6092-be80-4119-abc6-2df7a36dde30
Replit-Helium-Checkpoint-Created: true
Update `docs/test-specs/flaky-tests.md` and `replit.md` to reflect that previously identified flaky tests are now stable, including details on the fix for `api.deduplication.test.js`.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 400e0b24-3794-40cb-83de-0cc142f986c0
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 276f2ddc-a331-49cf-9da3-c3c6c3035794
Replit-Helium-Checkpoint-Created: true
Increase test timeout to 30 seconds and optimize database cleanup by using deleteMany for entries and adding devicestatus cleanup in `api.deduplication.test.js`.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 400e0b24-3794-40cb-83de-0cc142f986c0
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 48378c97-a2ef-4f9f-8070-728091da5f11
Replit-Helium-Checkpoint-Created: true
Introduce logic to truncate prediction arrays (IOB, COB, UAM, ZT) in devicestatus documents when they exceed a configured maximum size, preventing potential issues with large document handling in MongoDB. This includes updates to bootevent, devicestatus module, environment configuration, and new tests to verify truncation behavior.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: daa945f9-0872-4250-9868-a1245067293b
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: baff25d9-e915-44d9-87f0-f7583f443a30
Replit-Helium-Checkpoint-Created: true
Update the replit.md file to document observed test failures, including test file names, test names, and notes on potential causes, and to clarify the distinction between observed and consistent failures.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 0af6cbd9-213b-4067-92c7-061364010187
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: ad1d0f93-886b-404d-b868-e8a34324f278
Replit-Helium-Checkpoint-Created: true
Add new sections to replit.md detailing known test issues, slow tests, and available test helpers, along with commands for isolation and timing-aware testing.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 0af6cbd9-213b-4067-92c7-061364010187
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: e31b94b0-d6a9-46b6-b500-c1d9ff5f43ae
Replit-Helium-Checkpoint-Created: true
Refactors WebSocket tests in `tests/websocket.shape-handling.test.js` to replace arbitrary `setTimeout` delays with a `waitForConditionWithWarning` helper. This helper polls for conditions, logs warnings for slow operations, and includes a hard timeout to prevent test hangs. The documentation in `docs/test-specs/flaky-tests.md` is updated to explain this new pattern.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: dd62849e-ed2a-4205-bffd-e69e5468d135
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 69062e84-cc51-4fa6-8684-754e19948222
Replit-Helium-Checkpoint-Created: true
Updates flaky test documentation with observed flakiness rates and corrects npm script syntax for isolating tests. Introduces a generic isolate runner and clarifies harness behavior regarding database state, removing the claim of automatic resets and noting reliance on Mocha hooks for cleanup.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 3be0ef95-aa69-441e-a33e-a8bd64e908de
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: b7dbc77f-8b96-4ac3-8453-8976ddb7ee24
Replit-Helium-Checkpoint-Created: true
Add a flaky test detection system that repeatedly runs tests, captures results, and generates reports to identify inconsistent test behavior.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9bea85b0-6b8f-4d55-b964-1080f91ee9a0
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 9dc019dc-2bb9-416a-80ad-527c2c506698
Replit-Helium-Checkpoint-Created: true
Introduces a new script `scripts/flaky-test-runner.js` to execute Mocha tests multiple times, capturing JSON output to identify and analyze flaky test behavior. New npm scripts (`test:flaky`, `test:flaky:quick`, `test:flaky:thorough`) are added to package.json for easy execution. The script includes robust JSON parsing with error handling for potentially malformed output.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9bea85b0-6b8f-4d55-b964-1080f91ee9a0
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: ffee9763-d3c3-40a4-a414-ca0b03d54310
Replit-Helium-Checkpoint-Created: true
Update metadata headers across various Markdown documentation files, including proposals and data schemas, to ensure consistent formatting and version information.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a0a576b2-b0c8-4957-a050-9455d8333c63
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 1f77cc9d-a44f-4ea4-b13b-fb1b8af6fac5
Replit-Helium-Checkpoint-Created: true
Adjusted internal documentation links and updated references within various Markdown files to reflect a new directory structure for audit and meta documents.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 4dee684a-a4b9-4c32-a818-3a27dae1b027
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 971b8c75-c322-4ede-98ea-eb5ae31d4e5c
Replit-Helium-Checkpoint-Created: true
Consolidate and update documentation references across various markdown files, renaming specifications and test files for clarity.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 4dee684a-a4b9-4c32-a818-3a27dae1b027
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 7cf50ce8-84d4-46a0-b9e6-9bbc663da8b8
Replit-Helium-Checkpoint-Created: true
Improve assertions in `tests/api3.aaps-patterns.test.js` and update documentation in `replit.md` to reflect stricter checks for srvModified timestamps and exact data matching in deduplication tests.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 67c42e43-1630-438c-8341-81ea0fdac4c8
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: bad34835-bb02-4e4b-974b-a862572ac51b
Replit-Helium-Checkpoint-Created: true
Introduce new test suite `tests/api3.aaps-patterns.test.js` and update `tests/concurrent-writes.test.js` to simulate AAPS sync catch-up with rapid sequential SMB and SGV POST requests, ensuring correct deduplication and data persistence for various AndroidAPS usage patterns.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2501b04e-77c8-4f06-a13c-75c232bafd47
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 804cc747-c899-430f-9181-96a22d4301a1
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ea4278b-5c6c-4065-9cb8-f1013771318d/2501b04e-77c8-4f06-a13c-75c232bafd47/Bc7Z6xs
Replit-Helium-Checkpoint-Created: true
Update webpack.config.js to include 'buffer' and 'vm' in resolve.fallback and correctly configure ProvidePlugin for Buffer, resolving the "Buffer is not defined" error and a related 'vm' warning.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2501b04e-77c8-4f06-a13c-75c232bafd47
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 970a879c-45e0-48b9-bed1-d9e23d410f4a
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ea4278b-5c6c-4065-9cb8-f1013771318d/2501b04e-77c8-4f06-a13c-75c232bafd47/rAsiAu1
Replit-Helium-Checkpoint-Created: true
Add a new OIDC Actor Identity proposal document and update architecture overview, authorization security spec, and replit.md to reference and prioritize OIDC integration.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 71600fc9-5175-4929-b903-5174a32258d2
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 4ccfdfed-74a5-4a42-97f1-13cf3f8352fe
Replit-Helium-Checkpoint-Created: true
Create a new proposal document detailing the integration of OpenID Connect and OAuth 2.0 for verified actor identities.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 71600fc9-5175-4929-b903-5174a32258d2
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 33e79977-76a3-48a2-b0cd-aa045b8c86f0
Replit-Helium-Checkpoint-Created: true
Removes the 15-second debounce from `lib/server/bootevent.js`, allowing `data-received` and `tick` events to trigger immediate data updates by calling `ctx.dataloader.update()` directly.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: ef8efcf8-f9e9-49f9-9441-59adbee38ad3
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 67966157-9e23-4065-b9a1-0ca67482bafc
Replit-Helium-Checkpoint-Created: true
Update replit.md to include new schema documentation for treatments and profiles, detailing field inventories, event types, timestamp semantics, client compatibility notes, and known bugs.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f35580f1-0466-46a6-b245-5665d8e1c559
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 06320ff8-cffb-4a84-b19c-9263c5d08aa4
Replit-Helium-Checkpoint-Created: true
Create new documentation files for the `treatments` and `profiles` schemas, detailing their structure, fields, and observed variations across different controller applications.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f35580f1-0466-46a6-b245-5665d8e1c559
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 94c8fcd7-5002-4547-98e7-481a72a86ca0
Replit-Helium-Checkpoint-Created: true
Create a Markdown file detailing the fields, types, and constraints for the `treatments` collection, including glucose, nutrition, insulin, basal, temporary target, and profile switch data.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f35580f1-0466-46a6-b245-5665d8e1c559
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 5b10d686-67df-4c29-8eb6-638e9534fa18
Replit-Helium-Checkpoint-Created: true
Create `docs/DOCUMENTATION-PROGRESS.md` to track requirements and test specification efforts, including progress, priorities, lessons learned, and guidance for collaborators. Update `replit.md` to reference this new progress tracker.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 055897c4-83a5-4136-93d8-ff61ec1a77a8
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 5af50b7b-7741-43cb-9f57-56a3635f46b7
Replit-Helium-Checkpoint-Created: true
Introduces `authorization-security-spec.md` and `authorization-test-spec.md` to document API authentication requirements (API_SECRET, JWT, Shiro permissions, brute-force protection) and their corresponding test cases, including identification of coverage gaps.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 055897c4-83a5-4136-93d8-ff61ec1a77a8
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: 48221946-c783-44b0-a3b8-0be79161ef82
Replit-Helium-Checkpoint-Created: true