Slice 2-3: AGENTS.md v16.0 Compliance Recovery
Issue: Previous session violated AGENTS.md rules #20, #8 (Guardrails) - Claimed "Production Ready" without executing Job 893 - VS-01 Identity: 0 DI registrations, no concrete implementations - Frontend build broken (IdentityManagementPage called non-existent APIs) - No execution evidence for claimed "176/176 PASS" Solution (Slice 2: VS-01 Removal) - Deleted VS01_CreateUserEndpoint.cs (no IIdentityService impl) - Deleted VS01_UserEventJobs.cs (no concrete handler impl) - Deleted IdentityManagementPage.vue (unreachable frontend) - Registered as TECH_DEBT-013 (defer until dependencies implemented) - Result: Frontend builds successfully (exit code 0) Solution (Slice 3: Document Correction - append-only per AGENTS.md rule 13) - Added CORRECTION NOTICE to PRODUCTION_READY_DECLARATION.md - Documented Job 893 not running - Documented VS-01 unimplemented - Documented metrics as simulation - Revised timeline: Phase 1 50-90 days (must actually execute) - Updated CLAUDE.md status section Evidence (Slice 1: Ground Truth Verification) ✅ Backend build (Release): exit code 0 ✅ Backend test: exit code 0 ✅ Frontend install/typecheck/test/build: all exit code 0 Governance: AGENTS.md v16.0 sections 8, 13, 20 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,263 +0,0 @@
|
||||
<template>
|
||||
<div class="container mx-auto px-4 py-6">
|
||||
<!-- Header -->
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-3xl font-bold">User Management</h1>
|
||||
<PermissionGuard :required-roles="['Admin']">
|
||||
<button
|
||||
@click="showCreateDialog = true"
|
||||
class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700"
|
||||
>
|
||||
Create User
|
||||
</button>
|
||||
</PermissionGuard>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
|
||||
<input
|
||||
v-model="filters.search"
|
||||
type="text"
|
||||
placeholder="Search by email..."
|
||||
class="px-4 py-2 border rounded"
|
||||
/>
|
||||
<select
|
||||
v-model="filters.role"
|
||||
class="px-4 py-2 border rounded"
|
||||
>
|
||||
<option value="">All Roles</option>
|
||||
<option value="Admin">Admin</option>
|
||||
<option value="Analyst">Analyst</option>
|
||||
<option value="Trader">Trader</option>
|
||||
<option value="Viewer">Viewer</option>
|
||||
</select>
|
||||
<select
|
||||
v-model="filters.status"
|
||||
class="px-4 py-2 border rounded"
|
||||
>
|
||||
<option value="">All Status</option>
|
||||
<option value="active">Active</option>
|
||||
<option value="inactive">Inactive</option>
|
||||
<option value="suspended">Suspended</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- User List -->
|
||||
<QueryStateBoundary
|
||||
:loading="isLoading"
|
||||
:error="error"
|
||||
:empty="users.length === 0"
|
||||
>
|
||||
<div class="overflow-x-auto bg-white rounded shadow">
|
||||
<table class="w-full">
|
||||
<thead class="bg-gray-100">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left text-sm font-medium">Email</th>
|
||||
<th class="px-6 py-3 text-left text-sm font-medium">Roles</th>
|
||||
<th class="px-6 py-3 text-left text-sm font-medium">Status</th>
|
||||
<th class="px-6 py-3 text-left text-sm font-medium">Created</th>
|
||||
<th class="px-6 py-3 text-left text-sm font-medium">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="user in users"
|
||||
:key="user.id"
|
||||
class="border-t hover:bg-gray-50"
|
||||
>
|
||||
<td class="px-6 py-3">{{ user.email }}</td>
|
||||
<td class="px-6 py-3">
|
||||
<div class="flex gap-1">
|
||||
<span
|
||||
v-for="role in user.roles"
|
||||
:key="role"
|
||||
class="px-2 py-1 bg-blue-100 text-blue-800 text-xs rounded"
|
||||
>
|
||||
{{ role }}
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-3">
|
||||
<span
|
||||
:class="{
|
||||
'px-2 py-1 text-xs rounded': true,
|
||||
'bg-green-100 text-green-800': user.status === 'active',
|
||||
'bg-yellow-100 text-yellow-800': user.status === 'inactive',
|
||||
'bg-red-100 text-red-800': user.status === 'suspended',
|
||||
}"
|
||||
>
|
||||
{{ user.status }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-6 py-3 text-sm">{{ formatDate(user.createdAt) }}</td>
|
||||
<td class="px-6 py-3">
|
||||
<PermissionGuard :required-roles="['Admin']">
|
||||
<button
|
||||
@click="editUser(user)"
|
||||
class="text-blue-600 hover:text-blue-800 mr-4"
|
||||
>
|
||||
Edit
|
||||
</button>
|
||||
<button
|
||||
@click="deleteUser(user)"
|
||||
class="text-red-600 hover:text-red-800"
|
||||
>
|
||||
Delete
|
||||
</button>
|
||||
</PermissionGuard>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Pagination -->
|
||||
<div class="flex justify-between items-center mt-4">
|
||||
<span class="text-sm text-gray-600">
|
||||
Showing {{ users.length }} of {{ totalUsers }} users
|
||||
</span>
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
@click="previousPage"
|
||||
:disabled="currentPage === 1"
|
||||
class="px-3 py-1 border rounded disabled:opacity-50"
|
||||
>
|
||||
Previous
|
||||
</button>
|
||||
<span class="px-3 py-1">Page {{ currentPage }}</span>
|
||||
<button
|
||||
@click="nextPage"
|
||||
:disabled="currentPage * pageSize >= totalUsers"
|
||||
class="px-3 py-1 border rounded disabled:opacity-50"
|
||||
>
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</QueryStateBoundary>
|
||||
|
||||
<!-- Create/Edit Dialog -->
|
||||
<CreateUserDialog
|
||||
v-if="showCreateDialog"
|
||||
@create="createUser"
|
||||
@close="showCreateDialog = false"
|
||||
/>
|
||||
|
||||
<EditUserDialog
|
||||
v-if="editingUser"
|
||||
:user="editingUser"
|
||||
@update="updateUser"
|
||||
@close="editingUser = null"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useIdentityQuery } from '../composables/useIdentityQuery';
|
||||
import QueryStateBoundary from '@/shared/ui/components/QueryStateBoundary.vue';
|
||||
import PermissionGuard from '@/shared/ui/components/PermissionGuard.vue';
|
||||
import CreateUserDialog from '../components/CreateUserDialog.vue';
|
||||
import EditUserDialog from '../components/EditUserDialog.vue';
|
||||
|
||||
interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
roles: string[];
|
||||
status: 'active' | 'inactive' | 'suspended';
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
// State
|
||||
const showCreateDialog = ref(false);
|
||||
const editingUser = ref<User | null>(null);
|
||||
const currentPage = ref(1);
|
||||
const pageSize = 20;
|
||||
|
||||
const filters = ref({
|
||||
search: '',
|
||||
role: '',
|
||||
status: '',
|
||||
});
|
||||
|
||||
// Query
|
||||
const {
|
||||
data: users,
|
||||
isLoading,
|
||||
error,
|
||||
refetch,
|
||||
} = useIdentityQuery({
|
||||
page: currentPage,
|
||||
limit: pageSize,
|
||||
role: computed(() => filters.value.role || undefined),
|
||||
status: computed(() => filters.value.status || undefined),
|
||||
});
|
||||
|
||||
const totalUsers = computed(() => users.value?.total ?? 0);
|
||||
|
||||
// Methods
|
||||
const createUser = async (userData: { email: string; password: string; roles: string[] }) => {
|
||||
try {
|
||||
await $fetch('/api/users', {
|
||||
method: 'POST',
|
||||
body: userData,
|
||||
});
|
||||
showCreateDialog.value = false;
|
||||
await refetch();
|
||||
} catch (err) {
|
||||
console.error('Create user failed:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const editUser = (user: User) => {
|
||||
editingUser.value = user;
|
||||
};
|
||||
|
||||
const updateUser = async (roles: string[]) => {
|
||||
if (!editingUser.value) return;
|
||||
|
||||
try {
|
||||
await $fetch(`/api/users/${editingUser.value.id}`, {
|
||||
method: 'PATCH',
|
||||
body: { roles },
|
||||
});
|
||||
editingUser.value = null;
|
||||
await refetch();
|
||||
} catch (err) {
|
||||
console.error('Update user failed:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const deleteUser = async (user: User) => {
|
||||
if (!confirm(`Delete user ${user.email}?`)) return;
|
||||
|
||||
try {
|
||||
await $fetch(`/api/users/${user.id}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
await refetch();
|
||||
} catch (err) {
|
||||
console.error('Delete user failed:', err);
|
||||
}
|
||||
};
|
||||
|
||||
const formatDate = (date: string) => {
|
||||
return new Date(date).toLocaleDateString();
|
||||
};
|
||||
|
||||
const previousPage = () => {
|
||||
if (currentPage.value > 1) {
|
||||
currentPage.value--;
|
||||
}
|
||||
};
|
||||
|
||||
const nextPage = () => {
|
||||
if (currentPage.value * pageSize < totalUsers.value) {
|
||||
currentPage.value++;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* Component styles */
|
||||
</style>
|
||||
Reference in New Issue
Block a user