Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
061ec97
feat: deprecate IMemoryWithRedis and add ReturnDefaultOnFirstLoad option
poxet Mar 27, 2026
67a3440
feat: eplicta-cache-requests complete
poxet Mar 27, 2026
1fadf76
add settings
poxet Mar 27, 2026
f463046
Merge branch 'feature/eplicta-cache-requests' into develop
poxet Mar 30, 2026
713d015
add request
poxet Mar 30, 2026
6c7da14
update instructions
poxet Apr 1, 2026
4246907
update instructions
poxet Apr 3, 2026
b262cdd
fix: make AddCache idempotent for multiple calls
poxet Apr 5, 2026
d97cae9
feat: idempotent-addcache complete
poxet Apr 6, 2026
e89f13b
Merge branch 'feature/idempotent-addcache' into develop
poxet Apr 6, 2026
b16566d
fix: subscribe MongoDB to RequestEvictEvent for ClearCache/ClearStale
poxet Apr 6, 2026
f8f5246
feat: mongodb-clear-cache complete
poxet Apr 6, 2026
965a022
Merge branch 'feature/mongodb-clear-cache' into develop
poxet Apr 6, 2026
651e319
fix: set default ConfigurationName to "Default" in MongoDBCacheOptions
poxet Apr 6, 2026
8253302
feat: mongodb-default-config complete
poxet Apr 6, 2026
4b748f9
Merge branch 'feature/mongodb-default-config' into develop
poxet Apr 6, 2026
e7b8b59
fix: track persisted cache items in monitor on first access
poxet Apr 6, 2026
8bd844f
feat: monitor-track-persisted complete
poxet Apr 6, 2026
e8c556a
Merge branch 'feature/monitor-track-persisted' into develop
poxet Apr 6, 2026
ff5df86
feat: track and display fetch load duration
poxet Apr 6, 2026
f4829e6
fix: persist LoadDuration in MongoDB CacheEntity
poxet Apr 6, 2026
6cab08e
feat: cache-load-time complete
poxet Apr 6, 2026
55f5079
Merge branch 'feature/cache-load-time' into develop
poxet Apr 6, 2026
0e147ed
feat: add GitHub Actions CI/CD workflow
poxet Apr 6, 2026
f53f6c2
feat: github-actions complete
poxet Apr 6, 2026
d60ea49
Merge branch 'feature/github-actions' into develop
poxet Apr 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 36 additions & 42 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
- If uncommitted changes exist, alert me immediately and stop
- Do not proceed until I have confirmed how to handle them (commit, stash, or discard)
2. Check if `.claude/mission.md` exists and read the project mission and context.
3. Check if `.claude/plan.md` exists.
If it does, read it and summarize what has been done and what the next step is.
If it does not exist, ask me how I would like to proceed.
4. Check if `.claude/feature.md` exists and read the current feature scope.
3. Check if `plan/` exists in the project root.
- If `plan/plan.md` exists, summarize what has been done and what the next step is.
- If `plan/feature.md` exists, read the current feature scope.
- If neither exists, ask me how I would like to proceed.

### During a session
After completing each step in the plan:
- Mark it as `[x]` done in `.claude/plan.md`
- Mark it as `[x]` done in `plan/plan.md`
- Add a brief note about what was done and any important decisions made
- Mark the next step as `[~]` in progress

### Ending a session
- Update `.claude/plan.md` with the current status of all steps
- Update `plan/plan.md` with the current status of all steps
- Add a "Last session" note summarizing what was completed and what comes next
- Note any README.md changes that will be needed when the feature is complete

Expand Down Expand Up @@ -62,24 +62,34 @@ dotnet test -c Release
- Commit at logical milestones (e.g. a component is complete and tested)
- Never commit failing tests
- Use conventional commits: `feat:`, `fix:`, `test:`, `docs:`
- Never merge to main — leave that for me to review and merge
- Never merge to master/main — leave that for me to review and merge
- Default branch strategy: `master` is production, `develop` is integration. Feature branches branch from and merge to `develop`.
- When merging a completed feature back to the originating branch, use `--no-ff` (no fast-forward) to preserve the feature branch history as a merge commit

## Feature Workflow

Active feature tracking lives in `plan/` in the project root (committed with the feature branch).
Planned and completed features are stored externally in the **Plan directory** defined in `.claude/mission.md`.

### Planning features
- Multiple features can be planned ahead in `.claude/features-planned/`
- Each file represents one feature and they are executed in order (e.g. `01-feature-name.md`, `02-feature-name.md`)
- When starting a new feature, check `features-planned/` first for the next planned feature
- Future features are stored in the Plan directory under `planned/`
- Each file represents one feature, executed in order (e.g. `01-feature-name.md`, `02-feature-name.md`)
- When starting a new feature, check the Obsidian `planned/` directory first

### Starting a feature
When told to start a new feature:
1. Ask for the feature name and goal if not provided
2. Note the current branch as the originating branch for the feature
3. Create a new branch: `git checkout -b feature/<feature-name>`
4. Create `.claude/feature.md` with goal, scope, acceptance criteria, and done condition
5. Create or update `.claude/plan.md` with the steps to implement the feature
4. Create `plan/feature.md` with goal, scope, acceptance criteria, and done condition
5. Create `plan/plan.md` with the steps to implement the feature
6. Confirm the plan before starting any code changes

### During implementation
- Update `plan/plan.md` continuously as changes are made
- Commit `plan/` together with code changes at logical milestones
- Run tests before each commit

### Completing implementation
When all planned steps are done:
- All tests pass
Expand All @@ -88,44 +98,28 @@ When all planned steps are done:
- Do NOT close the feature — wait for the user to confirm it is done

### Closing a feature (only when the user says it is done)
- All acceptance criteria in `.claude/feature.md` are met
- All acceptance criteria in `plan/feature.md` are met
- All tests pass
- README.md has been updated to reflect the new feature
- `.claude/feature.md` is archived to `.claude/features-done/<feature-name>.md` and both `.claude/feature.md` and `.claude/plan.md` should be deleted
- Remove the corresponding file from `.claude/features-planned/` if one exists
- Archive `plan/feature.md` to the Plan directory `done/<feature-name>.md`
- Delete the `plan/` directory from the project
- A final commit is made with message: `feat: <feature-name> complete`
- Merge to originating branch and delete feature branch only when the user explicitly asks
- Merge to originating branch with `--no-ff` and delete feature branch only when the user explicitly asks

## Feature Requests (cross-project)

Projects can request features from each other via `.claude/requests.md`.
Cross-project requests are handled via `mission.md` — see the "Incoming requests" reference there for the central location.

- Read `~/.claude/projects.md` (or `$OBSIDIAN_VAULT/Tharga/projects.md`) to discover other projects
- Read `.claude/requests.md` on startup — show pending requests and new notifications to the user
- Writing feature requests to other projects is **exempt from the cross-project guard**
- For mono-repos: requests go to the root, not sub-projects (see projects.md for details)
- On startup, check `mission.md` for the requests location and show pending requests to the user
- Writing feature requests is **exempt from the cross-project guard**
- Never mark a request as done without user confirmation
- When a request is completed: update status to Done and write a notification back to the requester's `.claude/requests.md`

### Request format
```markdown
## Pending

### <short description>
- **From:** <project name> (`<project path>`)
- **Date:** <YYYY-MM-DD>
- **Priority:** <High/Medium/Low>
- **Description:** <what is needed and why>
- **Status:** Pending

## Notifications

### <short description> — DONE
- **From:** <project name> (`<project path>`)
- **Completed:** <YYYY-MM-DD>
- **Summary:** <what was done>
- **Branch/Version:** <branch or version>
```
- When a request is completed:
1. Update its status to Done in the central requests file, add completion date and summary
2. Add a follow-up entry under `## Uppföljning` at the top of the central requests file so the consuming project knows to update:
```
- [ ] <Consuming project> ska uppdatera <package> till <version> — <kort beskrivning av vad som är nytt>
```
3. The follow-up is checked off when the consuming project has updated and verified the new version

## Backlog Hygiene
- When a task from the backlog (in `mission.md` or linked external files) is completed, mark it as done or remove it
Expand Down
26 changes: 26 additions & 0 deletions .claude/features-done/cache-load-time.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Feature: cache-load-time

## Goal
Track how long the fetch delegate takes and display it in the Blazor monitoring UI.

## Scope
- `CacheItem` — add `LoadDuration` field
- `CacheItemBuilder` — accept and store `LoadDuration`
- `FetchQueue` — measure fetch time with `Stopwatch`
- `CacheItemInfo` — add `LoadDuration` property, remove TODO comment
- `CacheMonitor.Set/Track` — pass `LoadDuration` to `CacheItemInfo`
- `IManagedCacheMonitor` — update `Set`/`Track` signatures
- `CacheBase` — pass `LoadDuration` through `OnSetAsync` and `TrackIfNeeded`
- `ListView.razor` — add "Load Time" column

## Acceptance Criteria
- `CacheItemInfo.LoadDuration` reflects the actual fetch delegate execution time
- Blazor ListView shows load duration for each cached item
- Items loaded from persistence (Track path) show null load duration
- All existing tests still pass

## Done Condition
User confirms the feature is satisfactory.

## Originating Branch
develop
20 changes: 20 additions & 0 deletions .claude/features-done/github-actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Feature: github-actions

## Goal
Add GitHub Actions CI/CD workflow matching the Platform pattern, with a unified publish job that picks release vs prerelease environment based on branch.

## Scope
- `.github/workflows/build.yml` — build, security, publish jobs

## Acceptance Criteria
- Build job: restore, build, warning check (threshold 10), test with coverage, codecov, compute version, pack 5 NuGet packages
- Security job: CodeQL analysis
- Publish job: single job with dynamic environment (release on master push, prerelease on PR), push to NuGet, create GitHub release
- Version: `MAJOR_MINOR: '0.4'`, auto-incrementing patch from git tags
- .NET SDKs: 8.0, 9.0, 10.0

## Done Condition
User confirms the workflow is satisfactory.

## Originating Branch
develop
22 changes: 22 additions & 0 deletions .claude/features-done/idempotent-addcache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Feature: idempotent-addcache

## Goal
Make `AddCache()` safe to call multiple times, merging type registrations instead of throwing.

## Scope
- `CacheRegistrationExtensions.AddCache` — guard against duplicate DI registrations
- `CacheRegistrationExtensions.AppendPreviousRegistrations` — skip duplicate types instead of throwing
- `CacheOptions.AddType` — skip duplicate types instead of throwing
- Tests verifying idempotent behavior

## Acceptance Criteria
- Calling `AddCache()` twice with the same type registration does not throw
- Calling `AddCache()` twice with different types merges them
- First registration wins when same type is registered with different options
- All existing tests still pass

## Done Condition
User confirms the fix is satisfactory.

## Originating Branch
develop
18 changes: 18 additions & 0 deletions .claude/features-done/mongodb-clear-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Feature: mongodb-clear-cache

## Goal
Fix ClearCache/ClearStale for MongoDB-backed cache types by subscribing to `RequestEvictEvent`.

## Scope
- `MongoDB.cs` constructor — add `IManagedCacheMonitor` parameter and `RequestEvictEvent` subscription

## Acceptance Criteria
- `ICacheMonitor.ClearAll()` removes MongoDB-persisted items
- `ICacheMonitor.ClearStale()` removes stale MongoDB-persisted items
- Existing tests still pass

## Done Condition
User confirms the fix is satisfactory.

## Originating Branch
develop
17 changes: 17 additions & 0 deletions .claude/features-done/mongodb-default-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Feature: mongodb-default-config

## Goal
Fix MongoDB setup when not using "default" config by giving `ConfigurationName` a sensible default.

## Scope
- `MongoDBCacheOptions.ConfigurationName` — set default to `"Default"`

## Acceptance Criteria
- `AddMongoDBOptions()` without explicit ConfigurationName uses `"Default"`
- Existing tests still pass

## Done Condition
User confirms the fix is satisfactory.

## Originating Branch
develop
21 changes: 21 additions & 0 deletions .claude/features-done/monitor-track-persisted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Feature: monitor-track-persisted

## Goal
Make cache items loaded from persistence (MongoDB, Redis, File) visible in the Blazor monitoring UI on first access, not only after re-fetch.

## Scope
- `IManagedCacheMonitor` — add `Track<T>` method
- `CacheMonitor` — implement `Track<T>` (register in `_caches` without firing `DataSetEvent`)
- `CacheBase.GetCoreAsync` — call `Track<T>` when a fresh item is found from persistence but isn't yet in the monitor
- Tests verifying items are tracked on persistence hit

## Acceptance Criteria
- Fresh items found in persistence appear in `ICacheMonitor.GetInfos()` after first access
- `DataSetEvent` is NOT fired for items loaded from persistence (only `DataGetEvent`)
- All existing tests still pass

## Done Condition
User confirms the fix is satisfactory.

## Originating Branch
develop
24 changes: 0 additions & 24 deletions .claude/features-done/readme-documentation.md

This file was deleted.

3 changes: 3 additions & 0 deletions .claude/mission.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
Caching library with MongoDB backend support, cache partitioning, and a Blazor monitoring UI.

## External References
- **Shared instructions**: `$DOC_ROOT/Tharga/shared-instructions.md`
- **Plan directory**: `$DOC_ROOT/Tharga/plans/Toolkit/Cache`
- **Backlog**: `c:\Users\danie\SynologyDrive\Documents\Notes\Tharga\Toolkit\Cache.md`
- **Incoming requests**: `c:\Users\danie\SynologyDrive\Documents\Notes\Tharga\Requests.md` — check for pending requests for this project on startup
10 changes: 8 additions & 2 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
},
"permissions": {
"allow": [
"Bash(git:*)",
"Bash(cd:*)",
"Bash(dotnet:*)",
"Bash(mkdir:*)",
Expand All @@ -17,7 +16,14 @@
"Skill(update-config:*)",
"Bash(grep -r [Inject] --include=*.razor.cs --include=*.cs .)",
"Bash(rm .claude/feature.md)",
"Bash(rm .claude/plan.md)"
"Bash(rm .claude/plan.md)",
"Bash(xargs grep:*)",
"Bash(git checkout:*)",
"Bash(dotnet test:*)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git merge:*)",
"Bash(git log:*)"
],
"additionalDirectories": [
]
Expand Down
Loading
Loading