Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix secret_mafia bug - #155

Open
MozerWang wants to merge 1 commit into
TextArena:mainfrom
MozerWang:main
Open

Fix secret_mafia bug#155
MozerWang wants to merge 1 commit into
TextArena:mainfrom
MozerWang:main

Conversation

@MozerWang

Copy link
Copy Markdown
  1. modify prompt to improve clearity: add detailed mafia rules at the beginning; add instuction format on discussion and vote;
  2. fix the action to observation bug: observation might be empty
  3. fix winning bug: len(mafia_alive) >= len(villagers_alive)

1.modify prompt to improve clearity: add mafia rule to the beginning;
2.fix the action to observation bug
3.fix winning bug
@borgr

borgr commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this @MozerWang — the prompt-clarity and observation-formatting ideas here are good and worth landing. Since the branch has been idle for a while, I've picked the work up in #199, which builds on your changes with a couple of adjustments:

  • Observation formatting (your "observation might be empty" fix) is adopted — actions are broadcast as readable messages instead of raw strings.
  • Prompt clarity is adopted, factored into a single shared-rules helper so the four role prompts don't drift.
  • Discussion parsing: your version used re.search, which captures only the first quoted segment, so "A." ... "B." would drop "B.". SecretMafia: clearer prompts, readable action broadcasts, quote-scoped discussion #199 uses re.findall + rejoin so multi-sentence speech survives, with a fallback to the full message when no quotes are present.
  • Win condition: heads up that len(mafia) >= len(villagers) is algebraically identical to the existing len(mafia) >= len(alive)/2 (since alive = mafia + villagers), so it's a readability rewrite rather than a bug fix — there was no win-condition bug. SecretMafia: clearer prompts, readable action broadcasts, quote-scoped discussion #199 keeps your clearer form but notes this.

#199 verifies the game end-to-end deterministically (both win branches, quote-stripping, 12 seeded full episodes). Recommend closing this in favour of #199 once maintainers have had a look — happy to fold in any feedback.

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.

2 participants