import { describe, expect, it } from 'vitest'

import { publicBoundaryText } from '../public-security-redaction'

describe('publicBoundaryText controlled automation wording', () => {
  it('renders runtime false as controlled automation boundary evidence', () => {
    const text = publicBoundaryText('runtime_execution_authorized=false')

    expect(text).toContain('AI controlled apply')
    expect(text).toContain('critical / break-glass')
    expect(text).not.toContain('執行期操作未授權')
  })

  it('keeps action button false from becoming a manual stop state', () => {
    const text = publicBoundaryText('action_buttons_allowed=false')

    expect(text).toContain('AI controlled work item')
    expect(text).toContain('check-mode')
    expect(text).toContain('verifier')
  })

  it('treats owner response zero as evidence instead of an apply blocker', () => {
    const text = publicBoundaryText('owner_response_accepted_count=0')

    expect(text).toContain('evidence')
    expect(text).toContain('不阻擋 controlled apply')
  })
})
