CI / lint (push) Successful in 3s
CI / extension-version (push) Successful in 3s
Build images / sign-extension (push) Successful in 4s
Build images / build-agent (push) Successful in 7s
CI / frontend-build (push) Successful in 21s
CI / backend-lint-and-test (push) Failing after 32s
Build images / build-web (push) Successful in 58s
Build images / smoke-web (push) Skipped
Build images / build-ml (push) Successful in 1m47s
Build images / promote (push) Skipped
CI / integration (push) Successful in 2m16s
A3 made a tier-gated source say "47 posts you can't see". The roster turns that into a reason: the membership ended, or the tier doesn't reach these posts, or it's a free follow. Rendered under A3's count in the health tooltip, quieter than the count it explains. FREE is a fourth case the step didn't enumerate, and it earns its own sentence. has_paid_access collapses "former patron" and "current free follower" to the same False, so deriving the reason from that boolean would tell a free follower "you're not a patron any more" - a false statement about a state they were never in. gated_reason reads the status axis first, calling has_paid_access with is_free_member forced off, then splits on the free flag. Silence is the default, and there are four ways into it: campaign absent from the roster, roster stale, platform never swept, status word not yet characterised. All four send null and the count stands alone. The frontend has no fallback sentence either - a default would turn "we don't know why" into a reason, which is the one thing this step must not do. The line that must not be crossed is pinned structurally rather than by inspection: test_no_fetch_path_can_read_the_roster walks the transitive first-party imports from the fetch roots and asserts the roster is unreachable. FC runs no local verification (rule 85), so a guard cannot be falsified by hand before it lands - it carries two positive controls instead, proving the walker finds roster imports that ARE there, one direct and one through a hop, so the real assertion can never pass merely because the walk resolved nothing. C4's identity loop moved to membership_roster.pair_sources_with_memberships when C5 became its second caller; two copies would let the Subscriptions row and the reconciliation card disagree about which creator a source IS. Three test files were each building PlatformMembership rows with their own drifting helper - consolidated into tests/roster_builders.py, same family as issue 3109. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SHQB1YukL3VyvMK8rcbmV9
124 lines
4.4 KiB
Vue
124 lines
4.4 KiB
Vue
<template>
|
|
<v-tooltip location="top" open-delay="200">
|
|
<template #activator="{ props: tipProps }">
|
|
<span
|
|
v-bind="tipProps"
|
|
:class="['fc-health-dot', `fc-health-dot--${level}`]"
|
|
:aria-label="ariaLabel"
|
|
/>
|
|
</template>
|
|
<div class="fc-health-tip">
|
|
<div>Last checked: {{ lastCheckedText }}</div>
|
|
<div v-if="nextCheckText">Next check: {{ nextCheckText }}</div>
|
|
<div v-if="noAccess" class="fc-health-tip__gated">{{ noAccessText }}</div>
|
|
<div v-if="noAccess && noAccessReason" class="fc-health-tip__why">
|
|
{{ noAccessReason }}
|
|
</div>
|
|
<div v-if="(source.consecutive_failures || 0) > 0">
|
|
Failures: {{ source.consecutive_failures }}
|
|
</div>
|
|
<div v-if="source.last_error" class="fc-health-tip__err">
|
|
{{ truncatedError }}
|
|
</div>
|
|
</div>
|
|
</v-tooltip>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { computed } from 'vue'
|
|
import { formatRelative } from '../../utils/date.js'
|
|
|
|
const props = defineProps({
|
|
source: { type: Object, required: true },
|
|
warningThreshold: { type: Number, default: 5 },
|
|
})
|
|
|
|
const noAccess = computed(() => props.source.error_type === 'tier_limited')
|
|
|
|
const level = computed(() => {
|
|
if (!props.source.last_checked_at) return 'unchecked'
|
|
const f = props.source.consecutive_failures || 0
|
|
// No-access outranks 'healthy' but is NOT a failure grade: the walk worked,
|
|
// the content simply isn't ours. Checked after failures so a source that is
|
|
// genuinely erroring still reads as erroring.
|
|
if (f === 0) return noAccess.value ? 'no-access' : 'healthy'
|
|
if (f < props.warningThreshold) return 'warning'
|
|
return 'critical'
|
|
})
|
|
|
|
// The count comes from the last walk's run_stats and is only joined in by the
|
|
// list endpoint, so it can legitimately be absent — say the state without it
|
|
// rather than printing a fabricated zero.
|
|
const noAccessText = computed(() => {
|
|
const n = props.source.tier_gated_count
|
|
return n
|
|
? `${n} post${n === 1 ? '' : 's'} you don't have access to`
|
|
: "Some posts are behind a tier you don't hold"
|
|
})
|
|
|
|
// #387 C5: the learned roster's explanation for the line above, when it has
|
|
// one. The backend sends null for every case where the roster is not evidence —
|
|
// campaign absent, roster stale, never swept, status not yet characterised — so
|
|
// there is deliberately NO fallback sentence here. A default would turn "we
|
|
// don't know why" into a reason, which is the one thing this step must not do.
|
|
const GATED_REASONS = {
|
|
lapsed: "You're not a patron any more — resubscribe, or disable this source.",
|
|
tier: "Your tier doesn't cover these posts — upgrade, or leave them be.",
|
|
free: "You follow this creator for free — these posts are for paying patrons.",
|
|
}
|
|
|
|
const noAccessReason = computed(() => GATED_REASONS[props.source.gated_reason] || null)
|
|
|
|
const ariaLabel = computed(() => `source health: ${level.value}`)
|
|
|
|
const lastCheckedText = computed(() => formatRelative(props.source.last_checked_at))
|
|
|
|
const nextCheckText = computed(() =>
|
|
props.source.next_check_at
|
|
? formatRelative(props.source.next_check_at, { future: true })
|
|
: null,
|
|
)
|
|
|
|
const truncatedError = computed(() => {
|
|
const e = props.source.last_error || ''
|
|
return e.length > 120 ? e.slice(0, 117) + '…' : e
|
|
})
|
|
</script>
|
|
|
|
<style scoped>
|
|
.fc-health-dot {
|
|
display: inline-block;
|
|
width: 10px;
|
|
height: 10px;
|
|
border-radius: 50%;
|
|
flex-shrink: 0;
|
|
}
|
|
.fc-health-dot--unchecked { background-color: rgb(var(--v-theme-on-surface-variant)); opacity: 0.5; }
|
|
.fc-health-dot--healthy { background-color: rgb(var(--v-theme-success, 76 175 80)); }
|
|
/* Matches the 'info' severity FailingSourcesCard already assigns tier_limited —
|
|
deliberately not a warning/error hue: nothing is broken. */
|
|
.fc-health-dot--no-access { background-color: rgb(var(--v-theme-info, 33 150 243)); }
|
|
.fc-health-dot--warning { background-color: rgb(var(--v-theme-warning, 255 167 38)); }
|
|
.fc-health-dot--critical { background-color: rgb(var(--v-theme-error, 244 67 54)); }
|
|
|
|
.fc-health-tip {
|
|
font-size: 0.85rem;
|
|
line-height: 1.4;
|
|
}
|
|
.fc-health-tip__gated {
|
|
color: rgb(var(--v-theme-info, 33 150 243));
|
|
}
|
|
/* The reason is subordinate to the count it explains: same block, quieter, so
|
|
a tooltip that has one does not read as two separate findings. */
|
|
.fc-health-tip__why {
|
|
color: rgb(var(--v-theme-on-surface-variant));
|
|
max-width: 24rem;
|
|
}
|
|
.fc-health-tip__err {
|
|
margin-top: 0.25rem;
|
|
color: rgb(var(--v-theme-error, 244 67 54));
|
|
white-space: pre-wrap;
|
|
max-width: 32rem;
|
|
}
|
|
</style>
|