Compare commits

...

15 Commits

Author SHA1 Message Date
Kutesir
bd632a1592 rename: Jarvis -> Jervis target, scheme, and folder throughout
Some checks failed
CI / Build · Debug (push) Has been cancelled
CI / Build · Release (push) Has been cancelled
The bundle-ID and display-name renames weren't enough — the actual
Xcode target/product name was still "Jarvis", which drives CFBundleName,
Xcode's Organizer archive list, the .xcodeproj filename, and the scheme
name. Renamed all the way through:

- project.yml: top-level name, target key, PRODUCT_NAME, source/info paths
- Jarvis/ -> Jervis/ (source folder, git-tracked as renames, no content
  diffs on the moved files)
- .gitignore, CI workflows, README, CONTRIBUTING: Jarvis.xcodeproj /
  scheme Jarvis -> Jervis.xcodeproj / scheme Jervis

Verified: xcodebuild -scheme Jervis succeeds, produces Jervis.app,
CFBundleName/CFBundleExecutable/CFBundleDisplayName all read "Jervis".
CFBundleIdentifier intentionally stays com.kisani.jarvis (per prior
decision — bundle ID isn't user-facing anywhere including Organizer).

Swift type names (JarvisApp, JarvisWordmark, etc.) and the Gitea repo
name/URL are unchanged — pure internal source identifiers, not user or
developer-facing product identity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 03:49:31 +03:00
Kutesir
3a6f1bbdd8 fix: build number 1 -> 2, and stop xcodegen silently resetting it
Some checks failed
CI / Build · Debug (push) Has been cancelled
CI / Build · Release (push) Has been cancelled
CFBundleVersion/CFBundleShortVersionString weren't declared in
project.yml's properties block, so xcodegen defaulted them to "1"/"1.0"
on every regenerate regardless of CURRENT_PROJECT_VERSION/
MARKETING_VERSION — bumping the build setting silently did nothing.
Declared both explicitly (matching how CFBundleIdentifier and
CFBundleExecutable already reference build settings), so version bumps
now actually reach the compiled app. Verified: CFBundleVersion "2" in
the built binary's Info.plist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 03:42:14 +03:00
Kutesir
bb067df482 docs: record the stale-news / clientRank fix as a key decision
Some checks failed
CI / Build · Debug (push) Has been cancelled
CI / Build · Release (push) Has been cancelled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 03:17:22 +03:00
Kutesir
326d5fe983 fix: stale-news control — repair clientRank's age source, add isFossil backstop
Some checks failed
CI / Build · Debug (push) Has been cancelled
CI / Build · Release (push) Has been cancelled
clientRank already existed specifically to stop stale high-scorers from
leading the feed, but computed age from updatedAt — the same timestamp
that keeps resetting whenever the backend attaches any article to a
cluster (BACKLOG #15). A fossil's age always read as ~0, silently
defeating the whole mechanism. Fixed to use firstSeenAt.

clientRank's decay is soft (max 20% penalty) and isn't always enough
against a high signalScore alone, so added StorySummary.isFossil (>5
days old by firstSeenAt) as a hard backstop: mainStories and
makeDigest now sink fossils below current stories, so one can never
take the hero/lead slot regardless of score. Still shown in the feed,
just not in the most prominent position.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 02:56:34 +03:00
Kutesir
676119b328 revert: keep bundle ID as com.kisani.jarvis
Some checks failed
CI / Build · Debug (push) Has been cancelled
CI / Build · Release (push) Has been cancelled
The bundle ID never appears in the App Store or on-device UI — only
CFBundleDisplayName (home screen / notifications) and the App Store
Connect "Name" field do, both already "Jervis". Changing the bundle ID
was unnecessary scope creep; there's no existing App Store Connect
record tied to the old identifier to worry about, and a mismatched
bundle ID vs. public name is completely normal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 02:49:04 +03:00
Kutesir
b44e708fbb rename: JarvisIcon -> JervisIcon asset (splash screen)
Some checks failed
CI / Build · Debug (push) Has been cancelled
CI / Build · Release (push) Has been cancelled
Same radar-rings artwork, just the asset name catching up to the
Jervis rebrand. No visual change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 02:32:35 +03:00
Kutesir
d93ffb1580 rebrand: Jarvis -> Jervis for App Store submission
Some checks failed
CI / Build · Debug (push) Has been cancelled
CI / Build · Release (push) Has been cancelled
"JARVIS" is Marvel's trademark for the Iron Man/Avengers AI — real
legal risk for a commercial App Store listing, and the name is already
contested there ("Jarvis: Powered by Marvel", "Jarvis - AI Chatbot").
Jervis reads identically but doesn't collide.

Scoped to user-facing surfaces only:
- CFBundleDisplayName, PRODUCT_BUNDLE_IDENTIFIER (com.kisani.jervis)
- BGTaskSchedulerPermittedIdentifiers + matching Swift constants
- NSLocalNetworkUsageDescription permission prompt copy
- JarvisWordmark rendered text ("j" + "ervis")
- Notification permission prompt copy

Internal Xcode target/executable name, Swift type names (JarvisWordmark,
JarvisApp), file/folder names, and repo name are unchanged — renaming
those is a separate, larger refactor with no user-facing benefit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 02:12:48 +03:00
Kutesir
afec870919 fix: display story age from firstSeenAt, not updatedAt
All checks were successful
CI / Build · Debug (push) Successful in 22s
CI / Build · Release (push) Successful in 22s
Old stories were reading "1 hr ago" because updatedAt bumps every time
the backend attaches another article to a cluster, however loosely
related. firstSeenAt is when the cluster actually first appeared and
is already in the API response — just wasn't decoded.

Verified live: story_1a37c858235b (F1 Austria GP recap) has
firstSeenAt 2026-06-16 but updatedAt 2026-07-11, freshnessScore 0.96 —
looked brand new despite being 25 days old. Also confirmed the API's
isStale field is unusable as a stopgap (always false regardless of age).

Ranking still surfaces old stories at the top — that's server-side
(signalScore/freshnessScore) and out of scope for the client per the
architecture rule against re-ranking. Logged in BACKLOG #15.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 01:51:35 +03:00
Kutesir
fcd4e2cce5 docs: log freshness-decay bug — old stories never leave the top of the feed
All checks were successful
CI / Build · Debug (push) Successful in 24s
CI / Build · Release (push) Successful in 30s
Live-verified against the backend API: 13/20 top stories are 5+ days old
by firstSeenAt but still score 90+. Freshness decays from lastUpdatedAt
(cluster last touched) instead of the actual news event age, and it
compounds with the known over-clustering bug (#2) — tangential articles
keep attaching to old clusters, resetting their clock indefinitely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-10 03:17:25 +03:00
Kutesir
0b10009d97 ci: re-trigger — runner Xcode moved to /Applications/Xcode.app on the volume
All checks were successful
CI / Build · Debug (push) Successful in 43s
CI / Build · Release (push) Successful in 17s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 00:31:56 +03:00
Kutesir
3c8d9b5736 ci: re-trigger now that the runner is loaded via LaunchAgent
Some checks failed
CI / Build · Debug (push) Failing after 7s
CI / Build · Release (push) Failing after 1s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-07 00:08:23 +03:00
Kutesir
1476906756 ci: build against device SDK — CoreSimulator hangs on external-volume Xcode
Some checks failed
CI / Build · Debug (push) Failing after 33m6s
CI / Build · Release (push) Failing after 41m24s
Simulator-destination builds flap on CoreSimulatorService for an hour then
die. Device SDK with signing disabled gives identical compile coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-05 19:18:29 +03:00
Kutesir
d62c3511f6 fix: use modelContext.container — \.modelContainer is not an Environment key
Some checks failed
CI / Build · Debug (push) Waiting to run
CI / Build · Release (push) Has been cancelled
CI caught this: the sync-lag fix referenced a nonexistent SwiftUI
environment value. The container is reached through the context.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-05 16:09:32 +03:00
Kutesir
5419540648 docs: correct act_runner setup — binary install, host labels, docker-less config
Some checks failed
CI / Build · Debug (push) Failing after 29s
CI / Build · Release (push) Failing after 7s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-03 02:16:02 +03:00
Kutesir
f7164e2978 ci: trigger run for runner debugging
Some checks failed
CI / Build · Debug (push) Failing after 3s
CI / Build · Release (push) Failing after 2s
2026-07-03 01:38:21 +03:00
48 changed files with 177 additions and 75 deletions

View File

@@ -36,33 +36,24 @@ jobs:
- name: Generate Xcode project - name: Generate Xcode project
run: xcodegen generate run: xcodegen generate
- name: Build (${{ matrix.configuration }}, iOS Simulator) # Device SDK, signing disabled: CoreSimulator on the runner Mac is unreliable
# (Xcode on an external volume can't discover simulator runtimes and hangs).
# Compilation coverage is identical; no tests run on simulator yet anyway.
- name: Build (${{ matrix.configuration }}, iOS device SDK)
run: | run: |
set -o pipefail set -o pipefail
xcodebuild \ xcodebuild \
-project Jarvis.xcodeproj \ -project Jervis.xcodeproj \
-scheme Jarvis \ -scheme Jervis \
-configuration ${{ matrix.configuration }} \ -configuration ${{ matrix.configuration }} \
-sdk iphonesimulator \ -sdk iphoneos \
-destination 'generic/platform=iOS Simulator' \ -destination 'generic/platform=iOS' \
-derivedDataPath build \ -derivedDataPath build \
COMPILATION_CACHE_ENABLE_CACHING=NO \
CODE_SIGNING_ALLOWED=NO \ CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_REQUIRED=NO \
build build
# Compiles the test bundle. No test targets exist yet (see docs/BACKLOG.md #13). # No test targets exist yet (see docs/BACKLOG.md #13). When a JervisTests
# Replace with `xcodebuild test` once a JarvisTests target is added to project.yml. # target is added, switch this to `xcodebuild test` on a simulator — after
- name: Build for Testing (Debug) # fixing CoreSimulator on the runner (Xcode must live on the boot volume).
if: matrix.configuration == 'Debug'
run: |
set -o pipefail
xcodebuild \
-project Jarvis.xcodeproj \
-scheme Jarvis \
-configuration Debug \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,OS=latest,name=iPhone 16' \
-derivedDataPath build \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
build-for-testing

View File

@@ -35,18 +35,18 @@ jobs:
run: | run: |
set -o pipefail set -o pipefail
xcodebuild archive \ xcodebuild archive \
-project Jarvis.xcodeproj \ -project Jervis.xcodeproj \
-scheme Jarvis \ -scheme Jervis \
-configuration Release \ -configuration Release \
-sdk iphoneos \ -sdk iphoneos \
-archivePath build/Jarvis.xcarchive \ -archivePath build/Jervis.xcarchive \
DEVELOPMENT_TEAM=K8BLMMR883 DEVELOPMENT_TEAM=K8BLMMR883
- name: Export IPA - name: Export IPA
run: | run: |
set -o pipefail set -o pipefail
xcodebuild -exportArchive \ xcodebuild -exportArchive \
-archivePath build/Jarvis.xcarchive \ -archivePath build/Jervis.xcarchive \
-exportPath build/ipa \ -exportPath build/ipa \
-exportOptionsPlist ExportOptions.plist -exportOptionsPlist ExportOptions.plist
@@ -59,7 +59,7 @@ jobs:
echo "$ASC_PRIVATE_KEY" > /tmp/AuthKey_${ASC_KEY_ID}.p8 echo "$ASC_PRIVATE_KEY" > /tmp/AuthKey_${ASC_KEY_ID}.p8
xcrun altool --upload-app \ xcrun altool --upload-app \
--type ios \ --type ios \
--file build/ipa/Jarvis.ipa \ --file build/ipa/Jervis.ipa \
--apiKey "$ASC_KEY_ID" \ --apiKey "$ASC_KEY_ID" \
--apiIssuer "$ASC_ISSUER_ID" --apiIssuer "$ASC_ISSUER_ID"
rm -f /tmp/AuthKey_${ASC_KEY_ID}.p8 rm -f /tmp/AuthKey_${ASC_KEY_ID}.p8

2
.gitignore vendored
View File

@@ -7,7 +7,7 @@ xcuserdata/
*.moved-aside *.moved-aside
# Generated by XcodeGen — project.yml is the source of truth # Generated by XcodeGen — project.yml is the source of truth
Jarvis.xcodeproj/ Jervis.xcodeproj/
# SwiftPM # SwiftPM
.build/ .build/

View File

@@ -120,6 +120,18 @@ API/contract.md — REST + WebSocket API spec
- Pagination: cursor-based via `nextCursor`. - Pagination: cursor-based via `nextCursor`.
- `StoryStore.setPill()` resets `lastSyncedAt` to bypass the 30s rate-limit on filter switch. - `StoryStore.setPill()` resets `lastSyncedAt` to bypass the 30s rate-limit on filter switch.
- `sectionSupplement` fetches populate sparse regional sections in the All digest independently. - `sectionSupplement` fetches populate sparse regional sections in the All digest independently.
- **Age must be read from `firstSeenAt`, never `updatedAt`.** The backend bumps `updatedAt`
every time it attaches another article to a cluster, however loosely related a story
can read "1 hr ago" while being weeks old (see `docs/BACKLOG.md` #15). `firstSeenAt` is
the honest age and is already decoded on `StorySummary`.
- **Stale-news control (client-side, `Views/Shared/Theme.swift`):** `clientRank` applies a
soft time-decay to `signalScore` so fresh stories outrank stale high-scorers in
`feedOrder` it computes age from `firstSeenAt`, not `updatedAt` (was silently broken
by the same bug above until fixed). `StorySummary.isFossil` (`firstSeenAt` > 5 days) is a
hard backstop on top of that: `SignalFeedView.mainStories` and `.makeDigest()` sink
fossils below current stories so one can never take the hero/lead slot, regardless of
score. Fossils still appear in the feed — just not in the most prominent position. This
is a display/ordering patch; the server's own ranking is still wrong at the source.
--- ---

View File

@@ -1,4 +1,4 @@
# Contributing to Jarvis # Contributing to Jervis
## Branch workflow ## Branch workflow
@@ -48,41 +48,58 @@ Then restart Gitea.
### 2. Install act_runner on the Mac ### 2. Install act_runner on the Mac
```bash There is no Homebrew formula — download the official binary:
brew install act-runner
```
Or download the binary from your Gitea instance: ```bash
`http://10.10.1.21:3002/-/admin/runners` curl -sL -o /usr/local/bin/act_runner \
https://dl.gitea.com/act_runner/0.6.1/act_runner-0.6.1-darwin-arm64
chmod +x /usr/local/bin/act_runner
```
### 3. Register the runner ### 3. Register the runner
Get a registration token from: Get a registration token from:
**Repository Settings → Actions → Runners → Create Runner** **Repository Settings → Actions → Runners → Create Runner**
(or via API: `GET /api/v1/repos/kutesir/jarvis/actions/runners/registration-token`)
Then: The `:host` label suffix is required — it makes jobs run directly on the Mac
instead of in Docker (which xcodebuild needs, and the Mac has no Docker):
```bash ```bash
act_runner register \ mkdir -p ~/.act_runner && cd ~/.act_runner
act_runner register --no-interactive \
--instance http://10.10.1.21:3002 \ --instance http://10.10.1.21:3002 \
--token <RUNNER_TOKEN> \ --token <RUNNER_TOKEN> \
--name "mac-mini" \ --name "mac-mini" \
--labels "self-hosted,macos" --labels "self-hosted:host,macos:host"
``` ```
### 4. Start the runner ### 4. Configure and start the runner
Generate the config, then fix two defaults that break Docker-less Macs
(the generated config ships Docker-based ubuntu labels that make the daemon
refuse to start without a Docker socket):
```bash ```bash
act_runner daemon cd ~/.act_runner
act_runner generate-config > config.yaml
# 1. labels: [] — empty falls back to the :host labels in .runner
# 2. docker_host: "-" — never look for a Docker daemon
``` ```
To run it as a background service: In `config.yaml`, set:
- `labels: []` (replace the default ubuntu docker labels)
- `docker_host: "-"` (under `container:`)
Then start it:
```bash ```bash
brew services start act-runner # if installed via brew act_runner daemon --config ~/.act_runner/config.yaml
# or add a launchd plist manually
``` ```
To keep it running across reboots, load it as a LaunchAgent
(`~/Library/LaunchAgents/com.gitea.act-runner.plist`, see repo scripts).
The runner must have **Xcode 16+** installed and accepted the license: The runner must have **Xcode 16+** installed and accepted the license:
```bash ```bash

View File

Before

Width:  |  Height:  |  Size: 442 KiB

After

Width:  |  Height:  |  Size: 442 KiB

View File

@@ -1,7 +1,7 @@
{ {
"images" : [ "images" : [
{ {
"filename" : "JarvisIcon.png", "filename" : "JervisIcon.png",
"idiom" : "universal", "idiom" : "universal",
"scale" : "1x" "scale" : "1x"
}, },

View File

Before

Width:  |  Height:  |  Size: 442 KiB

After

Width:  |  Height:  |  Size: 442 KiB

View File

@@ -10,7 +10,7 @@
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Jarvis</string> <string>Jervis</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
@@ -22,9 +22,9 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.0</string> <string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>tailscale</string> <string>tailscale</string>
@@ -39,7 +39,7 @@
<true/> <true/>
</dict> </dict>
<key>NSLocalNetworkUsageDescription</key> <key>NSLocalNetworkUsageDescription</key>
<string>Jarvis connects to your self-hosted news platform on the local network.</string> <string>Jervis connects to your self-hosted news platform on the local network.</string>
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>
<array> <array>
<string>fetch</string> <string>fetch</string>

View File

@@ -19,7 +19,7 @@ struct SplashView: View {
ZStack { ZStack {
Color(hex: "0A0A0A").ignoresSafeArea() Color(hex: "0A0A0A").ignoresSafeArea()
VStack(spacing: 22) { VStack(spacing: 22) {
Image("JarvisIcon") Image("JervisIcon")
.resizable() .resizable()
.frame(width: 108, height: 108) .frame(width: 108, height: 108)
.clipShape(Circle()) .clipShape(Circle())

View File

@@ -61,6 +61,11 @@ struct StorySummary: Codable, Identifiable, Hashable {
let conflict: String? let conflict: String?
let updatedAt: Date let updatedAt: Date
let createdAt: Date let createdAt: Date
/// When the cluster first appeared. `updatedAt` bumps on every article the
/// backend attaches to the cluster (even a loosely-related one), so it can
/// read "1 hr ago" on stories that are actually weeks old `firstSeenAt`
/// is the honest age. Optional so decoding tolerates older API responses.
let firstSeenAt: Date?
} }
struct ScoreBreakdown: Codable, Hashable { struct ScoreBreakdown: Codable, Hashable {
@@ -185,6 +190,10 @@ final class CachedStory {
/// Original publish timestamp. Defaults to updatedAt for rows cached before /// Original publish timestamp. Defaults to updatedAt for rows cached before
/// this field was added SwiftData handles the automatic migration. /// this field was added SwiftData handles the automatic migration.
var createdAt: Date = Date() var createdAt: Date = Date()
/// When the cluster first appeared the honest age, unlike `updatedAt` which
/// bumps whenever the backend attaches another article. Defaults to `updatedAt`
/// for rows cached before this field was added.
var firstSeenAt: Date = Date()
var cachedAt: Date var cachedAt: Date
init(from summary: StorySummary) { init(from summary: StorySummary) {
@@ -199,6 +208,7 @@ final class CachedStory {
self.conflict = summary.conflict self.conflict = summary.conflict
self.updatedAt = summary.updatedAt self.updatedAt = summary.updatedAt
self.createdAt = summary.createdAt self.createdAt = summary.createdAt
self.firstSeenAt = summary.firstSeenAt ?? summary.updatedAt
self.cachedAt = Date() self.cachedAt = Date()
} }
} }

View File

@@ -312,7 +312,8 @@ final class StoryStore: ObservableObject {
consensus: old.consensus, consensus: old.consensus,
conflict: old.conflict, conflict: old.conflict,
updatedAt: old.updatedAt, updatedAt: old.updatedAt,
createdAt: old.createdAt createdAt: old.createdAt,
firstSeenAt: old.firstSeenAt
) )
stories[idx] = updated stories[idx] = updated
stories.sort(by: StorySummary.feedOrder) stories.sort(by: StorySummary.feedOrder)

View File

@@ -10,7 +10,6 @@ struct SignalFeedView: View {
@EnvironmentObject var ws: WebSocketManager @EnvironmentObject var ws: WebSocketManager
@EnvironmentObject var settings: ServerSettings @EnvironmentObject var settings: ServerSettings
@Environment(\.modelContext) private var modelContext @Environment(\.modelContext) private var modelContext
@Environment(\.modelContainer) private var modelContainer
@Query private var cachedStories: [CachedStory] @Query private var cachedStories: [CachedStory]
@Query private var cachedArticles: [CachedArticle] @Query private var cachedArticles: [CachedArticle]
@@ -52,12 +51,16 @@ struct SignalFeedView: View {
return matched return matched
} }
/// The main feed: unread stories, with already-seen ones sunk below fresh ones. /// The main feed: unread stories, with already-seen ones sunk below fresh
/// ones, and fossils (old by firstSeenAt, see StorySummary.isFossil) sunk
/// below everything a high signalScore alone can't make old news lead.
private var mainStories: [StorySummary] { private var mainStories: [StorySummary] {
let notRead = filteredStories.filter { !readStoryIds.contains($0.id) } let notRead = filteredStories.filter { !readStoryIds.contains($0.id) }
let fresh = notRead.filter { !seenSnapshot.contains($0.id) } let current = notRead.filter { !$0.isFossil }
let seen = notRead.filter { seenSnapshot.contains($0.id) } let fossils = notRead.filter { $0.isFossil }
return fresh + seen let fresh = current.filter { !seenSnapshot.contains($0.id) }
let seen = current.filter { seenSnapshot.contains($0.id) }
return fresh + seen + fossils
} }
/// Read stories, tucked into the collapsible "Read" shelf. /// Read stories, tucked into the collapsible "Read" shelf.
@@ -73,8 +76,13 @@ struct SignalFeedView: View {
/// per-section targeted fetches held in store.sectionSupplement. /// per-section targeted fetches held in store.sectionSupplement.
private func makeDigest(sections: [NewsSection]) -> (top: [StorySummary], sections: [(NewsSection, [StorySummary])]) { private func makeDigest(sections: [NewsSection]) -> (top: [StorySummary], sections: [(NewsSection, [StorySummary])]) {
let unread = filteredStories.filter { !readStoryIds.contains($0.id) } let unread = filteredStories.filter { !readStoryIds.contains($0.id) }
let top = Array(unread.prefix(5)) // Fossils (old by firstSeenAt) sink below current stories so the lead
var pool = Array(unread.dropFirst(5)) // slot is never a high-scoring but stale story see StorySummary.isFossil.
let current = unread.filter { !$0.isFossil }
let fossils = unread.filter { $0.isFossil }
let reordered = current + fossils
let top = Array(reordered.prefix(5))
var pool = Array(reordered.dropFirst(5))
var usedIds = Set(top.map(\.id)) var usedIds = Set(top.map(\.id))
var out: [(NewsSection, [StorySummary])] = [] var out: [(NewsSection, [StorySummary])] = []
for section in sections { for section in sections {
@@ -482,7 +490,7 @@ struct SignalFeedView: View {
if !story.sources.isEmpty { if !story.sources.isEmpty {
SourceChips(names: story.sources.map(\.name), total: story.sourceCount) SourceChips(names: story.sources.map(\.name), total: story.sourceCount)
} }
Text("\(story.sourceCount) sources · \(story.updatedAt.timeAgoShort()) ago") Text("\(story.sourceCount) sources · \((story.firstSeenAt ?? story.updatedAt).timeAgoShort()) ago")
.font(.system(size: 11, weight: .regular, design: .monospaced)) .font(.system(size: 11, weight: .regular, design: .monospaced))
.foregroundStyle(Palette.tertiaryText) .foregroundStyle(Palette.tertiaryText)
} }
@@ -724,7 +732,7 @@ struct SignalFeedView: View {
private func cacheStories(_ stories: [StorySummary]) { private func cacheStories(_ stories: [StorySummary]) {
guard !stories.isEmpty else { return } guard !stories.isEmpty else { return }
let container = modelContainer let container = modelContext.container
Task.detached { Task.detached {
let ctx = ModelContext(container) let ctx = ModelContext(container)
let existing = (try? ctx.fetch(FetchDescriptor<CachedStory>())) ?? [] let existing = (try? ctx.fetch(FetchDescriptor<CachedStory>())) ?? []
@@ -769,7 +777,8 @@ extension StorySummary {
consensus: cached.consensus, consensus: cached.consensus,
conflict: cached.conflict, conflict: cached.conflict,
updatedAt: cached.updatedAt, updatedAt: cached.updatedAt,
createdAt: cached.createdAt createdAt: cached.createdAt,
firstSeenAt: cached.firstSeenAt
) )
} }
} }

View File

@@ -99,7 +99,11 @@ struct StoryRowView: View {
private var metaLine: String { private var metaLine: String {
let sources = "\(story.sourceCount) source\(story.sourceCount == 1 ? "" : "s")" let sources = "\(story.sourceCount) source\(story.sourceCount == 1 ? "" : "s")"
return "\(sources) · \(Topic.label(story.topic)) · \(story.updatedAt.timeAgoShort()) ago" // firstSeenAt is when the cluster appeared updatedAt bumps on every
// article the backend attaches, so it can read "just now" on stories
// that are actually weeks old.
let age = (story.firstSeenAt ?? story.updatedAt).timeAgoShort()
return "\(sources) · \(Topic.label(story.topic)) · \(age) ago"
} }
} }
@@ -117,7 +121,8 @@ struct StoryRowView: View {
id: "\(score)", headline: "Bank of Uganda cuts interest rates by 50 basis points", id: "\(score)", headline: "Bank of Uganda cuts interest rates by 50 basis points",
summary: "", topic: "finance", tags: ["finance"], signalScore: score, scoreBreakdown: breakdown, summary: "", topic: "finance", tags: ["finance"], signalScore: score, scoreBreakdown: breakdown,
sourceCount: 7, sources: sources, consensus: nil, conflict: nil, sourceCount: 7, sources: sources, consensus: nil, conflict: nil,
updatedAt: Date().addingTimeInterval(-3600), createdAt: Date()), updatedAt: Date().addingTimeInterval(-3600), createdAt: Date(),
firstSeenAt: Date().addingTimeInterval(-3600)),
isCached: score == 64 isCached: score == 64
) )
} }

View File

@@ -52,7 +52,7 @@ struct NotificationsView: View {
private var permissionCard: some View { private var permissionCard: some View {
VStack(alignment: .leading, spacing: 12) { VStack(alignment: .leading, spacing: 12) {
Text("Jarvis needs permission to send briefings and breaking alerts.") Text("Jervis needs permission to send briefings and breaking alerts.")
.font(.system(size: 14)).foregroundStyle(Color(hex: "BBBBBB")) .font(.system(size: 14)).foregroundStyle(Color(hex: "BBBBBB"))
.fixedSize(horizontal: false, vertical: true) .fixedSize(horizontal: false, vertical: true)
Button { Button {

View File

@@ -269,14 +269,32 @@ enum AppearanceMode: String, CaseIterable {
// //
// Effect: a score-80 story from 1 hour ago (rank 79.8) beats a score-82 story // Effect: a score-80 story from 1 hour ago (rank 79.8) beats a score-82 story
// from 48 hours ago (rank 71.4). Pure score still dominates for same-age stories. // from 48 hours ago (rank 71.4). Pure score still dominates for same-age stories.
//
// Age is measured from `firstSeenAt`, not `updatedAt` the backend bumps
// `updatedAt` every time it attaches another article to a cluster, however
// loosely related (see BACKLOG #15), so a story can read as "just now" while
// being weeks old by `firstSeenAt`. Using `updatedAt` here previously
// neutralized the whole point of this decay: a fossil story's age always
// computed near zero.
extension StorySummary { extension StorySummary {
var clientRank: Double { var clientRank: Double {
let ageHours = max(0.0, -updatedAt.timeIntervalSinceNow) / 3600.0 let ageHours = max(0.0, -(firstSeenAt ?? updatedAt).timeIntervalSinceNow) / 3600.0
let decay = 1.0 / (1.0 + ageHours / 24.0) let decay = 1.0 / (1.0 + ageHours / 24.0)
return Double(signalScore) * (0.80 + 0.20 * decay) return Double(signalScore) * (0.80 + 0.20 * decay)
} }
/// Even with the fix above, this decay is soft (max 20% penalty) a
/// high enough signalScore can still outrank fresher, lower-scored
/// stories. `isFossil` is a hard backstop views use to keep genuinely
/// old stories out of the lead/hero slot regardless of score.
static let fossilThresholdDays: Double = 5
var isFossil: Bool {
let ageSeconds = -(firstSeenAt ?? updatedAt).timeIntervalSinceNow
return ageSeconds > StorySummary.fossilThresholdDays * 86400
}
static func feedOrder(_ a: StorySummary, _ b: StorySummary) -> Bool { static func feedOrder(_ a: StorySummary, _ b: StorySummary) -> Bool {
let diff = a.clientRank - b.clientRank let diff = a.clientRank - b.clientRank
// Stable tiebreak for nearly-equal ranks: newer ID wins (IDs are // Stable tiebreak for nearly-equal ranks: newer ID wins (IDs are
@@ -363,7 +381,7 @@ struct JarvisWordmark: View {
var body: some View { var body: some View {
HStack(spacing: 0) { HStack(spacing: 0) {
Text("j").font(font).foregroundStyle(Palette.orange) Text("j").font(font).foregroundStyle(Palette.orange)
Text("arvis").font(font).foregroundStyle(Palette.primaryText) Text("ervis").font(font).foregroundStyle(Palette.primaryText)
} }
} }
} }

View File

@@ -1,4 +1,4 @@
# Jarvis (iOS) # Jervis (iOS)
A SwiftUI iOS client for a self-hosted RSS **news-correlation** platform. It shows A SwiftUI iOS client for a self-hosted RSS **news-correlation** platform. It shows
stories ranked by a server-computed **signal score**, caches full articles for offline stories ranked by a server-computed **signal score**, caches full articles for offline
@@ -18,7 +18,7 @@ reading, and receives live updates over WebSocket.
directly. directly.
``` ```
Jarvis/ Jervis/
Models/ Codable + SwiftData models Models/ Codable + SwiftData models
Networking/ APIClient (REST), WebSocketManager Networking/ APIClient (REST), WebSocketManager
Store/ StoryStore, ServerSettings Store/ StoryStore, ServerSettings
@@ -37,10 +37,10 @@ Jarvis/
```bash ```bash
brew install xcodegen # once brew install xcodegen # once
xcodegen generate # produces Jarvis.xcodeproj xcodegen generate # produces Jervis.xcodeproj
open Jarvis.xcodeproj # ⌘R in Xcode, or: open Jervis.xcodeproj # ⌘R in Xcode, or:
xcodebuild -project Jarvis.xcodeproj -scheme Jarvis \ xcodebuild -project Jervis.xcodeproj -scheme Jervis \
-sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 17' build -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 17' build
``` ```

View File

@@ -28,6 +28,42 @@ Status: 🔴 open · 🟡 mitigated client-side (real fix still pending) · 🟢
3. 🔴 **[backend] Add accurate per-story tags (topic + region).** So the client can read 3. 🔴 **[backend] Add accurate per-story tags (topic + region).** So the client can read
tags (sport, uganda, south-africa, …) instead of keyword-guessing. Unblocks #6. tags (sport, uganda, south-africa, …) instead of keyword-guessing. Unblocks #6.
4. 🔴 **[backend] Topic-classifier coverage for the 47 feeds.** science/world/tech mapping. 4. 🔴 **[backend] Topic-classifier coverage for the 47 feeds.** science/world/tech mapping.
15. 🔴 **[backend] Freshness score decays from `lastUpdatedAt` (cluster last touched), not
from the actual news event age — old stories never leave the top of the feed.**
Confirmed live on `/api/v1/stories`: 13 of the top 20 stories are 5+ days old by
`firstSeenAt` but still score 90+; the #1 story (`story_511c67eb064d`) has
`firstSeenAt: 2026-06-17`, `lastUpdatedAt: 2026-07-09` (21 days later), `freshnessScore:
1.0`, signal 100. Compounds with #2 (over-clustering): a loose cluster keeps absorbing
tangential articles indefinitely (this story's timeline includes "Security forces ready
for June 30 marches: Ramaphosa" — unrelated to the football story it's attached to),
each attachment resets `lastUpdatedAt` to now, so the cluster's clock never runs out and
its canonical headline drifts to whatever was clustered last (list view showed "South
Africa stun South Korea…"; story detail showed "Updated FIFA rankings after Bafana
Bafana exit" for the *same* `story_id`). **Fix: decay freshness from `firstSeenAt` (or
the newest article whose relevance to the cluster core is verified), not from
"last touched."** Tightening the TF-IDF threshold in #2 should also reduce how often
unrelated articles keep a stale cluster's clock alive. Also confirmed the API's own
`isStale` field is unusable as a stopgap — it reads `false` on every story checked
regardless of actual age, so it isn't computed from a real staleness threshold.
*Client mitigations shipped:*
1. Age display (row meta line, hero card) now reads from `firstSeenAt` instead of
`updatedAt`, so the UI no longer shows "1 hr ago" on stories that are actually
weeks old.
2. Found that `StorySummary.clientRank` — an *existing* time-decay mechanism, already
in the codebase specifically to stop stale high-scorers from leading the feed — was
itself silently neutralized by this same bug: it computed age from `updatedAt`, so a
fossil's age always read as ~0. Fixed to use `firstSeenAt`. This isn't new
client-side ranking logic; it's un-breaking a pre-existing, intentional one.
3. Added `StorySummary.isFossil` (`firstSeenAt` > 5 days old) as a hard backstop —
`clientRank`'s decay is soft (max 20% score penalty) and isn't always enough to
overcome a high `signalScore` alone. Fossils are sunk below current stories in
`mainStories` and `makeDigest`, so a stale story can never occupy the hero/lead slot
even if the server still ranks it #1. They still appear in the feed, just not in
the most prominent, most misleading position.
*Still wrong at the source* — the server's own `signalScore`/`freshnessScore` ordering
(what page 2+, pagination cutoffs, and `min_signal` filtering all rely on) is
unaffected; these are display/ordering patches downstream of it. The real fix is
still backend-side.
## Backend — features ## Backend — features

View File

@@ -1,4 +1,4 @@
name: Jarvis name: Jervis
options: options:
bundleIdPrefix: com.kisani bundleIdPrefix: com.kisani
deploymentTarget: deploymentTarget:
@@ -6,21 +6,23 @@ options:
createIntermediateGroups: true createIntermediateGroups: true
targets: targets:
Jarvis: Jervis:
type: application type: application
platform: iOS platform: iOS
deploymentTarget: "17.0" deploymentTarget: "17.0"
sources: sources:
- path: Jarvis - path: Jervis
info: info:
path: Jarvis/Info.plist path: Jervis/Info.plist
properties: properties:
CFBundleDisplayName: Jarvis CFBundleDisplayName: Jervis
CFBundleShortVersionString: $(MARKETING_VERSION)
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
UILaunchScreen: UILaunchScreen:
UIColorName: "" UIColorName: ""
UISupportedInterfaceOrientations: UISupportedInterfaceOrientations:
- UIInterfaceOrientationPortrait - UIInterfaceOrientationPortrait
NSLocalNetworkUsageDescription: "Jarvis connects to your self-hosted news platform on the local network." NSLocalNetworkUsageDescription: "Jervis connects to your self-hosted news platform on the local network."
NSAppTransportSecurity: NSAppTransportSecurity:
NSAllowsArbitraryLoads: true NSAllowsArbitraryLoads: true
NSAllowsLocalNetworking: true NSAllowsLocalNetworking: true
@@ -37,8 +39,9 @@ targets:
settings: settings:
base: base:
PRODUCT_BUNDLE_IDENTIFIER: com.kisani.jarvis PRODUCT_BUNDLE_IDENTIFIER: com.kisani.jarvis
PRODUCT_NAME: Jervis
MARKETING_VERSION: "1.0" MARKETING_VERSION: "1.0"
CURRENT_PROJECT_VERSION: "1" CURRENT_PROJECT_VERSION: "2"
TARGETED_DEVICE_FAMILY: "1" TARGETED_DEVICE_FAMILY: "1"
SWIFT_VERSION: "5.0" SWIFT_VERSION: "5.0"
# Device builds: automatic signing. Change DEVELOPMENT_TEAM to your team # Device builds: automatic signing. Change DEVELOPMENT_TEAM to your team