Q&A — Phase 29.1 SelfModel #633
Unanswered
web3guru888
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Q&A — Phase 29.1 SelfModel
Post your questions about the SelfModel component here. Below are answers to the most common questions from the planning discussion.
Q1: Why exactly five domains? Isn't this taxonomy arbitrary?
A: The five-domain taxonomy (
ARCHITECTURE,RESOURCE,COMPETENCE,HISTORY,SOCIAL) maps directly to Neisser's (1988) five kinds of self-knowledge from cognitive psychology: ecological, private, conceptual, extended, and interpersonal. While any taxonomy involves design choices, this one has three advantages: (1) it aligns with established cognitive science, (2) the domains are roughly orthogonal — knowing your module topology tells you nothing about your social trust scores, and (3) each domain has a distinct staleness profile, enabling per-domain refresh rates. That said, the enum is extensible — adding a sixth domain (e.g.,EMOTIONALfrom Phase 21's EmotionModel) requires only adding the enum variant and a corresponding_refresh_domainbranch.Q2: How is the auto-refresh interval tuned per domain?
A: Each domain has a
staleness_threshold_sinSelfModelConfig:RESOURCECOMPETENCEARCHITECTUREHISTORYSOCIALThese are configurable at runtime. The
_refresh_loopcheckstime.monotonic() - last_refresh[domain] > thresholdon each cycle, so the actual refresh rate ismax(loop_interval, threshold). In practice, the loop runs every 2 seconds, soRESOURCErefreshes every ~6s (next cycle after staleness), whileSOCIALrefreshes every ~300s.Q3: How does competence assessment actually work?
A: The
CapabilityAssessorcomputes competence scores using a weighted exponential moving average (EMA) over recent task outcomes:Where
outcome ∈ [0.0, 1.0]is task success (binary or graded), andα = 0.1by default (tunable). The EMA naturally decays old performance, so a system that was once good at reasoning but has degraded will see its score drop. TheCompetenceProfilealso stores adeque(maxlen=100)of raw outcomes for trend analysis — the MetaCognitiveMonitor (29.3) can detect if scores are systematically declining.Q4: What happens when the ResourceInventory becomes stale?
A: Staleness is handled through a two-tier strategy:
stale=Trueflag. Consumers can decide whether to trust it — the ExecutiveController (28.4) may widen its planning margins when working with stale resource data.asi_self_model_staleness_alerts_totalcounter increments, a warning is logged, and a forced refresh is attempted. If that also fails, the system falls back to conservative defaults (e.g., assume only 50% of nominal resource budgets).This mirrors interoception in biological systems — when you can't tell how tired you are, you assume you're more tired than you probably are.
Q5: How does ArchitectureNode health scoring work?
A: Each
ArchitectureNode(representing a loaded module/component) has ahealth_score: floatcomputed from four signals:The final score is
Σ(weight_i * signal_i)clipped to[0.0, 1.0]. Scores below 0.5 trigger architectural alerts; scores below 0.2 mark the node asDEGRADEDin the architecture map.Q6: What's the testing strategy — mocks or real subsystems?
A: Both, at different levels:
NullSelfModel(no-op implementation) to test consumers that depend onSelfModelProtocol. Useunittest.mock.AsyncMockto testDynamicSelfModelwith mocked data sources.DynamicSelfModelto a realWorldModel(Phase 13.1) andPerformanceProfiler(Phase 16.1) in a test harness. Verify that staleness thresholds trigger refreshes and that snapshot data flows correctly.SelfModelDomainsequences and verify that the snapshot is always consistent (no partial updates visible to consumers).Key test targets from the issue spec:
test_snapshot_frozen_immutable,test_stale_domain_triggers_refresh,test_competence_ema_convergence,test_architecture_health_recursive.Q7: How does SelfModel integrate with WorldModel (Phase 13.1)?
A: The relationship is complementary but distinct:
They share the same
update()pattern (periodic refresh with staleness tracking) but operate on different data sources. The SelfModel subscribes to WorldModel events to understand its own position within the world — e.g., "I am node 3 of 5 in a federated deployment, and peer latencies are rising." The WorldModel does not know about the SelfModel; the dependency is one-directional.In code:
Ask your questions below! Tag the issue (#627) for implementation-specific queries.
Beta Was this translation helpful? Give feedback.
All reactions