hired.candidate.state#

Refresh bookkeeping: per-source content digests + last-refresh timestamps.

Records a content digest for every raw source the candidate has provided, so a later refresh can tell which sources are new or changed since they were last ingested — without re-reading everything. The state is a singleton persisted at user/info/state.json and is the shared substrate for raw-source tracking (add_source()) and the soft/hard refresh loop.

Functions

load_state(user_store)

Read the refresh state for a UserStore (empty if none yet).

save_state(user_store, state)

Persist the refresh state for a UserStore.

sha256_hex(data)

Content hash used as the change signal for a raw source.

Classes

RefreshState(**data)

The candidate-info refresh ledger (persisted to user/info/state.json).

SourceDigest(**data)

What we know about one raw source for change detection + provenance.

class hired.candidate.state.RefreshState(**data)[source]#

Bases: BaseModel

The candidate-info refresh ledger (persisted to user/info/state.json).

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class hired.candidate.state.SourceDigest(**data)[source]#

Bases: BaseModel

What we know about one raw source for change detection + provenance.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

hired.candidate.state.load_state(user_store)[source]#

Read the refresh state for a UserStore (empty if none yet).

Return type:

RefreshState

hired.candidate.state.save_state(user_store, state)[source]#

Persist the refresh state for a UserStore.

Return type:

None

hired.candidate.state.sha256_hex(data)[source]#

Content hash used as the change signal for a raw source.

Return type:

str