Compare commits
15 Commits
457866c7ac
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd632a1592 | ||
|
|
3a6f1bbdd8 | ||
|
|
bb067df482 | ||
|
|
326d5fe983 | ||
|
|
676119b328 | ||
|
|
b44e708fbb | ||
|
|
d93ffb1580 | ||
|
|
afec870919 | ||
|
|
fcd4e2cce5 | ||
|
|
0b10009d97 | ||
|
|
3c8d9b5736 | ||
|
|
1476906756 | ||
|
|
d62c3511f6 | ||
|
|
5419540648 | ||
|
|
f7164e2978 |
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
@@ -36,33 +36,24 @@ jobs:
|
||||
- name: Generate Xcode project
|
||||
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: |
|
||||
set -o pipefail
|
||||
xcodebuild \
|
||||
-project Jarvis.xcodeproj \
|
||||
-scheme Jarvis \
|
||||
-project Jervis.xcodeproj \
|
||||
-scheme Jervis \
|
||||
-configuration ${{ matrix.configuration }} \
|
||||
-sdk iphonesimulator \
|
||||
-destination 'generic/platform=iOS Simulator' \
|
||||
-sdk iphoneos \
|
||||
-destination 'generic/platform=iOS' \
|
||||
-derivedDataPath build \
|
||||
COMPILATION_CACHE_ENABLE_CACHING=NO \
|
||||
CODE_SIGNING_ALLOWED=NO \
|
||||
CODE_SIGNING_REQUIRED=NO \
|
||||
build
|
||||
|
||||
# Compiles the test bundle. No test targets exist yet (see docs/BACKLOG.md #13).
|
||||
# Replace with `xcodebuild test` once a JarvisTests target is added to project.yml.
|
||||
- name: Build for Testing (Debug)
|
||||
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
|
||||
# No test targets exist yet (see docs/BACKLOG.md #13). When a JervisTests
|
||||
# target is added, switch this to `xcodebuild test` on a simulator — after
|
||||
# fixing CoreSimulator on the runner (Xcode must live on the boot volume).
|
||||
|
||||
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
@@ -35,18 +35,18 @@ jobs:
|
||||
run: |
|
||||
set -o pipefail
|
||||
xcodebuild archive \
|
||||
-project Jarvis.xcodeproj \
|
||||
-scheme Jarvis \
|
||||
-project Jervis.xcodeproj \
|
||||
-scheme Jervis \
|
||||
-configuration Release \
|
||||
-sdk iphoneos \
|
||||
-archivePath build/Jarvis.xcarchive \
|
||||
-archivePath build/Jervis.xcarchive \
|
||||
DEVELOPMENT_TEAM=K8BLMMR883
|
||||
|
||||
- name: Export IPA
|
||||
run: |
|
||||
set -o pipefail
|
||||
xcodebuild -exportArchive \
|
||||
-archivePath build/Jarvis.xcarchive \
|
||||
-archivePath build/Jervis.xcarchive \
|
||||
-exportPath build/ipa \
|
||||
-exportOptionsPlist ExportOptions.plist
|
||||
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
echo "$ASC_PRIVATE_KEY" > /tmp/AuthKey_${ASC_KEY_ID}.p8
|
||||
xcrun altool --upload-app \
|
||||
--type ios \
|
||||
--file build/ipa/Jarvis.ipa \
|
||||
--file build/ipa/Jervis.ipa \
|
||||
--apiKey "$ASC_KEY_ID" \
|
||||
--apiIssuer "$ASC_ISSUER_ID"
|
||||
rm -f /tmp/AuthKey_${ASC_KEY_ID}.p8
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,7 +7,7 @@ xcuserdata/
|
||||
*.moved-aside
|
||||
|
||||
# Generated by XcodeGen — project.yml is the source of truth
|
||||
Jarvis.xcodeproj/
|
||||
Jervis.xcodeproj/
|
||||
|
||||
# SwiftPM
|
||||
.build/
|
||||
|
||||
12
CLAUDE.md
12
CLAUDE.md
@@ -120,6 +120,18 @@ API/contract.md — REST + WebSocket API spec
|
||||
- Pagination: cursor-based via `nextCursor`.
|
||||
- `StoryStore.setPill()` resets `lastSyncedAt` to bypass the 30s rate-limit on filter switch.
|
||||
- `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.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Contributing to Jarvis
|
||||
# Contributing to Jervis
|
||||
|
||||
## Branch workflow
|
||||
|
||||
@@ -48,41 +48,58 @@ Then restart Gitea.
|
||||
|
||||
### 2. Install act_runner on the Mac
|
||||
|
||||
```bash
|
||||
brew install act-runner
|
||||
```
|
||||
There is no Homebrew formula — download the official binary:
|
||||
|
||||
Or download the binary from your Gitea instance:
|
||||
`http://10.10.1.21:3002/-/admin/runners`
|
||||
```bash
|
||||
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
|
||||
|
||||
Get a registration token from:
|
||||
**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
|
||||
act_runner register \
|
||||
mkdir -p ~/.act_runner && cd ~/.act_runner
|
||||
act_runner register --no-interactive \
|
||||
--instance http://10.10.1.21:3002 \
|
||||
--token <RUNNER_TOKEN> \
|
||||
--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
|
||||
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
|
||||
brew services start act-runner # if installed via brew
|
||||
# or add a launchd plist manually
|
||||
act_runner daemon --config ~/.act_runner/config.yaml
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
```bash
|
||||
|
||||
|
Before Width: | Height: | Size: 442 KiB After Width: | Height: | Size: 442 KiB |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "JarvisIcon.png",
|
||||
"filename" : "JervisIcon.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
|
Before Width: | Height: | Size: 442 KiB After Width: | Height: | Size: 442 KiB |
@@ -10,7 +10,7 @@
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Jarvis</string>
|
||||
<string>Jervis</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@@ -22,9 +22,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>LSApplicationQueriesSchemes</key>
|
||||
<array>
|
||||
<string>tailscale</string>
|
||||
@@ -39,7 +39,7 @@
|
||||
<true/>
|
||||
</dict>
|
||||
<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>
|
||||
<array>
|
||||
<string>fetch</string>
|
||||
@@ -19,7 +19,7 @@ struct SplashView: View {
|
||||
ZStack {
|
||||
Color(hex: "0A0A0A").ignoresSafeArea()
|
||||
VStack(spacing: 22) {
|
||||
Image("JarvisIcon")
|
||||
Image("JervisIcon")
|
||||
.resizable()
|
||||
.frame(width: 108, height: 108)
|
||||
.clipShape(Circle())
|
||||
@@ -61,6 +61,11 @@ struct StorySummary: Codable, Identifiable, Hashable {
|
||||
let conflict: String?
|
||||
let updatedAt: 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 {
|
||||
@@ -185,6 +190,10 @@ final class CachedStory {
|
||||
/// Original publish timestamp. Defaults to updatedAt for rows cached before
|
||||
/// this field was added — SwiftData handles the automatic migration.
|
||||
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
|
||||
|
||||
init(from summary: StorySummary) {
|
||||
@@ -199,6 +208,7 @@ final class CachedStory {
|
||||
self.conflict = summary.conflict
|
||||
self.updatedAt = summary.updatedAt
|
||||
self.createdAt = summary.createdAt
|
||||
self.firstSeenAt = summary.firstSeenAt ?? summary.updatedAt
|
||||
self.cachedAt = Date()
|
||||
}
|
||||
}
|
||||
@@ -312,7 +312,8 @@ final class StoryStore: ObservableObject {
|
||||
consensus: old.consensus,
|
||||
conflict: old.conflict,
|
||||
updatedAt: old.updatedAt,
|
||||
createdAt: old.createdAt
|
||||
createdAt: old.createdAt,
|
||||
firstSeenAt: old.firstSeenAt
|
||||
)
|
||||
stories[idx] = updated
|
||||
stories.sort(by: StorySummary.feedOrder)
|
||||
@@ -10,7 +10,6 @@ struct SignalFeedView: View {
|
||||
@EnvironmentObject var ws: WebSocketManager
|
||||
@EnvironmentObject var settings: ServerSettings
|
||||
@Environment(\.modelContext) private var modelContext
|
||||
@Environment(\.modelContainer) private var modelContainer
|
||||
|
||||
@Query private var cachedStories: [CachedStory]
|
||||
@Query private var cachedArticles: [CachedArticle]
|
||||
@@ -52,12 +51,16 @@ struct SignalFeedView: View {
|
||||
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] {
|
||||
let notRead = filteredStories.filter { !readStoryIds.contains($0.id) }
|
||||
let fresh = notRead.filter { !seenSnapshot.contains($0.id) }
|
||||
let seen = notRead.filter { seenSnapshot.contains($0.id) }
|
||||
return fresh + seen
|
||||
let current = notRead.filter { !$0.isFossil }
|
||||
let fossils = notRead.filter { $0.isFossil }
|
||||
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.
|
||||
@@ -73,8 +76,13 @@ struct SignalFeedView: View {
|
||||
/// per-section targeted fetches held in store.sectionSupplement.
|
||||
private func makeDigest(sections: [NewsSection]) -> (top: [StorySummary], sections: [(NewsSection, [StorySummary])]) {
|
||||
let unread = filteredStories.filter { !readStoryIds.contains($0.id) }
|
||||
let top = Array(unread.prefix(5))
|
||||
var pool = Array(unread.dropFirst(5))
|
||||
// Fossils (old by firstSeenAt) sink below current stories so the lead
|
||||
// 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 out: [(NewsSection, [StorySummary])] = []
|
||||
for section in sections {
|
||||
@@ -482,7 +490,7 @@ struct SignalFeedView: View {
|
||||
if !story.sources.isEmpty {
|
||||
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))
|
||||
.foregroundStyle(Palette.tertiaryText)
|
||||
}
|
||||
@@ -724,7 +732,7 @@ struct SignalFeedView: View {
|
||||
|
||||
private func cacheStories(_ stories: [StorySummary]) {
|
||||
guard !stories.isEmpty else { return }
|
||||
let container = modelContainer
|
||||
let container = modelContext.container
|
||||
Task.detached {
|
||||
let ctx = ModelContext(container)
|
||||
let existing = (try? ctx.fetch(FetchDescriptor<CachedStory>())) ?? []
|
||||
@@ -769,7 +777,8 @@ extension StorySummary {
|
||||
consensus: cached.consensus,
|
||||
conflict: cached.conflict,
|
||||
updatedAt: cached.updatedAt,
|
||||
createdAt: cached.createdAt
|
||||
createdAt: cached.createdAt,
|
||||
firstSeenAt: cached.firstSeenAt
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,11 @@ struct StoryRowView: View {
|
||||
|
||||
private var metaLine: String {
|
||||
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",
|
||||
summary: "", topic: "finance", tags: ["finance"], signalScore: score, scoreBreakdown: breakdown,
|
||||
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
|
||||
)
|
||||
}
|
||||
@@ -52,7 +52,7 @@ struct NotificationsView: View {
|
||||
|
||||
private var permissionCard: some View {
|
||||
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"))
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
Button {
|
||||
@@ -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
|
||||
// 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 {
|
||||
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)
|
||||
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 {
|
||||
let diff = a.clientRank - b.clientRank
|
||||
// Stable tiebreak for nearly-equal ranks: newer ID wins (IDs are
|
||||
@@ -363,7 +381,7 @@ struct JarvisWordmark: View {
|
||||
var body: some View {
|
||||
HStack(spacing: 0) {
|
||||
Text("j").font(font).foregroundStyle(Palette.orange)
|
||||
Text("arvis").font(font).foregroundStyle(Palette.primaryText)
|
||||
Text("ervis").font(font).foregroundStyle(Palette.primaryText)
|
||||
}
|
||||
}
|
||||
}
|
||||
10
README.md
10
README.md
@@ -1,4 +1,4 @@
|
||||
# Jarvis (iOS)
|
||||
# Jervis (iOS)
|
||||
|
||||
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
|
||||
@@ -18,7 +18,7 @@ reading, and receives live updates over WebSocket.
|
||||
directly.
|
||||
|
||||
```
|
||||
Jarvis/
|
||||
Jervis/
|
||||
Models/ Codable + SwiftData models
|
||||
Networking/ APIClient (REST), WebSocketManager
|
||||
Store/ StoryStore, ServerSettings
|
||||
@@ -37,10 +37,10 @@ Jarvis/
|
||||
|
||||
```bash
|
||||
brew install xcodegen # once
|
||||
xcodegen generate # produces Jarvis.xcodeproj
|
||||
open Jarvis.xcodeproj # ⌘R in Xcode, or:
|
||||
xcodegen generate # produces Jervis.xcodeproj
|
||||
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
|
||||
```
|
||||
|
||||
|
||||
@@ -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
|
||||
tags (sport, uganda, south-africa, …) instead of keyword-guessing. Unblocks #6.
|
||||
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
|
||||
|
||||
|
||||
17
project.yml
17
project.yml
@@ -1,4 +1,4 @@
|
||||
name: Jarvis
|
||||
name: Jervis
|
||||
options:
|
||||
bundleIdPrefix: com.kisani
|
||||
deploymentTarget:
|
||||
@@ -6,21 +6,23 @@ options:
|
||||
createIntermediateGroups: true
|
||||
|
||||
targets:
|
||||
Jarvis:
|
||||
Jervis:
|
||||
type: application
|
||||
platform: iOS
|
||||
deploymentTarget: "17.0"
|
||||
sources:
|
||||
- path: Jarvis
|
||||
- path: Jervis
|
||||
info:
|
||||
path: Jarvis/Info.plist
|
||||
path: Jervis/Info.plist
|
||||
properties:
|
||||
CFBundleDisplayName: Jarvis
|
||||
CFBundleDisplayName: Jervis
|
||||
CFBundleShortVersionString: $(MARKETING_VERSION)
|
||||
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
|
||||
UILaunchScreen:
|
||||
UIColorName: ""
|
||||
UISupportedInterfaceOrientations:
|
||||
- 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:
|
||||
NSAllowsArbitraryLoads: true
|
||||
NSAllowsLocalNetworking: true
|
||||
@@ -37,8 +39,9 @@ targets:
|
||||
settings:
|
||||
base:
|
||||
PRODUCT_BUNDLE_IDENTIFIER: com.kisani.jarvis
|
||||
PRODUCT_NAME: Jervis
|
||||
MARKETING_VERSION: "1.0"
|
||||
CURRENT_PROJECT_VERSION: "1"
|
||||
CURRENT_PROJECT_VERSION: "2"
|
||||
TARGETED_DEVICE_FAMILY: "1"
|
||||
SWIFT_VERSION: "5.0"
|
||||
# Device builds: automatic signing. Change DEVELOPMENT_TEAM to your team
|
||||
|
||||
Reference in New Issue
Block a user