Initial commit: Grounded Flutter frontend

A to-do app that doesn't believe you — an enforcement layer rather than a
neutral ledger.

Architecture ported from Autoreceptives/Frontend/Receptive: stacked MVVM with
the mandatory 4-file screen pattern, one ParentViewModel owning the loading /
network / error overlays and the handleError decision tree, one AppDataManager
gateway, dio comms carrying the three identity headers, secure storage with
random-suffixed keys, and a single-chokepoint Navigator. Package root and Dart
package name are both Grounded; org is nya.

The enforcement engine, one unit per formula in utils/:

- DebtEngine      w(class) x severity(d) x decay(t), sublinear severity so old
                  misses cannot swamp the score; abandonment 2x with 30-day
                  decay immunity; late complete retains 30%
- StandingEngine  Good -> Warned -> Grounded -> Lockdown, derived not set;
                  Grounded replaces home with the overdue queue
- CapacityEngine  blocks over-scheduling against p50 of historically completed
                  minutes, with a learned per-category estimation multiplier
- IntegrityEngine session integrity, weekly volume, plyometric contact ceiling
                  and enforced recovery gaps
- ExcuseAnalyser  on-device excuse clustering plus the confrontation copy
- GuardrailEngine distress detection and rationed amnesty
- ToneEngine      all enforcement copy, so the tone cap lives in one place

CommitmentEvent is append-only and is the source of truth rather than the
status field, which is what makes honest history and excuse analysis possible.

Goals contain commitments via parentId, and a task can be run from a
full-screen runner that derives elapsed time from wall-clock so screen-off
cannot lose time. Backgrounding pauses the clock and is counted. The runner is
mirrored into an ongoing notification, with alarm-class full-screen intents
reserved for non-negotiables.

Design language, fonts, icon and native splash are in place; Mason bricks are
retargeted to this project and verified end-to-end.

flutter analyze lib/ reports no errors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mfu2gQLSFN21YRBcU2NrTt
This commit is contained in:
alvocool
2026-07-27 09:11:17 +03:00
commit 16bff634b5
315 changed files with 19132 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# 0.1.0+1
- TODO: Describe initial release.

View File

@@ -0,0 +1 @@
TODO: Add your license here.

View File

@@ -0,0 +1,27 @@
# mvvc_template
[![Powered by Mason](https://img.shields.io/endpoint?url=https%3A%2F%2Ftinyurl.com%2Fmason-badge)](https://github.com/felangel/mason)
A new brick created with the Mason CLI.
_Generated by [mason][1] 🧱_
## Getting Started 🚀
This is a starting point for a new brick.
A few resources to get you started if this is your first brick template:
- [Official Mason Documentation][2]
- [Code generation with Mason Blog][3]
- [Very Good Livestream: Felix Angelov Demos Mason][4]
- [Flutter Package of the Week: Mason][5]
- [Observable Flutter: Building a Mason brick][6]
- [Meet Mason: Flutter Vikings 2022][7]
[1]: https://github.com/felangel/mason
[2]: https://docs.brickhub.dev
[3]: https://verygood.ventures/blog/code-generation-with-mason
[4]: https://youtu.be/G4PTjA6tpTU
[5]: https://youtu.be/qjA0JFiPMnQ
[6]: https://youtu.be/o8B1EfcUisw
[7]: https://youtu.be/LXhgiF5HiQg

View File

@@ -0,0 +1,2 @@
abstract class Connect{{screen}}{
}

View File

@@ -0,0 +1,14 @@
import 'package:flutter/cupertino.dart';
import '../parent/ParentViewModel.dart';
import 'Connect{{screen}}.dart';
class View{{screen}} extends ParentViewModel {
Connect{{screen}} connection;
View{{screen}}(BuildContext context, this.connection) : super(context);
// Business logic goes here. Guard every network call with hasNetwork, wrap
// it in showLoading/closeLoading, and push results back through
// `connection` rather than touching widgets directly.
}

View File

@@ -0,0 +1,11 @@
import 'package:flutter/material.dart';
import '{{screen}}State.dart';
class {{screen}} extends StatefulWidget{
const {{screen}} ({Key? key}) : super(key: key);
@override
State<{{screen}}> createState() => {{screen}}State();
}

View File

@@ -0,0 +1,77 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart';
import 'package:Grounded/Grounded/about/internal/application/TextType.dart';
import 'package:Grounded/Grounded/designs/Responsive.dart';
import 'package:Grounded/Grounded/designs/Shell.dart';
import 'package:Grounded/Grounded/designs/text/Text.dart';
import 'package:Grounded/Grounded/utils/Colors.dart';
import 'Connect{{screen}}.dart';
import '{{screen}}.dart';
import 'View{{screen}}.dart';
class {{screen}}State extends State<{{screen}}> implements Connect{{screen}} {
View{{screen}}? _model;
@override
Widget build(BuildContext context) {
return ViewModelBuilder<View{{screen}}>.reactive(
viewModelBuilder: () => View{{screen}}(context, this),
onViewModelReady: (viewModel) {
_model = viewModel;
_initiate();
},
builder: (context, viewModel, child) => LayoutBuilder(
builder: (BuildContext context, BoxConstraints viewportConstraints) {
return Responsive(
mobile: _mobileView(viewportConstraints),
tablet: _tabletView(viewportConstraints),
desktop: _desktopView(viewportConstraints),
);
},
),
);
}
void _initiate() {
// Load initial data through _model here; push results back via the
// Connect{{screen}} callbacks below.
}
void _onBack() {
Navigator.pop(context);
}
Widget _mobileView(BoxConstraints viewportConstraints) {
return Sheet(
eyebrow: "Grounded",
title: "{{screen}}",
onBack: _onBack,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
displayTitle("{{screen}}"),
const SizedBox(height: 14),
text(
"Replace this with the screen content.",
14,
TextType.Regular,
color: colorGrey2,
height: 1.55,
),
],
),
);
}
Widget _tabletView(BoxConstraints viewportConstraints) {
return _mobileView(viewportConstraints);
}
Widget _desktopView(BoxConstraints viewportConstraints) {
return _mobileView(viewportConstraints);
}
}

View File

@@ -0,0 +1,38 @@
name: mvvc_template
description: A new brick created with the Mason CLI.
# The following defines the brick repository url.
# Uncomment and update the following line before publishing the brick.
# repository: https://github.com/my_org/my_repo
# The following defines the version and build number for your brick.
# A version number is three numbers separated by dots, like 1.2.34
# followed by an optional build number (separated by a +).
version: 0.1.0+1
# The following defines the environment for the current brick.
# It includes the version of mason that the brick requires.
environment:
mason: ^0.1.1
# Variables specify dynamic values that your brick depends on.
# Zero or more variables can be specified for a given brick.
# Each variable has:
# * a type (string, number, boolean, enum, array, or list)
# * an optional short description
# * an optional default value
# * an optional list of default values (array only)
# * an optional prompt phrase used when asking for the variable
# * a list of values (enums only)
# * an optional separator (list only)
vars:
project:
type: string
description: The project name
default: Grounded
prompt: What is your project name?
screen:
type: string
description: The name of the new screen
default: ActivityNew
prompt: What is your file name?