Skip to content

fix: carve gates into the two sealed city gardens (#5) - #41

Open
blippip69 wants to merge 1 commit into
Bitcoindefi:mainfrom
blippip69:fix/open-city-gardens
Open

fix: carve gates into the two sealed city gardens (#5)#41
blippip69 wants to merge 1 commit into
Bitcoindefi:mainfrom
blippip69:fix/open-city-gardens

Conversation

@blippip69

Copy link
Copy Markdown
Contributor

fix: carve gates into the two sealed city gardens (#5)

garden() drew a continuous border and never opened an entrance, sealing 4946 walkable cells - 2473 per garden, exactly the compounds the issue measured - behind hedges nobody could cross, while Teo claims to tend them. Following the civicSquare() pattern, each side of both hedges now has a two-cell cobble gate at its midpoint, so the flowerbeds and pond join the main walkable component. A flood-fill test from spawn asserts every interior cell is reachable.
Comment on lines +30 to +44
for (const g of gardens) {
let reachedInside = 0
for (let y = g.y + 1; y < g.y + g.h - 1; y++) {
for (let x = g.x + 1; x < g.x + g.w - 1; x++) {
if (!M.isSolid(city, x, y) && reached.has(x + ',' + y)) reachedInside++
}
}
t.ok(
reachedInside > 1000,
`interior of garden at ${g.x},${g.y} joins the city (${reachedInside} cells reached)`
)
}
})

test('every garden side has a carved gate in the hedge (#5)', (t) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Quality: Connectivity test can't prove all four gates work

The first test only asserts that >1000 interior cells are reachable from spawn. Because a garden interior is one internally-connected region, this passes as soon as any single gate connects outward, so a gate that was mis-placed or opened onto a solid obstacle would go undetected — defeating the PR's stated goal of four open approaches. The second test checks gate cells are non-solid but never checks the cell just outside each gate is walkable. Consider asserting, per side, that both the gate cell and its immediate exterior neighbor are non-solid (e.g. for the north gate also check (cxg,y-1)), so each of the four approaches is independently verified.

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Carves gates into the two sealed city gardens to improve accessibility. Consider expanding the connectivity test to explicitly verify all four gates rather than just interior cell reachability.

💡 Quality: Connectivity test can't prove all four gates work

📄 test/open-city-gardens.test.js:30-44

The first test only asserts that >1000 interior cells are reachable from spawn. Because a garden interior is one internally-connected region, this passes as soon as any single gate connects outward, so a gate that was mis-placed or opened onto a solid obstacle would go undetected — defeating the PR's stated goal of four open approaches. The second test checks gate cells are non-solid but never checks the cell just outside each gate is walkable. Consider asserting, per side, that both the gate cell and its immediate exterior neighbor are non-solid (e.g. for the north gate also check (cxg,y-1)), so each of the four approaches is independently verified.

🤖 Prompt for agents
Code Review: Carves gates into the two sealed city gardens to improve accessibility. Consider expanding the connectivity test to explicitly verify all four gates rather than just interior cell reachability.

1. 💡 Quality: Connectivity test can't prove all four gates work
   Files: test/open-city-gardens.test.js:30-44

   The first test only asserts that >1000 interior cells are reachable from spawn. Because a garden interior is one internally-connected region, this passes as soon as *any single* gate connects outward, so a gate that was mis-placed or opened onto a solid obstacle would go undetected — defeating the PR's stated goal of four open approaches. The second test checks gate cells are non-solid but never checks the cell just outside each gate is walkable. Consider asserting, per side, that both the gate cell and its immediate exterior neighbor are non-solid (e.g. for the north gate also check (cxg,y-1)), so each of the four approaches is independently verified.

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 7 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.

Was this helpful? React with 👍 / 👎 | Gitar

@leocagli

Copy link
Copy Markdown
Collaborator

Merged onto current main, the tests pass. npm run lint does not:

Checking formatting...
[warn] <the new test file>
[warn] Code style issues found in the above file. Run Prettier with --write to fix.

The repository runs prettier . --check as part of npm run lint, and CI runs
lint as its own job, so this alone turns the build red.

npm run format fixes it in one pass. Nothing else needs to change; the code itself
is fine.

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.

3 participants