Skip to content

Update and rename INSTALL to INSTALL.md#4

Open
lorenzogrv wants to merge 1 commit into
smaugmuds:masterfrom
lorenzogrv:patch-1
Open

Update and rename INSTALL to INSTALL.md#4
lorenzogrv wants to merge 1 commit into
smaugmuds:masterfrom
lorenzogrv:patch-1

Conversation

@lorenzogrv

Copy link
Copy Markdown
Contributor

Molaba mas leelo en MD capullín

eilidhmae added a commit to eilidhmae/smaug that referenced this pull request Apr 26, 2026
Extends medit Wave 2 (c9bf798) from main-menu dispatch to functional
field editors. After this wave a builder can enter the medit menu and
edit any simple field, stat, or flag bitmask end-to-end.

- G7: 25 simple-field arms in new medit_arms.go (NAME/S_DESC/L_DESC/
  D_DESC/HITROLL/DAMROLL/AC/GOLD/LEVEL/ALIGNMENT/FAVOR/HITPOINT/MANA/
  MOVE/PRACTICE/SILVER/COPPER/MENTALSTATE/EMOTIONAL/THIRST/FULL/DRUNK/
  POS/DEFAULT_POS/SEX/DAMNUMDIE/DAMSIZEDIE/DAMPLUS/HITNUMDIE/HITSIZEDIE/
  HITPLUS/ATTACK/DEFENSE/SPEC/CLAN/DEITY/COUNCIL) with NPC-only / PC-only
  enforcement matching C and C-parity URange clamps. D_DESC uses the
  EditorSave callback (Tier-12 trampoline). util.SmashTilde applied to
  all string-field inputs.
- G8: 7 stat editors via shared meditArmStat helper. NPC uRange(1,25),
  PC uRange(3,18) per C omedit.c:998-1007. Mirrors *field to
  MobIndexData.Perm{Str,Int,Wis,Dex,Con,Cha,Lck} on NPC+ACT_PROTOTYPE.
- G9: shared olcBitmaskEdit helper (int + BitVector variants) in new
  olc_bitmask.go. Exit semantics done/quit/empty/0; numeric input
  1-based-decremented per C; keyword input case-insensitive exact-match.
  5 new flag-name tables in util/flags.go (Act/Plr/Aff/Pcflag/Part —
  bit-for-bit C build.c:216-265 parity including reserved r1..r10
  slots). 8 medit flag-arm wires consume the helper. All 6 Wave-2
  flag-submenu renderers back-wired to render via real name tables.
- G14 partial: oedit OEDIT_AFFECT_MODIFIER back-wired to consume
  olcBitmaskEdit for APPLY_AFFECT/RESISTANT/IMMUNE/SUSCEPTIBLE; scalar
  APPLY_* path retained.

Adversary CONCERNS folded into the same commit (HIGH×2, MEDIUM×1, LOW×3):
- HIGH #1 stat prototype mirror initially omitted with false-premise
  comment claiming MobIndexData.PermStr fields missing — they exist at
  mob_index.go:67-73. Mirror added.
- HIGH #2 ACT_IS_NPC keyword-form bypass — protectedToggleRejected
  only intercepted numeric input; "npc" keyword reached the helper and
  toggled bit 0. Closed via snapshot/restore + verbatim C string.
- MEDIUM smaugmuds#3 ACT_PROTOTYPE keyword bypass — same snapshot/restore
  pattern under LEVEL_GREATER trust gate.
- LOW smaugmuds#4 spurious mirror on `done` — moved inside `if !done` branch.
- LOW #5 flag tables didn't match C bit-for-bit — added trailing
  reserved slots (AffflagNames 44->47, PcflagNames 33->43).
- LOW #6 MEDIT_SEX rejection-on-OOB switched to C-parity URANGE clamp.

~58 new tests + 16 mutation gates verified via Edit round-trips
(no banned git commands).

Full green: go build, go vet, gofmt, go test -count=3 ./... (all 15
packages), GOOS=windows go build ./...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
eilidhmae added a commit to eilidhmae/smaug that referenced this pull request Apr 26, 2026
Final wave of the 5-wave medit plan. Builders can now telnet in, type
medit <vnum>, navigate the interactive menu, edit any simple field /
stat / flag / affect / save / class / race / password, and quit with
the save-confirm flow — all dual-writing through victim.IndexData.

Commit trail: Wave 1 d4c6112 → Wave 2 c9bf798 → Wave 3 3e5ac5e →
Wave 4 7303ca4 → Wave 5 (this commit). 34 of 35 acceptance criteria
covered (A31 deferred — worldPcLookup seam missing).

- G14: DoMedit no-arg branch enters CON_MEDIT mode (mirrors oedit
  Wave-4 pattern from 6aebcc2). Old plain-text summary rebound under
  `medit <vnum> show`. Per-descriptor double-edit guard.

- Architectural decision — bare CharData allocation NOT
  handler.CreateMobile. Initial implementation used CreateMobile to
  wrap the prototype; adversary review caught a HIGH-severity world-
  state leak: CreateMobile bumps idx.Count and appends to
  WorldRef.Characters but cleanupOlc only resets descriptor state, so
  every medit <vnum> permanently leaked one phantom mob. This broke
  area resets that gate on idx.Count >= reset.Arg2 — silently
  stopping respawns after enough medit entries. Fix: bare
  &types.CharData{...} copying only render-needed fields plus
  ACT_IS_NPC|ACT_PROTOTYPE so dual-write arms continue mirroring to
  victim.IndexData. C `do_omedit` operates on a live mob via
  get_char_world; the wrapper-around-prototype is a deliberate Go
  divergence, now world-state-pure.

- G15: 3 testclient E2E scenarios — menu entry+Q exit, NAME field
  round-trip via ACT_PROTOTYPE mirror, invalid `~` digit redisplay.
  Boot wire (Wave 2) verified still present.

- 3 Wave-4 cleanups: TestMeditAffect_AddBitmaskPath_AffectFlag fixed
  hardcoded "27" (APPLY_AFFECT=26); SmashTilde no-op removed in
  meditArmPassword; intInput helper now wraps strconv.Itoa.

- Plan §Completion Record appended documenting 5-wave commit trail,
  9 plan-vs-C divergences, ~249 new tests / 47 mutation gates across
  all 5 waves. phases.md row flipped to LANDED 2026-04-22; mpedit
  moves to UNBLOCKED.

Adversary findings folded in same commit:
- HIGH #1 wrapper leak — fixed via bare allocation; pinned by 3
  invariant tests (idx.Count, len(Characters), 5-cycle replay).
- MEDIUM #2 plan completion-record claim corrected (35→34 of 35).
- LOW smaugmuds#3 G15 scenario substitution documented.
- LOW smaugmuds#4 redundant inner Atoi in DoMedit removed.

6 mutation gates verified via Edit round-trips (no banned git
commands): cleanup-#1 APPLY_AFFECT off-by-one, G14 entry-mode
Connected drop, G14 double-edit guard removal, G15 testclient via
Connected mutation, HIGH#1 CreateMobile re-introduction, LOW#4
vnum<=0 message swap.

Full green: go build, go vet, gofmt (touched files), go test -count=3
./... (all 15 packages), GOOS=windows go build ./...

mpedit unblocked — next medit-adjacent work is plan-phase6-olc-mpedit.md
(interactive mob-prog editor; hard-blocked on medit landing per
phase6-roadmap.md, now ready to author).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant