Skip to content

feat(archaeology): ancient relic excavation, survey triangulation, and artifact restoration engine - #205

Open
angelTomo9 wants to merge 2 commits into
Bitcoindefi:mainfrom
angelTomo9:feat-relic-archaeology-1787878876881
Open

feat(archaeology): ancient relic excavation, survey triangulation, and artifact restoration engine#205
angelTomo9 wants to merge 2 commits into
Bitcoindefi:mainfrom
angelTomo9:feat-relic-archaeology-1787878876881

Conversation

@angelTomo9

Copy link
Copy Markdown

Summary

Implements an ancient relic excavation, archaeology survey triangulation, and museum artifact restoration engine for OpenAO MMORPG.

Features

  • Themed dig sites (Desert Tomb, Frozen Glacier, Sunken Atlantis, Volcanic Ruins)
  • Survey triangulation distance cues (Cold, Warm, Hot, Node Found)
  • Archaeological brush mechanics balancing progress vs. fragility pressure thresholds
  • Ancient artifact reconstruction and museum curation exhibition points
  • Full unit test coverage under Vitest

Comment thread api/src/lib/relicExcavationArchaeology.ts
Comment thread api/src/lib/relicExcavationArchaeology.ts
Comment thread api/src/lib/relicExcavationArchaeology.ts Outdated
… state on unearth, and add unique suffix to artifact ID
@gitar-bot

gitar-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 3 resolved / 3 findings

Implements an ancient relic excavation, survey triangulation, and artifact restoration engine with themed dig sites, survey distance cues, archaeological brush mechanics, and museum curation. Fixes progress completion loss on final stroke exceeding fragility, dig site state not updating on unearthing, and millisecond-collision artifact ID generation. No issues remain.

✅ 3 resolved
Edge Case: Progress completion lost when final stroke also exceeds fragility

📄 api/src/lib/relicExcavationArchaeology.ts:108-122
In applyBrushStroke the shatter check runs before the completion check, so a stroke that simultaneously pushes unearthProgressPercent to >=100 and currentPressureAccumulated over the fragilityThreshold will shatter the fragment instead of counting it as successfully unearthed. If reaching 100% progress should win the race, evaluate the completion condition first (or before flagging shatter). Otherwise document that this loss is intentional.

Bug: Unearthing a fragment never updates the dig site state

📄 api/src/lib/relicExcavationArchaeology.ts:65-79 📄 api/src/lib/relicExcavationArchaeology.ts:89-103
startExcavationSession and applyBrushStroke operate only on the session and never touch the ArchaeologyDigSite: totalFragmentsRemaining is never decremented and isFullyExcavated is never set. As a result a site can be excavated indefinitely and surveyTriangulation will keep reporting the node as available. If the engine is intended to own this state, decrement totalFragmentsRemaining on a successful unearth and set isFullyExcavated when it reaches 0; otherwise document that the caller is responsible for it.

Quality: IDs from Date.now() can collide within the same millisecond

📄 api/src/lib/relicExcavationArchaeology.ts:151
restoreArtifact builds artifactId as relic_${theme}_${Date.now()}, so two artifacts of the same theme restored in the same millisecond receive identical IDs. Append a random suffix (as startExcavationSession already does for sessionId) or use a UUID to guarantee uniqueness.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Important

Your trial ends in 5 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

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