@adam0white/human-framework 2.21.0 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/person.d.ts +6 -2
- package/dist/person.js +8 -4
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -222,7 +222,7 @@ reference host: `createVillage`.
|
|
|
222
222
|
|
|
223
223
|
There are two version numbers, and they move independently.
|
|
224
224
|
|
|
225
|
-
- **The release version** is the package version (`package.json`, currently `2.
|
|
225
|
+
- **The release version** is the package version (`package.json`, currently `2.22.0`) and `FRAMEWORK_VERSION`, the same
|
|
226
226
|
string compiled into the build; a test keeps them equal. It versions the public API under
|
|
227
227
|
[semver](https://semver.org/): a breaking change to an exported name or signature bumps the major, a new
|
|
228
228
|
faculty or export the minor, a fix the patch. Each release is a tag `vX.Y.Z` and a GitHub release whose notes
|
|
@@ -236,7 +236,11 @@ There are two version numbers, and they move independently.
|
|
|
236
236
|
The root `package.json` version is the site's version (stamped into the site's `release.json`) and is not part of
|
|
237
237
|
this policy.
|
|
238
238
|
|
|
239
|
-
##
|
|
239
|
+
## Observation and inherited aptitude
|
|
240
|
+
|
|
241
|
+
`observeSkill(p, skill, minutes, modelLevel, domain, { inheritedAptitude: true })` applies the person's existing inherited skill factor to observation. An attended `Percept.demonstrates` can declare the same flag. Only literal `true` enables it. Without it, watching keeps its previous rate, including for people whose saved family already has aptitudes. This adds no Person state or RNG draw and does not change direct practice. Save the host's observation inputs and pin the package when opting in.
|
|
242
|
+
|
|
243
|
+
## Optional felt body (2.21 release)
|
|
240
244
|
|
|
241
245
|
`PersonSpec.enable.doze` accepts `{ posture: 'upright' | 'seated' | 'reclined', stimulation: number }`; `enableDoze` and `setDozeContext` are the explicit host calls. Doze onset is checked at integer-minute boundaries while awake. `readDoze` reports the current hazard; `nextDozeCheck` tells a manual host when to tick next. The opt-in costs one check per elapsed minute, including when onset gates are closed. It changes integration granularity, so enabled runs require a new replay pin. A dozed activity records `dozedAt`; the host resolves interrupted work. Doze does not wake spontaneously. `perceive` wakes only for a percept delivered at `p.now`, with `salience >= 0.8`, a heard/felt/social channel, detectable proximity (`near !== false`) and either `targetId === p.id` or `near === true`. The host must supply those alarms. These hazard and salience values are engineering constants.
|
|
242
246
|
|
|
@@ -244,7 +248,7 @@ this policy.
|
|
|
244
248
|
|
|
245
249
|
`PersonSpec.enable.bladder` or `enableBladder(p)` starts a normalized fill store. `readBladder` returns true and perceived urgency, equal in this first slice. Water intake adds delayed fill and a small base rate fills it over time. A host marks a toilet `Affordance` with `voidsBladder: true` to add urgency-based choice value. Actual successful urination is separate: a completed `Outcome` with `voidedBladder: true` empties it; `voidBladder(p)` is the direct host operation. An interrupted or failed outcome does not empty it. For an offer that declares voiding, expectation learning treats completion without actual voiding as failure of that purpose. Do not use `needs.relief` as a substitute: that field reduces pain. Filling rates, threshold and choice weight are engineering constants. The model has no continence, automatic toilet search or automatic waking.
|
|
246
250
|
|
|
247
|
-
With none of these options enabled or calls made, person state and seeded RNG continuation match HF 2.20.0 after normalizing the engine stamp only. HF 2.21.0
|
|
251
|
+
With none of these options enabled or calls made, person state and seeded RNG continuation match HF 2.20.0 after normalizing the engine stamp only. The bodily options were introduced in HF 2.21.0. Site games pin their adopted package separately from the current library; upgrading the library does not enable these faculties or silently change game runtime.
|
|
248
252
|
|
|
249
253
|
## Long runs (2.0)
|
|
250
254
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Human Framework public surface. */
|
|
2
|
-
export declare const FRAMEWORK_VERSION = "2.
|
|
2
|
+
export declare const FRAMEWORK_VERSION = "2.22.0";
|
|
3
3
|
export type { CrisisEvent, PracticeKind } from './affect/index.ts';
|
|
4
4
|
export { AFFECT_DEFAULTS, actionTendencies, advanceAffect, appraise, breakAllows, breakBehaviour, breakHazard, CRISIS_DEFAULTS, checkCrisis, createAffect, easeBreak, emotionLevel, enableBreaks, feel, inBreak, readAffect, regulate, release as releaseEmotion, skipCrisis, strain, tendencyEmotions, } from './affect/index.ts';
|
|
5
5
|
export type { GoalTemplate, MakeUpReceipt, PrayerCalendar, PrayerSchedule, PrayerTimes, Retimer, } from './agenda/index.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Human Framework public surface. */
|
|
2
|
-
export const FRAMEWORK_VERSION = '2.
|
|
2
|
+
export const FRAMEWORK_VERSION = '2.22.0';
|
|
3
3
|
export { AFFECT_DEFAULTS, actionTendencies, advanceAffect, appraise, breakAllows, breakBehaviour, breakHazard, CRISIS_DEFAULTS, checkCrisis, createAffect, easeBreak, emotionLevel, enableBreaks, feel, inBreak, readAffect, regulate, release as releaseEmotion, skipCrisis, strain, tendencyEmotions, } from './affect/index.js';
|
|
4
4
|
// `agenda.release` collides with `affect.release`; the agenda one is re-exported under a clearer name.
|
|
5
5
|
export { AGENDA_DEFAULTS, abandonGoal, adoptGoal, advanceAgenda, agendaTerms, applyExemptions, CARE_DEFAULTS, calendarRetimer, careDuty, commitmentPressure, createAgenda, DEFAULT_PRAYER_TIMES, EID_PRAYER_IMPORTANCE, EXEMPTION_DEFAULTS, eidPrayer, eidWindow, fastWindow, iftarWindow, inMakruhTime, isContinuingCommitment, isUnderWay, MAKRUH_DEFAULTS, makruhWindows, missedExcuse, onFinished, owedMakeUps, PRAYER_IMPORTANCE, PURPOSE_DEFAULTS, prayerWindows, pressureReachedAt, promise, proposeGoals, RAMADAN_DEFAULTS, ramadanFast, ramadanMeals, release as releaseCommitment, retimeCommitments, retirePaidMakeUps, revisePurposes, scheduleMakeUp, spanMeetsWindow, suhoorWindow, timesFor, violatesAbstention, } from './agenda/index.js';
|
package/dist/person.d.ts
CHANGED
|
@@ -229,9 +229,13 @@ export declare function learningFor(p: Person, domain?: LearningDomain): number;
|
|
|
229
229
|
/**
|
|
230
230
|
* Watch someone practise skill `skill` at `modelLevel` for `minutes` (observational learning, 1.8.0): the
|
|
231
231
|
* composite's side of `skills.learnByWatching` at the person's age-and-domain learning rate. A `Percept.demonstrates` on an
|
|
232
|
-
* attended percept does the same.
|
|
232
|
+
* attended percept does the same. `inheritedAptitude: true` applies the family's existing aptitude factor to
|
|
233
|
+
* watching. Absent or false keeps earlier observation learning, including for a person with an authored family.
|
|
234
|
+
* This changes no practice rule, draws no RNG, and stores no new state. Returns the level before and after.
|
|
233
235
|
*/
|
|
234
|
-
export declare function observeSkill(p: Person, skill: string, minutes: number, modelLevel: Unit, domain?: LearningDomain
|
|
236
|
+
export declare function observeSkill(p: Person, skill: string, minutes: number, modelLevel: Unit, domain?: LearningDomain, options?: {
|
|
237
|
+
inheritedAptitude?: boolean;
|
|
238
|
+
}): {
|
|
235
239
|
before: Unit;
|
|
236
240
|
after: Unit;
|
|
237
241
|
};
|
package/dist/person.js
CHANGED
|
@@ -748,7 +748,8 @@ function perceiveOne(p, pc, options) {
|
|
|
748
748
|
// Watching someone skilled at work teaches a little (1.8.0, observational learning).
|
|
749
749
|
const demo = pc.demonstrates;
|
|
750
750
|
if (demo && !byMe && demo.minutes > 0) {
|
|
751
|
-
|
|
751
|
+
const learning = learningFor(p, demo.domain);
|
|
752
|
+
learnByWatching(p, demo.skill, demo.minutes, demo.level, demo.inheritedAptitude === true ? learning * aptitudeOf(p, demo.skill) : learning, p.now);
|
|
752
753
|
}
|
|
753
754
|
// Relationships: interactions I took part in.
|
|
754
755
|
const social = socialKindOf(pc.kind);
|
|
@@ -1346,10 +1347,13 @@ export function learningFor(p, domain) {
|
|
|
1346
1347
|
/**
|
|
1347
1348
|
* Watch someone practise skill `skill` at `modelLevel` for `minutes` (observational learning, 1.8.0): the
|
|
1348
1349
|
* composite's side of `skills.learnByWatching` at the person's age-and-domain learning rate. A `Percept.demonstrates` on an
|
|
1349
|
-
* attended percept does the same.
|
|
1350
|
+
* attended percept does the same. `inheritedAptitude: true` applies the family's existing aptitude factor to
|
|
1351
|
+
* watching. Absent or false keeps earlier observation learning, including for a person with an authored family.
|
|
1352
|
+
* This changes no practice rule, draws no RNG, and stores no new state. Returns the level before and after.
|
|
1350
1353
|
*/
|
|
1351
|
-
export function observeSkill(p, skill, minutes, modelLevel, domain) {
|
|
1352
|
-
|
|
1354
|
+
export function observeSkill(p, skill, minutes, modelLevel, domain, options) {
|
|
1355
|
+
const learning = learningFor(p, domain);
|
|
1356
|
+
return learnByWatching(p, skill, minutes, modelLevel, options?.inheritedAptitude === true ? learning * aptitudeOf(p, skill) : learning, p.now);
|
|
1353
1357
|
}
|
|
1354
1358
|
/** Realized need changes, using readings captured before and after the outcome's deltas. */
|
|
1355
1359
|
function realizedNeedDeltas(act, given, before, after) {
|
package/dist/types.d.ts
CHANGED
|
@@ -1301,6 +1301,8 @@ export interface Percept {
|
|
|
1301
1301
|
level: Unit;
|
|
1302
1302
|
minutes: number;
|
|
1303
1303
|
domain?: LearningDomain;
|
|
1304
|
+
/** Apply the watcher's inherited skill aptitude. Absent keeps earlier observation learning exactly. */
|
|
1305
|
+
inheritedAptitude?: boolean;
|
|
1304
1306
|
};
|
|
1305
1307
|
/** At most four additions/withdrawals combined; attended external testimony to this person or a broadcast. */
|
|
1306
1308
|
consequences?: readonly ReceivedConsequence[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adam0white/human-framework",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.22.0",
|
|
4
4
|
"description": "Deterministic, explainable simulated people: body, needs, affect, memory, beliefs, skills, habits, relationships, values and a will that can refuse a suggestion",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"simulation",
|